delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2026/08/13/09:13:34

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 67DDDXtR1980157
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 67DDDXtR1980157
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=O/VnVRPf
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACA254BA23EB
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1786626811;
bh=CDeYUaoMbTOppbBIQ8KVJKE4NEJgc+m0m029t6Q+aI8=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=O/VnVRPfalc6GvaI64u5Zhma6WiiSJjymdQtGF+T8+6ULGnPj56ZKA8jsxT2kkora
XAOaZRsKjtu57/+I5aNOcHBVkIENwpTMfa2j9w1YwPXbQ6+77/iA50mECSaH2GCbME
zKpYGDe3G9ev6Kq4OdiHbZ4g6bNMiTsNtJfEjxvg=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F2394BA2E09
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6F2394BA2E09
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786626763; cv=none;
b=uCKhY2emySstZIGx9avL508yXUxvQxD1TTFCvjV0xxSbf5nv1U1zXHXd6gNMHedJPeZ5Oe63ITPcpYy+kyTXMqVCxYiCtzzh2Er52kkbeQQ2Sf9tmaTeto2Wqye+tyovgCxh6eS3NmaQ5XSFwl+U9Ey/jABxKwssKtoKAfwlyTk=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1786626763; c=relaxed/simple;
bh=djrrfxkqf3epFLoNhYg/8t8Ou9BHpwfTDqdL7ve3GDA=;
h=From:Subject:To:Message-ID:Date:MIME-Version:DKIM-Signature;
b=HZIAF78DWqfYam4T/fK11dieFImw/IK/5aQ/HkvfJZiOwp7H5O4VqbG8wf9EwY/gHv5jr8Mmx9H1Ueq8eOJKkp8W/cs706q3zA4uaQzS5eiATguJExx7wfMpNIhojRfwUq45JOQl4wPcJULciKnpzYOCxPTbIN3MRmK/nK1Lk2c=
ARC-Authentication-Results: i=1; sourceware.org;
dkim=pass (2048-bit key, unprotected)
header.d=t-online.de header.i=Christian DOT Franke AT t-online DOT de
header.a=rsa-sha256 header.s=20260216 header.b=svK/UXVQ
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F2394BA2E09
Subject: Re: Cygwin 3.7.0-0.569.g524d75ff regression: segfault on parallel
open of /proc/PID/fd/*
To: cygwin AT cygwin DOT com
References: <5687625c-9334-9eb7-f6e8-2df99a729f43 AT t-online DOT de>
<20260725235156 DOT d26987e8e1699e233e80c90b AT nifty DOT ne DOT jp>
Message-ID: <268e78b4-be11-4d33-a18e-6bf31c230402@t-online.de>
Date: Thu, 13 Aug 2026 15:12:35 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101
SeaMonkey/2.53.23
MIME-Version: 1.0
In-Reply-To: <20260725235156.d26987e8e1699e233e80c90b@nifty.ne.jp>
X-TOI-EXPURGATEID: 150726::1786626757-177FD971-C4151608/0/0 CLEAN NORMAL
X-TOI-MSGID: 2629a87f-b922-4106-9178-f383d3e27db5
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: Christian Franke via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Christian Franke <Christian DOT Franke AT t-online DOT de>
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>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 67DDDXtR1980157

On Sat, 25 Jul 2026 23:51:56 +0900, Takashi Yano via Cygwin wrote:

> Hi Christian,
>
> Thanks for the report.
>
> On Sat, 25 Jul 2026 15:12:54 +0200
> Christian Franke wrote:
>
>> After 524d75ff ("Cygwin: open: Unlock fdtab before open_with_arch()"),
>> CI workflow shows that 'stress-ng --procfs ...' now hangs.
>>
>> Testcase:
>>
>> $ uname -r # not with 3.7.0-0.567.g161e3cb999fb.x86_64
>> 3.7.0-0.569.g524d75ff7398.x86_64
>>
>> $ cat proc-self-fd.c
>> #include <errno.h>
>> #include <fcntl.h>
>> #include <pthread.h>
>> #include <stdio.h>
>> #include <unistd.h>
>>
>> static void * threadfunc(void * arg)
>> {
>>     (void)arg;
>>     for (int i = 0; i < 100000; i++) {
>>       char path[32];
>>       snprintf(path, sizeof(path), "/proc/self/fd/%d", i % 10);
>>       int fd = open(path, O_RDONLY);
>>       if (fd < 0) {
>>         printf("%p#%06d: %s: errno=%d\n", pthread_self(), i, path, errno);
>>         continue;
>>       }
>>       printf("%p#%06d: %s: fd=%d\n", pthread_self(), i, path, fd);
>>       close(fd);
>>     }
>>     return NULL;
>> }
>>
>> int main()
>> {
>>     pthread_t t = NULL;
>>     int ret = pthread_create(&t, NULL, threadfunc, NULL);
>>     if (ret)
>>       return 1;
>>     threadfunc(NULL);
>>     ret = pthread_join(t, NULL);
>>     printf("pthread_join(%p, .)=%d\n", t, ret);
>>     if (ret)
>>       return 1;
>>     return 0;
>> }
>>
>> $ gcc -o proc-self-fd proc-self-fd.c
>>
>> $ ./proc-self-fd
>> ...
>> 0xa00000500#001908: /proc/self/fd/8: errno=2
>> 0xa00000010#001900: /proc/self/fd/0: fd=3
>> 0xa00000500#001909: /proc/self/fd/9: errno=2
>> 0xa00000010#001901: /proc/self/fd/1: errno=14<== EFAULT
>> [hangs, kill -9 does not work]
>>
>> $ strace -o trace.log ./proc-self-fd
>> [taskkill /f /im proc-self-fd.exe in other window]
>>
>> $ less trace.log
>> ...
>>      25   21725 [main] proc-self-fd 14876 fhandler_pty_slave::open_setup:
>> /dev/pty1 opened, usecount 3
>>      61   21786 [main] proc-self-fd 14876 build_fh_pc: found an archetype
>> for (null)(136/1) io_handle 0x200
>>      66   21852 [main] proc-self-fd 14876 build_fh_pc: fh 0x800008E40,
>> dev 00880001
>>      71   21923 [main] proc-self-fd 14876 fhandler_base::open_with_arch:
>> line 471: /dev/pty1<0x8000086F0> usecount + 1 = 4
>> --- Process 3968 (pid: 14876), exception c0000008 at 00007ff81682416a
>> --- Process 3968 (pid: 14876), exception c0000008 at 00007ff81682416a
>> ...
>>
>>
>> "... found an archetype for (null) ..." <== Hmm...
> Perhaps, this is due to the defects pointed out by Johannes.
> https://cygwin.com/pipermail/cygwin-patches/2026q3/015227.html
>

These are possibly fixed now. With 3.7.0-0.579.g61b4866baf41, the above 
testcase completes as expected.

-- 
Regards,
Christian


-- 
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 © 2026   by DJ Delorie     Updated Sep 20 2026