Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / March 2004



Tip: Looking for answers? Try searching our database.

Weird DebugNewDoFree() crashes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J. Barnholt - 06 Mar 2004 12:28 GMT
Hi all,

My app keeps crashing in the destructor of one of my own classes when
the delete() operator invokes DebugNewDoFree()
(running CW 8.3 on 10.3 and 9.2.1).

The app crashes with a "unmapped memory exception" inside the
DebugNewDoFree() code where it tries to access a pointer to 0x30303030
This bit happens inside the loop looking for the block in the block list.

The pointer passed to delete()/DebugNewDoFree() is a valid pointer to
the object I'm about to delete(), still looking good  
(i.e. not 0x3030303030 but pointing to a valid object)

This bug keept me busy for quite some time, I've been checking every
pointer to every class that came into my mind and various bounds of
allocated structures, but everything looks fine.
Calling DebugNewValidateAllBlocks() every now and then didn't report any
error as well.

Any ideas .. ?

regards,
Jan Barnholt
Miro Jurisic - 06 Mar 2004 17:25 GMT
> My app keeps crashing in the destructor of one of my own classes when
> the delete() operator invokes DebugNewDoFree()
[quoted text clipped - 15 lines]
>
> Any ideas .. ?

Everything is not fine, however. 0x30303030 is not a DebugNew signature, but it
is '0000' in ascii. My suggestion would be to look at the memory around the
loation 0x30303030 was loaded from and see whether its contents look familiar.
My first guess would be that you have a buffer overrun.

hth

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

J. Barnholt - 07 Mar 2004 18:21 GMT
> > The app crashes with a "unmapped memory exception" inside the
> > DebugNewDoFree() code where it tries to access a pointer to 0x30303030
[quoted text clipped - 9 lines]
>
> meeroh

Thanks for the hint, keeping an eye on the DebugNew blocklist in the
memory window revealed that it was indeed overwritten by some
hidden sprintf call..

Calling sprintf with an uninitialized double of 123e+250 might not be
a good idea anyway, but I suppose that's why snprintf and the likes
were given to us.

thanks,
jan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.