PDA

View Full Version : Hangs with pthread_getconcurrency



rotis23
04-26-2005, 10:27 AM
Hi All - seems pretty quiet in here now-a-days :(

I've got a problem with various processes hanging on pthread_getconcurrency. I've managed to attach to an example and do a backtrace:

0x40187a35 in pthread_getconcurrency () from /lib/i686/libpthread.so.0
(gdb) bt
#0 0x40187a35 in pthread_getconcurrency () from /lib/i686/libpthread.so.0
#1 0x40186db8 in pthread_create () from /lib/i686/libpthread.so.0
#2 0x40188e68 in sem_unlink () from /lib/i686/libpthread.so.0
#3 0x40185d96 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
#4 0x401884b4 in flockfile () from /lib/i686/libpthread.so.0
#5 0x42064c4a in puts () from /lib/i686/libc.so.6
#6 0x4018a7ce in __pthread_clock_settime () from /lib/i686/libpthread.so.0
#7 0x42028518 in killpg () from /lib/i686/libc.so.6
#8 0x40186db8 in pthread_create () from /lib/i686/libpthread.so.0
#9 0x40188e68 in sem_unlink () from /lib/i686/libpthread.so.0
#10 0x40185d96 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
#11 0x401884b4 in flockfile () from /lib/i686/libpthread.so.0
#12 0x4204c001 in vfprintf () from /lib/i686/libc.so.6
#13 0x42052592 in printf () from /lib/i686/libc.so.6
#14 0x080698b8 in StartSocketServer(void*, int) ()
#15 0x08069b24 in main ()
#16 0x42015967 in __libc_start_main () from /lib/i686/libc.so.6
(gdb)


Umm - maybe I'm reading the backtrace wrong but why is printf sparking such a series of methods calls through the creation of a pthread to pthread_getconcurrency???

I'm thinking this is an OS issue as it's happened more than once with different processes - google isn't much help.

I'm using redhat 8.0 (I know!!) and a 2.4 kernel :eek:

Anyone seen this before :confused:

Cheers,, rotis23

Salem
04-26-2005, 11:11 AM
In the absense of your code, I'm going to say there is a problem with your code.

rotis23
04-27-2005, 01:16 PM
OK - I appreciate that. This is more of a general question on debugging I guess.

I'm really interested in what printf is doing in this stack trace.

Salem
04-28-2005, 11:08 AM
Yes, it's an OS issue.

Sorry, but I've no idea what your question is. It seems to me to be, "hey, look at this stack trace, isn't it freaky?"

To which the answer is, "yes, I've read it".

rotis23
04-28-2005, 01:02 PM
heh - OK (you're holding back on me) - Let's state some questions:

- Is printf really calling all those nested functions underneath?

- Is pthread_getconcurrency a known rogue?

- Is gdb/strace returning pthread_getconcurrency because I'm attaching to the parent process? i.e. is the real problem in a child thread that I cannot attach to?

- Should I stop using stable, reliable yet completely out-of-date and unpatchable redhat 8.0? ;)