From patchwork Wed May 21 08:23:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roman Khimov X-Patchwork-Id: 350986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id B2539140077 for ; Wed, 21 May 2014 18:32:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E845F32BED; Wed, 21 May 2014 08:32:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8g87PPzsbdCl; Wed, 21 May 2014 08:32:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6651432BDD; Wed, 21 May 2014 08:32:13 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AEC6F1BFA01 for ; Wed, 21 May 2014 08:32:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AD04A8A550 for ; Wed, 21 May 2014 08:32:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sv8nXgp2ks8M for ; Wed, 21 May 2014 08:32:10 +0000 (UTC) X-Greylist: delayed 00:08:46 by SQLgrey-1.7.6 Received: from mx.altell.ru (mx.altell.ru [178.16.156.18]) by hemlock.osuosl.org (Postfix) with ESMTP id B0A1D8A4F5 for ; Wed, 21 May 2014 08:32:09 +0000 (UTC) Received: from sencha.localnet (sencha.office.altell.ru [10.180.21.135]) by mx.altell.ru (Postfix) with ESMTPS id 949785301; Wed, 21 May 2014 12:23:17 +0400 (MSK) From: Roman Khimov To: uclibc@uclibc.org Subject: Re: [PATCH] fix pthread_cancel lead to segmentation fault for x86_64. Date: Wed, 21 May 2014 12:23:08 +0400 Message-ID: <10612639.NDcb73UiM2@sencha> Organization: ALTELL Ltd. User-Agent: KMail/4.11.5 (Linux/3.11.10-7-desktop; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1400604775-20602-1-git-send-email-glen4linux@gmail.com> References: <1400604775-20602-1-git-send-email-glen4linux@gmail.com> MIME-Version: 1.0 X-Altell-MailScanner-ID: 949785301.A6F9D X-Altell-MailScanner: Found to be clean X-Altell-MailScanner-From: khimov@altell.ru X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org В письме от 21 мая 2014 00:52:55 пользователь ZhangPu написал: > --- a/libc/sysdeps/linux/x86_64/sigaction.c > +++ b/libc/sysdeps/linux/x86_64/sigaction.c > @@ -116,6 +116,7 @@ libc_hidden_weak(sigaction) > #define RESTORE(name, syscall) RESTORE2(name, syscall) > #define RESTORE2(name, syscall) \ > __asm__ ( \ > + " nop\n" \ > ".text\n" \ > "__" #name ":\n" \ > " movq $" #syscall ", %rax\n" \ I think it should be aligned, like: At least that's what we've used internally for quite some time and it works good (yep, should've forwarded it here earlier). See also: http://git.alpinelinux.org/cgit/aports/tree/main/libc0.9.32/0007-libc-x86-fix-stack-unwinding-and-backtrace-informati.patch?h=v2.5.0 --- a/libc/sysdeps/linux/x86_64/sigaction.c +++ b/libc/sysdeps/linux/x86_64/sigaction.c @@ -117,6 +117,8 @@ libc_hidden_weak(sigaction) #define RESTORE2(name, syscall) \ __asm__ ( \ ".text\n" \ + "nop\n" \ + ".align 16\n" \ "__" #name ":\n" \ " movq $" #syscall ", %rax\n" \ " syscall\n" \