From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10162 Path: news.gmane.org!not-for-mail From: Igmar Palsenberg Newsgroups: gmane.linux.lib.musl.general Subject: Re: abort() fails to terminate PID 1 process Date: Mon, 20 Jun 2016 11:02:15 +0200 (CEST) Message-ID: References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1466413356 4426 80.91.229.3 (20 Jun 2016 09:02:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2016 09:02:36 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10175-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 20 11:02:35 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bEv6E-0006oK-JD for gllmg-musl@m.gmane.org; Mon, 20 Jun 2016 11:02:31 +0200 Original-Received: (qmail 11526 invoked by uid 550); 20 Jun 2016 09:02:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 11504 invoked from network); 20 Jun 2016 09:02:26 -0000 DKIM-Filter: OpenDKIM Filter v2.10.3 s1.palsenberg.com u5K92FbS010346 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=palsenberg.com; s=s1; t=1466413347; bh=3J+W9wBCW4ZfhtySjxaVSx7bCFmoWWXPcrGex+QZSe0=; h=Date:From:To:Subject:In-Reply-To:References:From; b=X7E0uVWxKDoU8nwk79B2pIASP/cn34kJASPmsNgCwdsdeQwhnFiaAjX8d5bwIRzEI +2pxaQ0HOYYpNc2LGw+mmPCNBMUSvCxkwh8PvYFkZ2n4IHcDl+ooo/dX6aUhoUOr1K sFEyNHeAWr6sllu7Rm1xI+lb6z/t4TM5ATAWp9ds= In-Reply-To: User-Agent: Alpine 2.20 (LRH 67 2015-01-07) X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.5.16 (s1.palsenberg.com [127.0.0.1]); Mon, 20 Jun 2016 11:02:15 +0200 (CEST) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on s1.palsenberg.com Xref: news.gmane.org gmane.linux.lib.musl.general:10162 Archived-At: > 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 > 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