Message ID | 20201111214645.1506645-1-shorne@gmail.com |
---|---|
State | Dropped |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59D05385042F; Wed, 11 Nov 2020 21:46:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59D05385042F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605131216; bh=C7dagmsLpFybTdRqZbsCT4qd2YM2o/Xf4DCmdpXNIjI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=FRCxI7enYfFIh51Plma+cNBw2pRyua+vWPgPa0cAI07mjjoMdgALADuhGG/zQIwg0 tbwjq18/bJIv+PDgEvFY9Tp22xX1q/vQITeaLjODQhhmb9k9AyGAzjAoI3n6TN3tpf ouYSO6xNRu50bYzbNBaHvX3eEcj72JBlWR18q1Lk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 5B6273857C55 for <libc-alpha@sourceware.org>; Wed, 11 Nov 2020 21:46:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5B6273857C55 Received: by mail-pg1-x52a.google.com with SMTP id f27so2350928pgl.1 for <libc-alpha@sourceware.org>; Wed, 11 Nov 2020 13:46:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=C7dagmsLpFybTdRqZbsCT4qd2YM2o/Xf4DCmdpXNIjI=; b=d4P8CUrFXTjczmEDl3D7FKqVT/5cXKmlRzF03SRs1V1oWNA88u/X5AIbUKjZSm3Wcb jE7dDzex8jQBWHhZTeQHeRNFl45bQoAnW02G/kgK98lfjZOttLSSoGfFRE9WafiOTPtx QErvDUkY2jXxlJsGM2pSYKeOs204ClSI2xexOJfkc/BeDpvBU3QTthe94uEoR9GsA4/M ba8Q4DXYsSlEUOuXJm+Bjh3xmCwAclDjrOcDCK69MiOAu9DgwfVV+Rz0AR5hHmYAMvIF Si+W689xdExhdmfKkCaZSSGlEz+IZbxxXVrXCanAWDO1NCHGd9JA4J4FBphRN6ZzjaIO 0JlA== X-Gm-Message-State: AOAM5308e/uHNWntaRjQx+XZZrFMh6TKJj2kccm9K7hesgKGZyDGpx3r E1V3SeDKX2UNvlFlTMf/AbQuNgs4MvQ= X-Google-Smtp-Source: ABdhPJzHy3OFOFilaQUK5RkPVUjWcGVUhm+VEcdbtoG2TKL/M7Rttv0+YtbBKM/0yMBrRi3Ko/v3XQ== X-Received: by 2002:a63:c945:: with SMTP id y5mr23721461pgg.118.1605131212240; Wed, 11 Nov 2020 13:46:52 -0800 (PST) Received: from localhost (g133.220-213-56.ppp.wakwak.ne.jp. [220.213.56.133]) by smtp.gmail.com with ESMTPSA id d188sm3503904pfd.86.2020.11.11.13.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 13:46:51 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH] nptl: Fix issue unwinding through sem_wait futex Date: Thu, 12 Nov 2020 06:46:45 +0900 Message-Id: <20201111214645.1506645-1-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Stafford Horne via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Stafford Horne <shorne@gmail.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
nptl: Fix issue unwinding through sem_wait futex
|
|
Commit Message
Stafford Horne
Nov. 11, 2020, 9:46 p.m. UTC
Calls to sem_wait may use the __futex_abstimed_wait_cancelable64 function that is built in futex-internal. If we get a C++ exception, i.e. thread cancel when we are waiting on a semaphore thread unwinding fails. Example test: nptl/tst-cancel24 Adding -fexceptions flag when building futex-internal fixes this. --- nptl/Makefile | 1 + 1 file changed, 1 insertion(+)
Comments
On 11/11/2020 18:46, Stafford Horne via Libc-alpha wrote: > Calls to sem_wait may use the __futex_abstimed_wait_cancelable64 > function that is built in futex-internal. If we get a C++ exception, > i.e. thread cancel when we are waiting on a semaphore thread unwinding > fails. Example test: nptl/tst-cancel24 > > Adding -fexceptions flag when building futex-internal fixes this. > --- > nptl/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/nptl/Makefile b/nptl/Makefile > index b30d263ca4..a1ffb6258a 100644 > --- a/nptl/Makefile > +++ b/nptl/Makefile > @@ -220,6 +220,7 @@ CFLAGS-pthread_cond_wait.c += -fexceptions -fasynchronous-unwind-tables > CFLAGS-sem_wait.c += -fexceptions -fasynchronous-unwind-tables > CFLAGS-sem_timedwait.c += -fexceptions -fasynchronous-unwind-tables > CFLAGS-sem_clockwait.c = -fexceptions -fasynchronous-unwind-tables > +CFLAGS-futex-internal.c += -fexceptions -fasynchronous-unwind-tables > > # These are the function wrappers we have to duplicate here. > CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables > I have fixed it with a04689ee7a2600a1466354096123c57ccd1e1dc7, are you still seeing the same issue with master?
On Thu, Nov 12, 2020, 8:39 PM Adhemerval Zanella via Libc-alpha < libc-alpha@sourceware.org> wrote: > > > On 11/11/2020 18:46, Stafford Horne via Libc-alpha wrote: > > Calls to sem_wait may use the __futex_abstimed_wait_cancelable64 > > function that is built in futex-internal. If we get a C++ exception, > > i.e. thread cancel when we are waiting on a semaphore thread unwinding > > fails. Example test: nptl/tst-cancel24 > > > > Adding -fexceptions flag when building futex-internal fixes this. > > --- > > nptl/Makefile | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/nptl/Makefile b/nptl/Makefile > > index b30d263ca4..a1ffb6258a 100644 > > --- a/nptl/Makefile > > +++ b/nptl/Makefile > > @@ -220,6 +220,7 @@ CFLAGS-pthread_cond_wait.c += -fexceptions > -fasynchronous-unwind-tables > > CFLAGS-sem_wait.c += -fexceptions -fasynchronous-unwind-tables > > CFLAGS-sem_timedwait.c += -fexceptions -fasynchronous-unwind-tables > > CFLAGS-sem_clockwait.c = -fexceptions -fasynchronous-unwind-tables > > +CFLAGS-futex-internal.c += -fexceptions -fasynchronous-unwind-tables > > > > # These are the function wrappers we have to duplicate here. > > CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables > > > > I have fixed it with a04689ee7a2600a1466354096123c57ccd1e1dc7, are > you still seeing the same issue with master? > (Replying on phone) No I am on about 2 month old master. I'll try the latest. I checked master to see if there were any patches addressing this, but I must have missed it. Hence, I sent the patch. Thanks for replying with the details. I'll rebase and report if there are more issues. I'll also pick up the new syscall errno handling with the rebase. Which will be good. -Stafford >
diff --git a/nptl/Makefile b/nptl/Makefile index b30d263ca4..a1ffb6258a 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -220,6 +220,7 @@ CFLAGS-pthread_cond_wait.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-sem_wait.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-sem_timedwait.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-sem_clockwait.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-futex-internal.c += -fexceptions -fasynchronous-unwind-tables # These are the function wrappers we have to duplicate here. CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables