lkml.org 
[lkml]   [2019]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] kernel/exit: do panic earlier to get coredump if global init task exit
On 12/16, qiwuchen55@gmail.com wrote:
>
> + * If all threads of global init have exited, do panic imeddiately
> + * to get the coredump to find any clue for init task in userspace.
> + */
> + group_dead = atomic_dec_and_test(&tsk->signal->live);
> + if (unlikely(is_global_init(tsk) && group_dead))
> + panic("Attempted to kill init! exitcode=0x%08lx\n", code);
^^^^

No, we should not throw out the useful info, please use

signal->group_exit_code ?: code

as the current code does.

And I am worried atomic_dec_and_test() is called too early...

Say, acct_process() can report the exit while some sub-thread sleeps
in PTRACE_EVENT_EXIT? I'd prefer to not move it up too much, at least
before exit_signals().

Oleg.

\
 
 \ /
  Last update: 2019-12-16 18:29    [W:0.125 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site