Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > core dump at _malloc_unlocked

Reply
Thread Tools

core dump at _malloc_unlocked

 
 
Martin
Guest
Posts: n/a
 
      08-25-2003
Hi,
I am developing a "huge" and portable software which works fine
on windows in Release/Debug Mode and on Unix in Debug Mode but crashes
when it "new" an object(GL_V5_CCM_RQRealTime_Rpy* msgBody = new
GL_V5_CCM_RQRealTime_Rpy in Release Mode. It is always that object
and it can crash anywhere when this object is 'new'. I got a core and
i used dbx to back trace to "_malloc_unlocked". I have used
purify(Windows) to check if there is anything wrong and i also use
"_heapchk()" in windows and everything goes fine. It seems to be
platform specific and Solaris seems to be 'stricter' and so it
crashes. I have no clue and i am checking the object time and time...
but found nothing wrong. I am sure the Solaris Machine has enough
memory. Now i recompile the software again and hope it was cause by
"Bad Compilation".
Any comments are welcome appreciated!!!!!

MC
 
Reply With Quote
 
 
 
 
Attila Feher
Guest
Posts: n/a
 
      08-25-2003
Martin wrote:
> Hi,
> I am developing a "huge" and portable software which works fine
> on windows in Release/Debug Mode and on Unix in Debug Mode but crashes
> when it "new" an object(GL_V5_CCM_RQRealTime_Rpy* msgBody = new
> GL_V5_CCM_RQRealTime_Rpy in Release Mode. It is always that object
> and it can crash anywhere when this object is 'new'. I got a core and
> i used dbx to back trace to "_malloc_unlocked". I have used
> purify(Windows) to check if there is anything wrong and i also use
> "_heapchk()" in windows and everything goes fine. It seems to be
> platform specific and Solaris seems to be 'stricter' and so it
> crashes. I have no clue and i am checking the object time and time...
> but found nothing wrong. I am sure the Solaris Machine has enough
> memory. Now i recompile the software again and hope it was cause by
> "Bad Compilation".
> Any comments are welcome appreciated!!!!!


Check OS patches (esp. ones required by the compiler or recommended by Sun).
Also on Solaris this very crash usually happens if you have "double deleted"
something. Try using the memory checking libraries.

--
Attila aka WW


 
Reply With Quote
 
 
 
 
Kevin Goodsell
Guest
Posts: n/a
 
      08-25-2003
Martin wrote:

> Hi,
> I am developing a "huge" and portable software which works fine
> on windows in Release/Debug Mode and on Unix in Debug Mode but crashes
> when it "new" an object(GL_V5_CCM_RQRealTime_Rpy* msgBody = new
> GL_V5_CCM_RQRealTime_Rpy in Release Mode. It is always that object
> and it can crash anywhere when this object is 'new'. I got a core and
> i used dbx to back trace to "_malloc_unlocked". I have used
> purify(Windows) to check if there is anything wrong and i also use
> "_heapchk()" in windows and everything goes fine. It seems to be
> platform specific and Solaris seems to be 'stricter' and so it
> crashes. I have no clue and i am checking the object time and time...
> but found nothing wrong. I am sure the Solaris Machine has enough
> memory. Now i recompile the software again and hope it was cause by
> "Bad Compilation".
> Any comments are welcome appreciated!!!!!
>


You have probably corrupted the dynamic memory system by writing to
memory that you didn't own, or some other form of undefined behavior,
regardless of what purify thinks. (By the way, why are you trying to
debug the problem on the system it works on? Wouldn't it make more sense
to track the problem on the system where the problem occurs?)

There's not much we can say other than good luck. And code more
carefully next time.

By the way, in modern C++ you shouldn't need to use 'new' all that
often, and when you do it's probably best to use a smart pointer instead
of a regular pointer. Avoiding unnecessary low-level memory management
is a good way to reduce bugs.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

 
Reply With Quote
 
hitbandil hitbandil is offline
Junior Member
Join Date: Nov 2008
Posts: 1
 
      11-18-2008
Hello Martin,

We are also facing a similar issue on our Solaris box. Our code works in debug mode but crashes in the release mode. We think that our issue is system specific as we are not able to reproduce the issue on our test servers.

Do you have any solution of the issue mentioned in the mail thread? Any help would be highly appreciated.

Thanks and regards,
Hitesh
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dump complete java VM state as core dump (not via OS) possible? halfdog Java 12 02-21-2013 06:14 AM
Core Solo & Core Duo are not Core microarchitecture; 65nm Pentium M chips bigal Hardware 0 03-22-2006 11:24 AM
Cisco AP1200 core dump B Thompson Cisco 7 11-26-2005 03:59 AM
Read Core Dump file ns Cisco 8 05-26-2005 03:07 AM
core dump at _malloc_unlocked Martin C Programming 1 08-25-2003 09:57 AM



Advertisments