Zombie and Uninterruptable Sleep Processes

This is a discussion on Zombie and Uninterruptable Sleep Processes within the Linux Programming forums, part of the Platform Specific Boards category; I'm trying to cross-compile 'cvoicecontrol' for my NAS (Synology DS209j, ppc). Synology Inc. - NEW NAS Experience - Products :: ...

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    6

    Zombie and Uninterruptable Sleep Processes

    I'm trying to cross-compile 'cvoicecontrol' for my NAS (Synology DS209j, ppc).
    Synology Inc. - NEW NAS Experience - Products :: Disk Station DS209j :: Specifications

    Everytime I run the binary created from cvoicecontrol.c & cvoicecontrol.h, it freezes and creates 1 zombie process and 3 'D' type processes. Thus requiring a reboot.


    Anyone know how I can begin troubleshooting this? Or can anyone take a look at the source?
    http://www.kiecza.net/daniel/linux/

    or you can get it from most linux package feeds.

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,159
    I don't know the source of the actual bug, but you should be able to avoid a reboot by killing the zombie's parent process. If the parent process is init, it indicates some kind of kernel-level deadlock.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    6
    Yes, I kill the zombie processes parent, and the PPID becomes '1' as init inherits all orphans. ( or maybe the zombie process's parent was 1 all along?)

    There has got to be something with the pthreads coding...I also heard something about pthreads not working on a NAS, although I have checked and I do have libpthreads.so


    When this program freezes up , I can't even ctrl+c to get out of it, I have to close the terminal window and start a new one just to run a 'ps aux | grep cvoice'


    Maybe the pthreads aren't managed well in the code?

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    6
    I was able to capture this with gdb

    Program received signal SIG32, Real-time event 32.
    0x0ff0183c in ?? () from /opt/lib/libpthread.so.0

  5. #5
    Registered User
    Join Date
    Jan 2010
    Posts
    6
    ok i guess gdb doesn't handle threads real well so I passed it this:

    (gdb) handle SIG32 nostop noprint pass



    and then got this:

    Starting program: /usr/local/bin/cvoicecontrol --once hello.cvc
    [New LWP 20573]

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 20573]
    0x0fe161b8 in free () from /lib/libc.so.6


    (gdb) bt
    #0 0x0fe161b8 in free () from /lib/libc.so.6
    #1 0x1000a38c in preprocess ()
    #2 0x0fefef6c in ?? () from /opt/lib/libpthread.so.0
    #3 0x0fe79bc0 in clone () from /lib/libc.so.6
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)

  6. #6
    Registered User
    Join Date
    Jan 2010
    Posts
    6
    ahh I learned how to compile with -g..big help!!

    now I see this:

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 23404]
    0x1000a4b4 in preprocess () at cvoicecontrol.c:1129
    1129
    (gdb) bt
    #0 0x1000a4b4 in preprocess () at cvoicecontrol.c:1129
    #1 0x0fefef6c in ?? () from /opt/lib/libpthread.so.0
    #2 0x0fe79bc0 in clone () from /lib/libc.so.6
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)




    Line 1129:
    frame[i] = ((float)((signed short)(buffer[frameI*OFFSET+2*i]|(buffer[frameI*OFFSET+2*i+1]<<8)))) *


    does this mean anything?


    Or when I list within gdb:

    (gdb) list cvoicecontrol.c:1129
    1124 /***** prepare a hamming windowed frame from the audio data ... */
    1125
    1126 for (i = 0; i < FFT_SIZE; i++)
    1127 frame[i] = ((float)((signed short)(buffer[frameI*OFFSET+2*i]|(buffer[frameI*OFFSET+2*i+1]<<8)))) *
    1128 hamming_window[i];
    1129
    1130 preprocessFrame(frame, feat_vector); /* ... and have it preprocessed */
    1131
    1132 /***** put the resulting feature vector in queue2 using the proper status flag*/
    1133

  7. #7
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,159
    Quote Originally Posted by pomprocker View Post
    Line 1129:
    frame[i] = ((float)((signed short)(buffer[frameI*OFFSET+2*i]|(buffer[frameI*OFFSET+2*i+1]<<8)))) *
    Ugh, that line of code is awful, and I'm a DSP programmer...

    If the segfault is occuring on that line, then it means one of the three array dereferences is going out of bounds. Either framel or i is going too far or the buffer array was not allocated large enough. Beyond that, it's impossible to tell without seeing more code, and if the rest of the code looks anything like that, I don't really want to see it
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  8. #8
    Registered User
    Join Date
    Jan 2010
    Posts
    6
    Here is a link to it:

    Koders Code Search: cvoicecontrol.c - C - GPL


    I was originally getting problems with free() located within preprocess() as you can see from my earlier posts. Then I commented it out and now having problems with line 1129.

    Hope you can solve this!!

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21