Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - coredumps with multithreaded processes: (6 Items)
   
coredumps with multithreaded processes  
I have 3 processes running on 6.3.2 with the libc.so.2 patch (patch-632-1125-632libc-sigqfix) on a x86 core 2 duo box.  
One of the processes is a resource mgr.  I am compiling with 3.3.5

One of the 3 processes crashes after a few minutes of running.  Examining the coredumps almost always shows the 
offending code in "free" (called from "delete" c++ app).  Occaisionally the coredumps aren't usable.

I have removed all the C++ stl library calls such as std::auto_ptr and std::string that I can (they seemed to be the 
area of the crash).

I still haven't tracked down the problem, but I am beginning to suspect there may be a heap problem.

Has anyone seen a problem like this or have any suggestions on how to track down the problem?

Thanx
Tim
Re: coredumps with multithreaded processes  
You can use QNX IDE Memory Analysis tool that specifically designed to find heap problems. You can also use command line
 version of it. You should be able to find docs about it online.

Tim Gessner wrote:
> I have 3 processes running on 6.3.2 with the libc.so.2 patch (patch-632-1125-632libc-sigqfix) on a x86 core 2 duo box.
  One of the processes is a resource mgr.  I am compiling with 3.3.5
> 
> One of the 3 processes crashes after a few minutes of running.  Examining the coredumps almost always shows the 
offending code in "free" (called from "delete" c++ app).  Occaisionally the coredumps aren't usable.
> 
> I have removed all the C++ stl library calls such as std::auto_ptr and std::string that I can (they seemed to be the 
area of the crash).
> 
> I still haven't tracked down the problem, but I am beginning to suspect there may be a heap problem.
> 
> Has anyone seen a problem like this or have any suggestions on how to track down the problem?
> 
> Thanx
> Tim
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post12563
> 
Attachment: Text elaskavaia.vcf 116 bytes
Re: coredumps with multithreaded processes  
Thanx
Re: coredumps with multithreaded processes  
The Memory Analysis tool running from the IDE freezes the remote QNX system (I am windows hosted).

Here is what I'm doing to test.  I have a resource mgr which does not have any hardware device.  It is a error logging 
component which holds a stl deque in memory.  It is multithreaded.  I have an additional thread in that component which 
takes the errors from the stl deque and writes them to a database.

The stl deque is protected with a mutex.  The additional thread which updates the database blocks on a conditional 
variable until an error is logged.

I have a very simple multithreaded test program which just writes error messages to the logging component.  When I run 
these two without the memory analysis, the event logging component crashes on a memory access of some type.  The 
specific access is random, but it is always on a memory allocation, deletion or simple read.

When I run the memory analysis from the IDE the keyboard on the remote QNX machine freezes until I stop the debugger 
from the IDE.

Any help would be greatly appreciated!  Thanx
Tim
Re: coredumps with multithreaded processes  
P.S. I'm running 6.3.2 on a multi core CPU.
Re: coredumps with multithreaded processes  
You should not run it in Debbugging session, try to launch it as Run launch configuration.