Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.20.1606201057530.32674@s1.palsenberg.com>
Date: Mon, 20 Jun 2016 11:02:15 +0200 (CEST)
From: Igmar Palsenberg <igmar@...senberg.com>
To: musl@...ts.openwall.com
Subject: Re: abort() fails to terminate PID 1 process



> After running alpine-linux based docker containers for a while we noticed
> some problematic behaviour when one of our services had a memory leak
> causing the process to abort.
> Instead of getting abnormal process termination we were seeing the process
> hanging at 100% cpu.
> 
> A minimal reproduction of this issue is to run
> 
> #include <stdlib.h>
> int main ()
> {
> abort();
> }
> 
> with "unshare --fork --pid" so that it runs as PID 1 in it's own PID
> namespace.
> 
> Would it be reasonable to add a fallback strategy in abort() for terminating
> processes when the signals don't have any effect?

This is a bad idea.

First, processes kan install handlers, which might 
instruct the kernel to ignore the signal. SIGABORT can be ignored. I don't 
expect my process to be SIGILL'ed next because of this (which, can also be 
ignored).
Libc should NOT mess with these kind of things, that's up to the 
application.

Second the behaviour you're seeing is due to the kernel's special PID 1 
handling : It ignores signals send to pid 1 for which an explicit handler 
has nog been installed.

Remedy : Fix your application. Better : Fix your whole setup, if you need 
these changes, it's broken by design.



Igmar

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.