Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535992

Re: Unkillable processes due to PTRACE_TRACEME again

From Oleg Nesterov <oleg@redhat.com>
Newsgroups linux.kernel
Subject Re: Unkillable processes due to PTRACE_TRACEME again
Date 2016-12-05 11:50 +0100
Message-ID <sKZ0l-3qn-1@gated-at.bofh.it> (permalink)
References <sK14e-7tU-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/02, Dmitry Vyukov wrote:
>
> I am not on 2caceb3294a78c389b462e7e236a4e744a53a474 (Dec 1). And see
> the same unwaitable zombie processes.

This is another thing, and notabug. This is how ptrace works,

> void *thr(void *arg)
> {
>   ptrace(PTRACE_TRACEME, 0, 0, 0);
> }
>
> int main()
> {
>   int pid = fork();
>   if (pid == 0) {
>     pthread_t th;
>     pthread_create(&th, 0, thr, 0);
>     usleep(100000);
>     exit(0);
>   }
>   usleep(200000);
>   kill(pid, SIGKILL);
>   int status = 0;
>   waitpid(pid, &status, __WALL);

waitpid(pid) hangs because you need to reap the sub-thread first.

Oleg.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Unkillable processes due to PTRACE_TRACEME again Dmitry Vyukov <dvyukov@google.com> - 2016-12-02 19:50 +0100
  Re: Unkillable processes due to PTRACE_TRACEME again Pavel Machek <pavel@ucw.cz> - 2016-12-02 22:10 +0100
    Re: Unkillable processes due to PTRACE_TRACEME again Dmitry Vyukov <dvyukov@google.com> - 2016-12-03 17:00 +0100
      Re: Unkillable processes due to PTRACE_TRACEME again Pavel Machek <pavel@ucw.cz> - 2016-12-03 20:20 +0100
  Re: Unkillable processes due to PTRACE_TRACEME again Oleg Nesterov <oleg@redhat.com> - 2016-12-05 11:50 +0100
    Re: Unkillable processes due to PTRACE_TRACEME again Oleg Nesterov <oleg@redhat.com> - 2016-12-05 12:10 +0100
      Re: Unkillable processes due to PTRACE_TRACEME again Dmitry Vyukov <dvyukov@google.com> - 2016-12-05 15:10 +0100
        Re: Unkillable processes due to PTRACE_TRACEME again Oleg Nesterov <oleg@redhat.com> - 2016-12-05 18:10 +0100

csiph-web