From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7395 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] replace 'hlt' by 'ud2' in i386/x32/x86_64 a_crash implementations Date: Fri, 17 Apr 2015 11:12:20 +0300 (MSK) Message-ID: References: <1429207139-10359-1-git-send-email-amonakov@ispras.ru> <20150417055500.GW6817@brightrain.aerifal.cx> 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 1429258357 16268 80.91.229.3 (17 Apr 2015 08:12:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Apr 2015 08:12:37 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7408-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 17 10:12:36 2015 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 1Yj1O5-0003DK-Si for gllmg-musl@m.gmane.org; Fri, 17 Apr 2015 10:12:34 +0200 Original-Received: (qmail 21640 invoked by uid 550); 17 Apr 2015 08:12:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21621 invoked from network); 17 Apr 2015 08:12:32 -0000 In-Reply-To: <20150417055500.GW6817@brightrain.aerifal.cx> User-Agent: Alpine 2.11 (LNX 23 2013-08-11) Xref: news.gmane.org gmane.linux.lib.musl.general:7395 Archived-At: On Fri, 17 Apr 2015, Rich Felker wrote: > On Thu, Apr 16, 2015 at 08:58:59PM +0300, Alexander Monakov wrote: > > --- > > ud2 is also what GCC and Clang use to implement __builtin_trap() > > > > ud2 causes SIGILL rather than SIGSEGV; SIGSEGV is more likely to have a custom > > signal handler installed > > I've pondered instead using: > > push $-1 > mov $175,%eax > xor %ebx,%ebx > mov %esp,%ecx > int $128 > hlt // or ud2? > > This should be uncatchable but it's moderately larger. An argument in favor of plain hlt/ud2 is that registers and memory are preserved, in case someone will be analyzing the coredump. Alexander