From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10286 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: abort() PID 1 Date: Mon, 4 Jul 2016 11:31:40 +0200 Message-ID: <20160704093140.GH19691@port70.net> 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 1467624740 28557 80.91.229.3 (4 Jul 2016 09:32:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2016 09:32:20 +0000 (UTC) Cc: Jorge Almeida To: musl@lists.openwall.com Original-X-From: musl-return-10299-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 04 11:32:08 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 1bK0EU-0003ve-3j for gllmg-musl@m.gmane.org; Mon, 04 Jul 2016 11:32:02 +0200 Original-Received: (qmail 13896 invoked by uid 550); 4 Jul 2016 09:31:53 -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 13878 invoked from network); 4 Jul 2016 09:31:52 -0000 Mail-Followup-To: musl@lists.openwall.com, Jorge Almeida Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:10286 Archived-At: * Jorge Almeida [2016-07-04 01:09:32 -0700]: > What I thought I understood: > > - the kernel will not deliver any signal to process 1, unless a signal > handler for that particular signal has been installed > not all signals behave that way. > -if process 1 calls abort() (regardless of what purpose that would fill), then: > > - if a handler was setup, it should be done whatever the handler does > > - if a handler was not setup, nothing should happen (as in: > process didn't receive any signal at all) > this is raise(SIGABRT), abort is different. > > What the standards say: > > (http://pubs.opengroup.org/onlinepubs/9699919799/) > > "The SIGABRT signal shall be sent to the calling process as if by > means of raise() with the argument SIGABRT." > it also says "The abort() function shall cause abnormal process termination to occur, unless the signal SIGABRT is being caught and the signal handler does not return." and "The abort() function shall not return." (in c11 abort is _Noreturn and returning from such a function is undefined behaviour). > DISCLAIMER: well-meaning amateur here. I'm pretty sure I understood > what I quoted, but I'm assuming the standard doesn't have any > self-inconsistencies. there is no inconsistency. abort should raise(SIGABRT) and it should terminate the process. (normally there should be an abort syscall provided by the kernel, but linux does not have it.) > So, can one trust the man pages? not always, use the standard for standard interfaces.