Thread: pthreads - hanging process - gdb output

  1. #1
    Registered User
    Join Date
    Aug 2002

    pthreads - hanging process - gdb output

    Got a hanging process (with code posted in

    attached to process pid and got the following backtrace:

    (gdb) bt
    #0  0x40188a35 in pthread_getconcurrency () from /lib/i686/
    #1  0x40187db8 in pthread_create () from /lib/i686/
    #2  0x4018a210 in sem_unlink () from /lib/i686/
    #3  0x40186d77 in pthread_mutex_lock () from /lib/i686/
    #4  0x420993d5 in adjtime () from /lib/i686/
    #5  0x4209829e in localtime_r () from /lib/i686/
    #6  0x420dfa86 in vsyslog () from /lib/i686/
    #7  0x420df9af in syslog () from /lib/i686/
    #8  0x08066312 in ouch ()
    #9  0x4018b7ce in __pthread_clock_settime () from /lib/i686/
    #10 0x42028518 in killpg () from /lib/i686/
    #11 0x080660bc in main ()
    #12 0x42015967 in __libc_start_main () from /lib/i686/
    the ouch function is my signal handling function for INT, TERM and HUP signals.

    Does anyone think this is a problem because I'm not limiting the number of threads? It's getting a lot of connections .

    Could this be caused by PTHREAD_THREADS_MAX being reached ?

    Does PTHREAD_THREADS_MAX apply if I'm detaching the threads with pthread_detach ?

    Any suggestions to control short term until I get a thread pool up and running ?

    Hang on - I just noticed it's in the syslog functions . Is syslog thread-safe I'm calling it in the signal handling function and in the main thread at the same time.



  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    In your singal handler, do as little as possible. Maybe set a global var only, and let the core app (or thread) take care of what to do. As for thread safe, your might have syslog_r()
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can any body unfold this sentences related to GDB.
    By vlrk in forum Linux Programming
    Replies: 2
    Last Post: 11-12-2008, 05:42 AM
  2. Need help fixing bugs in data parsing program
    By daluu in forum C Programming
    Replies: 8
    Last Post: 03-27-2003, 06:02 PM
  3. Control different DA output value!
    By Hunterhunter in forum A Brief History of
    Replies: 1
    Last Post: 03-13-2003, 12:11 PM
  4. how to get output of a process?
    By dkt in forum C Programming
    Replies: 5
    Last Post: 01-10-2003, 12:20 PM
  5. how to get the output of a non-stop process?
    By dkt in forum C Programming
    Replies: 1
    Last Post: 04-27-2002, 11:18 AM