From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7393 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] replace 'hlt' by 'ud2' in i386/x32/x86_64 a_crash implementations Date: Thu, 16 Apr 2015 20:58:59 +0300 Message-ID: <1429207139-10359-1-git-send-email-amonakov@ispras.ru> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1429207185 11760 80.91.229.3 (16 Apr 2015 17:59:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Apr 2015 17:59:45 +0000 (UTC) Cc: Alexander Monakov To: musl@lists.openwall.com Original-X-From: musl-return-7406-gllmg-musl=m.gmane.org@lists.openwall.com Thu Apr 16 19:59:45 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 1Yio4h-0001ZK-RU for gllmg-musl@m.gmane.org; Thu, 16 Apr 2015 19:59:39 +0200 Original-Received: (qmail 17612 invoked by uid 550); 16 Apr 2015 17:59:38 -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 17550 invoked from network); 16 Apr 2015 17:59:33 -0000 X-Mailer: git-send-email 2.1.3 Xref: news.gmane.org gmane.linux.lib.musl.general:7393 Archived-At: --- 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 arch/i386/atomic.h | 2 +- arch/x32/atomic.h | 2 +- arch/x86_64/atomic.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/i386/atomic.h b/arch/i386/atomic.h index 4fe7bde..2f78d31 100644 --- a/arch/i386/atomic.h +++ b/arch/i386/atomic.h @@ -103,7 +103,7 @@ static inline void a_barrier() static inline void a_crash() { - __asm__ __volatile__( "hlt" : : : "memory" ); + __asm__ __volatile__( "ud2" : : : "memory" ); } diff --git a/arch/x32/atomic.h b/arch/x32/atomic.h index 333098c..a8e7603 100644 --- a/arch/x32/atomic.h +++ b/arch/x32/atomic.h @@ -98,7 +98,7 @@ static inline void a_barrier() static inline void a_crash() { - __asm__ __volatile__( "hlt" : : : "memory" ); + __asm__ __volatile__( "ud2" : : : "memory" ); } diff --git a/arch/x86_64/atomic.h b/arch/x86_64/atomic.h index 333098c..a8e7603 100644 --- a/arch/x86_64/atomic.h +++ b/arch/x86_64/atomic.h @@ -98,7 +98,7 @@ static inline void a_barrier() static inline void a_crash() { - __asm__ __volatile__( "hlt" : : : "memory" ); + __asm__ __volatile__( "ud2" : : : "memory" ); } -- 2.1.3