[lkml]   [2004]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subjectunkillable process
    It's really bad when a task group leader exits.
    The process becomes unkillable.

    This is with the 2.6.8-rc1 kernel. I haven't seen
    any mention of this getting fixed since then.
    Here's the top of the /proc/*/status file:

    Name: a.out
    State: Z (zombie)
    SleepAVG: 59%
    Tgid: 9662
    Pid: 9662
    PPid: 1
    TracerPid: 0
    Uid: 1000 1000 1000 1000
    Gid: 1000 1000 1000 1000
    FDSize: 0
    Groups: 500 1000
    Threads: 9

    Here's the code:

    #include <sys/types.h>
    #include <unistd.h>
    #include <signal.h>
    #include <stdio.h>
    #include <sched.h>

    #ifndef CLONE_THREAD
    #define CLONE_THREAD 0x00010000
    #ifndef CLONE_DETACHED
    #define CLONE_DETACHED 0x00400000
    #ifndef CLONE_STOPPED
    #define CLONE_STOPPED 0x02000000


    static pid_t one;

    static void die(int signo){

    static void hang(void){
    for(;;) pause();

    static int clone_fn(void *vp){
    return 0; // keep gcc happy

    static long clone_stack_data[2048];
    #ifdef __hppa__
    static long *clone_stack = &clone_stack_data[0];
    static long *clone_stack = &clone_stack_data[2048];

    int main(int argc, char *argv[]){
    pid_t minime;
    int i = 8;

    one = getpid();
    if(fork()) hang(); // parent later killed as readyness signal

    // better be stopped... they share a stack
    minime = clone(clone_fn, clone_stack, FLAGS | CLONE_STOPPED, NULL);
    perror("no clone");

    kill(one,SIGHUP); // let the shell know we're ready

    _exit(0); // make task group leader a zombie
    return 0; // keep gcc happy

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:07    [W:0.020 / U:6.596 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site