delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2026/07/25/10:52:56

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 66PEqsJJ648181
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 66PEqsJJ648181
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=QQpK+QkI
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 281684BA2E15
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1784991173;
bh=R6wSic+CXWKM7Ifl2uasdNTa0LqFuAkTlyPEiEny0+o=;
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=QQpK+QkI2Fc8g+g7V6yxEPv7dLKEcj/pH+mJgX36sI0qi6vqEbFyjDhn9CeWEqjUA
eQcVuUzgdf4YtROEAvDOmRGRM9bi9T+AHitiPXaGd/qN3ffWE6mEmdoEsBQ6XA8uBg
dvBDZpTVhnZNfatCl5qmV82LcGrUWyUQ1MsXfUHM=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9548E4BA2E15
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9548E4BA2E15
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784991122; cv=none;
b=FmkTveNu7iybhCRkh2YW6cgUfkzoS/Abs3NcaxsFcDbpkQ/uwvXm+kjxHQznIwSrkg1ufwDbqidXVJQYMwhYyDX13gHhB8vS09NIkKcVaSBmU3X6ii65u6QI0t0YNbJBcFtrNe78U7vfaSdJLOiKdIVkKHU9zkHxRb5HISzsKAk=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1784991122; c=relaxed/simple;
bh=HJHj3HQyqj4jAYr7lF3+zkc+hHElu8W0N6uQiM+xaGM=;
h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature;
b=BhlbtNHplf5SwrWiTAOCSSbt4/sDfe7xGOe0SrtvslyNiXg6L6A0zvfftXrrQKhdTyiqJ23K1fynbpHAypUFa0ubHpf0equR5VytAY+nxD1N0mtkq54dt0Gi9LMpaGY/sZZZE/zJfb0yLLlxyXMbio9Tx4DEUBd5+qBgPR/nR3Q=
ARC-Authentication-Results: i=1; sourceware.org;
dkim=pass (2048-bit key, unprotected)
header.d=nifty.ne.jp header.i=@nifty.ne.jp header.a=rsa-sha256
header.s=default-1th84yt82rvi header.b=PeTvorpp
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9548E4BA2E15
Date: Sat, 25 Jul 2026 23:51:56 +0900
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin 3.7.0-0.569.g524d75ff regression: segfault on parallel
open of /proc/PID/fd/*
Message-Id: <20260725235156.d26987e8e1699e233e80c90b@nifty.ne.jp>
In-Reply-To: <5687625c-9334-9eb7-f6e8-2df99a729f43@t-online.de>
References: <5687625c-9334-9eb7-f6e8-2df99a729f43 AT t-online DOT de>
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>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 66PEqsJJ648181

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

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