delorie.com/archives/browse.cgi | search |
DMARC-Filter: | OpenDMARC Filter v1.4.2 delorie.com 5842SmNC4149829 |
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 5842SmNC4149829 |
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=aHlbY4SA | |
X-Recipient: | archive-cygwin AT delorie DOT com |
DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org 7ECDA385840D |
DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
s=default; t=1756952925; | |
bh=Az/b6vmCJ54+Jhi/X1cye2whLiyehbAflF60/kCRDmQ=; | |
h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: | |
List-Help:List-Subscribe:From:Reply-To:From; | |
b=aHlbY4SACVOvfcYuuMMp4SgmEPRYk8Puwklt3hLnz9p/vnUlyhyOjoCoEW0WzIWcv | |
tBr3ht6hBQjSlgGG1+nZLgvNsuZG/RX5d2+SzlizeuBWC/gr90lfjCPW0X+5arKY30 | |
pegTl7+MLG87ayjhKCTED7Oi+RTR0KlviIvOkxWo= | |
X-Original-To: | cygwin AT cygwin DOT com |
Delivered-To: | cygwin AT cygwin DOT com |
DMARC-Filter: | OpenDMARC Filter v1.4.2 sourceware.org F34A83858D26 |
ARC-Filter: | OpenARC Filter v1.0.0 sourceware.org F34A83858D26 |
ARC-Seal: | i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1756952891; cv=none; |
b=xNeKCWEZetk0pGCbsdTJH9w8mfNLRWETNs/CMmWqWqRD1X8riHPl5xGs1NoQcayyaoP8jm3eNvTsKZpJw+qguel2NiBgDCdw2mu5McIBbrXkz42mT52mZdPvN2FO8BPgyHmTVbV+GStdhEtEV5bGLN4O9YHXjT8GureUGGK3smA= | |
ARC-Message-Signature: | i=1; a=rsa-sha256; d=sourceware.org; s=key; |
t=1756952891; c=relaxed/simple; | |
bh=yey/A/oBguxEWO+ZctYt/cPdnPDgtUpnNnepcsYfvg8=; | |
h=DKIM-Signature:From:To:Subject:Mime-Version:Date:Message-ID; | |
b=COebJoulhJ7ajrZ3bcKJJhVXB8V87tFWDZ+jg/TdpDxt0yt9pExUudLE0HdtLW+8STosH6c+9M2lGcyO/10mENZ3VWODqRkFRJIXPKDF/444K9PmhpEpdBa5+9yTfP/A605LuJqrZjaAgcD9OBNL+zZHBrdGWbFTkORM3o1S99k= | |
ARC-Authentication-Results: | i=1; server2.sourceware.org |
DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org F34A83858D26 |
X-QQ-XMRINFO: | NyFYKkN4Ny6FSmKK/uo/jdU= |
X-QQ-XMAILINFO: | NpBP8bGHrwA/xcfE1lazE2ZrEoleDz4WER7Gk6e6BaHK49X12JENEa+ARnIYuO |
zML1HNHEuFP85x0t6PjBXrE9PYswiP0EYjvizi1y8uAVzPq6k/xSaAHISSIydrfiQszhmqY0oW0P6 | |
n4movHYfwoRQ92nYhWTSsYNGN7TQdIF7ueeq2U+zkKlKozmfSmhA8Gya1RH0MGJKawvYAmuK00dE9 | |
29vHxCKIOhP/2y1b4mfdH2TCfBGaCwrcjr+DCgotXYtTf7NABbZpy0mGC6LHWvR9HhMq36JB0NiQG | |
ErH/tDs02VEEvyMgsIZxPKt8GfuC5PW9EBMRNnZUnI/AG3FkpUgA1Pq5NnMSNmIOq92ZWxjdbLLH/ | |
vY0xg437ZlffetINdrb1dJdPnaw1CcPQv5rOlRH5/dmFDrYcdkqdBWG3nFEFBGbI7wOfGrZxFOI+k | |
cpOE8X20foIL69L+mGhu2QNBu5NCYru3NUZr8Yq4MvkgdDkL0fQPx5HSnB9ctHqlo4Ym77Hbsf5Sr | |
jS0f2K9cxLq6/arzRMHKZh+PVg8UW6VXExqSuzcFXsIU9cb1DR8waOyFfysd4G3j5Hp11+631paLy | |
iS2qlcwHQHmo3OF8ofKD3Pw+sDBEUn2c9wUTqlpZRxlZcLUj8WONfzxQgclX4w0UIFYyhVLtvDC3D | |
aEx4jnaJEYK9x93jYNR7hygUJoAkWebCuClPHuqaVri0PyrAJu8ej8KzBVzkXunpLSwRdrisd5gp9 | |
CXti5r7ccFjwLf9nHFW0AEoCGvEHq+y+rpqRitFSIg6z47utw5Z3Jiht38iGjBhqdfv+0HA16fx9u | |
Dn2t9lhAPMeR+jClIynhucdnT4W6Wrr9xCQgP4zvtCVQOFdmFannjvSmbtBMuOFfy4OcJyxgIKOG0 | |
xiqJ6+WXbypus0lpFPj0Rn9zg+Vj5K5rzNcMpeVQvxZVUNTEy9XksknmaR9HFfJH88CKzAOggVdwd | |
aLch73BmmutICI0aoklXRFfDqRjTnIIaR0F4qRJhqmiXSQp9C+UC0aj1CNhfgOuKqOahy5q26SXl4 | |
NMtsaoadIjLWgJjjeLpXAZ00ElQ== | |
To: | "=?utf-8?B?Y3lnd2lu?=" <cygwin AT cygwin DOT com> |
Subject: | Cygwin select() returns -1 with errno 0 |
Mime-Version: | 1.0 |
Date: | Thu, 4 Sep 2025 10:28:05 +0800 |
X-Priority: | 3 |
Message-ID: | <tencent_816228BD23D3D2111B35AA9FF0D80C4AD706@qq.com> |
X-QQ-MIME: | TCMime 1.0 by Tencent |
X-Mailer: | QQMail 2.x |
X-QQ-Mailer: | QQMail 2.x |
X-QQ-mid: | xmseza23-0t1756952885tc48im62l |
X-Content-Filtered-By: | Mailman/MimeDel 2.1.30 |
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-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: | a2uria via Cygwin <cygwin AT cygwin DOT com> |
Reply-To: | =?utf-8?B?YTJ1cmlh?= <a2uria AT qq DOT com> |
Sender: | "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com> |
The problem is that `select` returns -1 with errno 0, so `perror` says `select: No error`. Copied from https://github.com/msys2/msys2-runtime/issues/308 as previously website of cygwin is temporary unavailable for me. Original seen in https://github.com/fish-shell/fish-shell/pull/11238/commits/0ad62cea2a9a6606128b182d11b3aac4a62b3b9d in https://github.com/fish-shell/fish-shell/pull/11238 It occurs randomly.  ``` $ fish -c 'ls > /dev/null' select: No error ``` However when using `strace` this occurs more often. The following example uses `strace -f -m syscall,select ./fish -c 'sha256sum fish.exe' &> output.txt`. <details> <summary>Trimmed output</summary> ``` 627 479850 [fish] fish 1628 pselect: pselect (15, 0x7FFD0C690, 0x7FFD0C680, 0x7FFD0C670, 0x0, 0x0) 104 479954 [fish] fish 1628 pselect: to NULL, us -1 770 480724 [fish] fish 1628 select: sel.always_ready 0 3427 484151 [main] fish 1628 write: write(15, 0x7FFFF9E4C, 1) 89 484240 [main] fish 1628 write: 1 = write(15, 0x7FFFF9E4C, 1) 53 484293 [pipesel] fish 1628 peek_pipe: read: pipe:[12884907236], ready for read: avail 1 108 484401 [fish] fish 1628 select_stuff::wait: wait_ret 2, m = 3. verifying 101 484502 [fish] fish 1628 set_bits: me 0xA00046280, testing fd 14 (pipe:[12884907236]) 57 484559 [main] fish 1628 read: read(12, 0x7FFFF5DF8, 16384) nonblocking 155 484714 [fish] fish 1628 set_bits: ready 1 114 484828 [fish] fish 1628 set_bits: me 0xA00045C20, testing fd 12 (pipe:[8589939940]) 117 484945 [fish] fish 1628 set_bits: ready 0 52 484997 [main] fish 1628 read: -1 = read(12, 0x7FFFF5DF8, -1), errno 11 53 485050 [fish] fish 1628 select_stuff::wait: res after verify 0 102 485152 [fish] fish 1628 select_stuff::wait: returning 0 51 485203 [main] fish 1628 close: close(12) 52 485255 [fish] fish 1628 select: sel.wait returns 0 100 485355 [main] fish 1628 fhandler_base::close: closing 'pipe:[8589939940]' handle 0x2F0 49 485404 [main] fish 1628 close: 0 = close(12) 45 485449 [fish] fish 1628 peek_pipe: pipe:[12884907236], already ready for read 52 485501 [main] fish 1628 close: close(13) 51 485552 [fish] fish 1628 set_bits: me 0xA00046280, testing fd 14 (pipe:[12884907236]) 108 485660 [fish] fish 1628 set_bits: ready 1 56 485716 [main] fish 1628 fhandler_base::close: closing 'pipe:[8589939940]' handle 0x2D8 53 485769 [main] fish 1628 close: 0 = close(13) 45 485814 [fish] fish 1628 select_stuff::cleanup: calling cleanup routines 293 486107 [fish] fish 1628 select_stuff::destroy: deleting select records 310 486417 [fish] fish 1628 select_stuff::cleanup: calling cleanup routines 101 486518 [fish] fish 1628 select_stuff::destroy: deleting select records 107 486625 [fish] fish 1628 pselect: -1 = select (15, 0x7FFD0C690, 0x7FFD0C680, 0x7FFD0C670, 0x0), errno 0 select 890 487515 [fish] fish 1628 write: 6 = write(2, 0x100C27640, 6) : 208 487723 [fish] fish 1628 write: 2 = write(2, 0x100C5BA30, 2) No error 206 487929 [fish] fish 1628 write: 8 = write(2, 0x2102D4D35, 8) 197 488126 [fish] fish 1628 write: 1 = write(2, 0x100C5C791, 1) ``` </details> The binary can be compiled using following commands with MSYS2. ``` pacman -S gcc mingw-w64-x86_64-rustup rustup component add rust-src --toolchain nightly-x86_64-pc-windows-gnu cargo +nightly-x86_64-pc-windows-gnu install -Z build-std --target x86_64-pc-cygwin --profile release-with-debug --git https://github.com/fish-shell/fish-shell.git --rev d8e5821 --bin fish ``` Note that [`--rev d8e5821`](https://github.com/fish-shell/fish-shell/commit/d8e5821a3b8f944cb071b98781680f15ba4effd6) is required as workaround is added in https://github.com/fish-shell/fish-shell/commit/4508b5b0db7b012ae2c19f4f7aa9df74ac89ea3c. Commit history is available [here](https://github.com/fish-shell/fish-shell/commits/4508b5b0db7b012ae2c19f4f7aa9df74ac89ea3c/). Code that trigger `perror` is here. https://github.com/fish-shell/fish-shell/blob/d8e5821a3b8f944cb071b98781680f15ba4effd6/src/fd_monitor.rs#L390-L395 ```rust let ret = fds.check_readable(timeout.map(Timeout::Duration).unwrap_or(Timeout::Forever)); if ret < 0 && !matches!(errno().0, libc::EINTR | libc::EBADF) { // Surprising error perror("select"); } ``` -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |