From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 ; 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 ; 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) From: Stafford Horne 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2020 21:46:54 -0000 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 -- 2.26.2