www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/12/14/02:40:04

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5BE7e4341051228
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 5BE7e4341051228
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=dRnHn4WR
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF6324BA2E20
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1765698003;
bh=+D8CKR6n1/gpnp1tiGgXGPnudhtGURe7XrqdeaOsRYs=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=dRnHn4WRDV9cdepuC/1JpUh4+BYYnXJm17X7B18nObu7IU13tYPpAVEHPhnng0mbk
tTlHGo5i53Kg5ACBlTOG1RMdrZdP8MCkl6k03ffr18exPIpwJpn+L/dmprLHiV6Tm5
6uJD0Mn+wwfpxFv3NXDgIUKIl6NfnIm7bm1qm9c4=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 528F94BA2E04
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 528F94BA2E04
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765697981; cv=none;
b=htaoG+GwRY9HE3sFjY0gwTXKS5Ua43706J/rIeywpnzQPk44TU0Gm2wsA6ON7kvzIS27lN0cB3Wy4hVxrMqsYQzuJ0rxffUDJvxsFbElBOtd+b7dclehCG1OJrFcv3BfjQO5JS1jycd/ZCpiWvtjHcNbtcYLie8+o5C83mYZTRM=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1765697981; c=relaxed/simple;
bh=opMJESThk1SqDJWz2T3wtUd+I2+YOG0vfNL+JaDTxhc=;
h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature;
b=a36zImPqCRpR47nXnciy1C/NKA4A1q/xyxWmvgR7ktVHeYngBDfcNkEabHCLISqtM9N1XlFXi+hlYBlcmmzTL6zVGhkFH8rqjJ/2LVinJ+9GfgHC53riCZRAspf3akTXlgYMfXJRfnE16qf0Kcy+Xrl0MEYw5l87zehXJInuxYU=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 528F94BA2E04
Date: Sun, 14 Dec 2025 16:39:36 +0900
To: cygwin AT cygwin DOT com
Subject: Re: Recent testsuite/winsup.api/pthread/cancel2 failure
Message-Id: <20251214163936.6841fc62145d8f54cfa31fe7@nifty.ne.jp>
In-Reply-To: <20251214162637.1ee05b084788ba073fe94670@nifty.ne.jp>
References: <20251214162637 DOT 1ee05b084788ba073fe94670 AT nifty DOT ne DOT jp>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On Sun, 14 Dec 2025 16:26:37 +0900
Takashi Yano via Cygwin <cygwin AT cygwin DOT com> wrote:

> Recently, I have concerned that testsuite winsup.api/pthread/cancel2 fails
> consistently.
> 
> https://github.com/cygwin/cygwin/actions/runs/19926408142/job/57127200619
> 
> I'm not sure why this happens, but it also falis in my local environment.
> I looked into this issue a bit, and found that access violation happnes
> in CloseHandle() in _cygtls::remove().
> 
> And I am also not sure why at all, cancel2 works if CloseHandle()'s are
> replaced with NtClose() as follows.
> 
> diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc
> index 13d133f47..249c8cb18 100644
> --- a/winsup/cygwin/cygtls.cc
> +++ b/winsup/cygwin/cygtls.cc
> @@ -118,7 +118,7 @@ _cygtls::remove (DWORD wait)
>      {
>        HANDLE h = signal_arrived;
>        signal_arrived = NULL;
> -      CloseHandle (h);
> +      NtClose (h);
>      }
>  
>    if (locals.drivemappings)
> @@ -148,7 +148,7 @@ _cygtls::remove (DWORD wait)
>    if (mutex)
>      {
>        ReleaseMutex (mutex);
> -      CloseHandle (mutex);
> +      NtClose (mutex);
>      }
>  }
>  
> 
> Any idea?

I forgot to mention that the thread crashes when canceled with
PTHREAD_CANCEL_ASYNCHRONOUS.

PTHREAD_CANCEL_DEFERRED works without the problem.

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019