For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > December 2004 > multhread coredumps









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author multhread coredumps
mike

2004-12-15, 8:57 pm

Hi,
I have strange problem on UnixWare system:
Let's consider simple two threads program:
- two threads, each executes the function:
while(1)
{
string s="something";
s+=:"foo";
map<string, integer> mp;
//some operations on mp;
//calling poll function to sleep for 100ms
}

If I exectue one instance of this program everything works OK.
But when I execute two or more instances all of them coredumps.
The examination of the stacks indicates that in the funtion block() SIGSEGV
was received.
I used the truss command and just before the crush function prepblock()
failes (EINVAL).
The situation is strange, because if I remove the operations on string and
map it works.
Moreover it also works when I don't call poll fuction.
But when there are both it fails....
This problem only appears on HP platform (I check two machines).
Program was compiled by g++ ver 2.65 or something.
If those troubles are caused by string or map why it works well on single
process instance ??

Btw. Do you know what for are the funcitons (I suppose kernel function):
block(), prepblock(), unblock() ?

Regards



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com