DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 532D249k2795119 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 532D249k2795119 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=k6M/a5ak X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8268A384A879 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1743598922; bh=VoHeUMPeUbHZkAR0Klpr8rynYOaViYQrqKh03o7Xz8Y=; 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=k6M/a5aknp/jwfJ7NfBgUwYvG6XlbOGtjOdd7ryekyG4wWHSOBg1rlEnxedXeCqNP IF67oDuJ1XRg58KxVSY/nyhbRouctCPQk0G4APDlpeNwwRZC5CXdyr7ckIeAusgiTS cw6uF0rAAArDQfeGikaX3IAsz56T6ZUD+DY0dE0k= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B849384D16F ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3B849384D16F ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743598891; cv=none; b=eAFvfbwJ2OXh8JQEkTCyfwL1YbVyuJlYwl4ReblaZXlc0/sNwC5p4vwsZWd8gQhsPoiH+mAVP803A9DOkSUd8IRYYSFWNnPQl2ZlnEByLMEzv1c8n924aGzuZq5g4WzDzpbryVVzUsQmWKDw+YMCTuEuwzkF9TupK6ufoeByrEc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743598891; c=relaxed/simple; bh=5WzIifLLyDfz19teatiq0KcOW4o5AeplP7+qv33C47w=; h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature; b=AvreXFykDva1zUOInwqQgU4B0lQ22Ye86bOKAM0JPzi2s7/ZJzpWzUdKOqTQPHbhDDqkSIS80wxg7avm5F9idO6ddLlFMSiwbhZjrIy4YfdWoFSJnWjfX2QtJwgxFr7TdmtzCkpXvn+QZJAa25D51WNAFiUO5u6UhaLLh/uJeYU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B849384D16F Date: Wed, 2 Apr 2025 22:01:25 +0900 To: cygwin AT cygwin DOT com Subject: Re: Crashes in cmake subprocesses since 3.6.0 Message-Id: <20250402220125.5d2e1d28cfa37ad934a94ed9@nifty.ne.jp> In-Reply-To: References: <7eaea471-d453-efc7-19cc-58e0ee187af0 AT jdrake DOT com> 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Takashi Yano via Cygwin Reply-To: Takashi Yano Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Hi Corinna, On Mon, 31 Mar 2025 11:28:44 +0200 Corinna Vinschen wrote: > On Mar 30 22:58, Jeremy Drake via Cygwin wrote: > > On Mon, 31 Mar 2025, Christoph Reiter via Cygwin wrote: > > > > > Starting with 3.6.0 when cmake calls into make/ninja/gcc there is a chance of > > > that failing, for example like this: > > > > > > CMake Error: Generator: build tool execution failed, command was: > > > /usr/bin/cmake.exe -E env VERBOSE=1 /usr/bin/make.exe -f Makefile > > > cmTC_c87e2/fast > > > > > > * Problem starts with cygwin 3.6.0 > > > > I've also reproduced this with cygwin 3.7.0-0.19.g6c5537c0298e, but it > > doesn't reproduce as readily as with cygwin 3.6.0-1. > > Yes, I can reproduce fails as well, but I don't see an easy way to > debug this. Your testcase just fails but runs along afterwards. > > I'm completely cmake-illiterate, which isn't a great help either. > > Two points: > > - It's unlikely that this occurs only with 3.6.0-1 and later. It's more > likely that it occurs on the way from 3.5 to 3.6. Unfortunately the > remaining 3.6.0 test builds are only going back to patchlevel 429 or > so. > > Any chance one of you could bisect Cygwin and find out which commit > introduced the problem? > > - Also, since this seems to affect certain cmake versions only, can the > cmake maintainers help here, perhaps? Currently, I am looking into this problem. What I noticed so far is: * The problem occurs after the commit 7ed9adb356df. * This problem is happen when fhandler_fifo_pipe::raw_write() returns error because cygwait(pipe_mtx, timeout) returns WAIT_FAILED. This seems to happen due to invalid _cygtls::signal_arrived handle for some reason. * The following patch solves the issue. diff --git a/winsup/cygwin/local_includes/cygtls.h b/winsup/cygwin/local_includes/cygtls.h index f67e9136c..82a34aeca 100644 --- a/winsup/cygwin/local_includes/cygtls.h +++ b/winsup/cygwin/local_includes/cygtls.h @@ -228,6 +228,9 @@ public: /* Do NOT remove this public: line, it's a marker for gentls_offsets. */ bool locked (); HANDLE get_signal_arrived (bool wait_for_lock = true) { + DWORD dummy; + if (signal_arrived && !GetHandleInformation (signal_arrived, &dummy)) + signal_arrived = NULL; if (!signal_arrived) { if (wait_for_lock) Of course, this is not the right thing to do, but this clarifies that the cause is _cygtis::signal_arrived being invalid even though it is not NULL. The reason is not quite sure to me. Any idea? -- Takashi Yano -- 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