From patchwork Tue May 20 16:52:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ZhangPu X-Patchwork-Id: 350799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 410EC140081 for ; Wed, 21 May 2014 02:53:35 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C6F848A586; Tue, 20 May 2014 16:53:33 +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 wKUkvkcJI17b; Tue, 20 May 2014 16:53:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 612CF8A52C; Tue, 20 May 2014 16:53:32 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id A81AF1BF9F9 for ; Tue, 20 May 2014 16:53:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A8ACF8B968 for ; Tue, 20 May 2014 16:53:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id acPZ12-TGEkw for ; Tue, 20 May 2014 16:53:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 491B388F4E for ; Tue, 20 May 2014 16:53:30 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id ld10so492702pab.17 for ; Tue, 20 May 2014 09:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=zehywv7YQ99qh21NfncteMPSti/cjXpOzwuEBNBUwlI=; b=DkiTlHt8GwXGift21MNx+empJtdIaEqBJebRLIwvUnHLoLtg6MHU38pLVZM0cxVA3Y p+IAFSlzRY4WzqkfQk9gVwF1f6N16HEsgRU99vhjW6eb35CQpeojAXAqMiC2AYhx+Ily 0KEKu/i+CKKhUdyrReKexF7DhYzLCKMrGO9LrQ3fWD4WqX6qnx21HQTo5HcNw9+gdQd7 2vcRgJxPQszhSuoxgfJjK2sHuh7hAlrriL62vgJ5A5xloD9RKDyTkK8GJdzkOKU32ZVG cnvfF/0481TklOSaeCtBgB8ODLrCGrOSgHqnv/Of8NeYo/DEQzp7HqBGrjUwmxVFjHsU j4Ig== X-Received: by 10.66.158.10 with SMTP id wq10mr52630652pab.32.1400604809968; Tue, 20 May 2014 09:53:29 -0700 (PDT) Received: from localhost.localdomain ([60.194.113.14]) by mx.google.com with ESMTPSA id av2sm4004364pbc.16.2014.05.20.09.53.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 May 2014 09:53:29 -0700 (PDT) From: ZhangPu To: uclibc@uclibc.org Subject: [PATCH] fix pthread_cancel lead to segmentation fault for x86_64. Date: Wed, 21 May 2014 00:52:55 +0800 Message-Id: <1400604775-20602-1-git-send-email-glen4linux@gmail.com> X-Mailer: git-send-email 1.7.1 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: , MIME-Version: 1.0 Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org When x86_64 cpu contains 'cpu_has_xsave' flag(in kernel),call the pthread_cancel will have a segmentation fault. Because gcc could not find the end of stack in user signal stack. Signed-off-by: ZhangPu --- libc/sysdeps/linux/x86_64/sigaction.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/libc/sysdeps/linux/x86_64/sigaction.c b/libc/sysdeps/linux/x86_64/sigaction.c index 703b24c..229e1a9 100644 --- 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" \