c - Program stops running on terminal but process persists -
c - Program stops running on terminal but process persists -
when programme reaches end, prints out "sleep x seconds" executes sleep(x). however, after print happens, programme not hang @ , exits. using ps can see process still running in background (though may kid zombie).
very basic hierarchy of code:
main -> func1 -> fork multiple func2, set alarm() -(alarm goes off)> func3
using printf , fflush, func2 never gets entered it's called in func1 after successful kid process spawned.
i've tried using gdb appears mess when start using shared memory between parent/child fork().
there's on 1000 lines of code, posting rather much.
question: thought on how debug or have thought of may cause this? note: calls exit() coupled perror() before.
the issue wrong access shared memory. abruptly stopped programme without errors.
c gdb fork
Comments
Post a Comment