X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 091BC3857B88 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1706988365; bh=xt4M9fUv2hIn1xBiFbWSkeaT4RS+NwOFcQtWckDhylI=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=m+nceyxUyQ55Tw8JQ/wwTmagtnAZkPcx25wyA7LbeTt1182plWUJ7fh7Xg1VUw8xd OoWn8VvXpwuMNtFyVaH3MmBypuBb4gfHLNobxjXZWgdFxKig27zmbG0GTheIGQNeTn 0CVXzty/X898bmRpMuYFhQsit+VIL1WK9OW0et3k= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF7BC3858403 Date: Sat, 3 Feb 2024 20:25:16 +0100 To: cygwin AT cygwin DOT com Subject: Re: Restore SEM_FAILCRITICALERRORS [was: Aren't Windows System Error popups meant to be disabled in Cygwin?] Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com, David Allsopp References: <16b354c2-bba4-40b8-8359-7eb9a79b3ee3 AT dronecode DOT org DOT uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen 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" On Feb 3 13:39, Corinna Vinschen via Cygwin wrote: > On Feb 2 19:51, Corinna Vinschen via Cygwin wrote: > > On Feb 2 18:22, Corinna Vinschen via Cygwin wrote: > > > On Feb 2 14:56, David Allsopp via Cygwin wrote: > > > > On Fri, 2 Feb 2024 at 14:18, Corinna Vinschen via Cygwin wrote: > > > > > Is it actually a safe bet that the error mode set by SetThreadErrorMode > > > > > is then propagated as process error mode to the child process? > > > > > > > > > > I have to ask that because Microsoft conveniently forgot to document > > > > > this scenario in the MSDN docs. > > > > > > > > :o) Never knowingly clear, are they! It would seem to be the intent of > > > > SetThreadErrorMode that it would behave that way but who knows. > > > > > > > > Happy to set up a quick experiment to check that it does work (i.e. > > > > [...] > > > Wanna try this? > > [...] > > However, it occured to me that this won't work at all. > > [...] > > Sorry to say that, but SetThreadErrorMode/CreateProcess don't do what we > want them to do. I just tested this myself with a modified Cygwin DLL > (code below) and it turns out that the child process error mode is > the same as the parent's process error mode. Changing the thread > error mode from the Cygwin default 3 (aka SEM_FAILCRITICALERRORS | > SEM_NOGPFAULTERRORBOX) to 0 doesn't have any effect. > [...etc.] MSYS2 has introduced the environment variable option CYGWIN=winjitdebug. I backported this patch now. So default is back to propagating Cygwin's error mode and if you want to reset the error mode of a non-Cygwin child process back to OS default, just set the option, for instance, like this: $ CYGWIN=winjitdebug env This patch will be in Cygwin 3.5.1. For the time being, it will be available in the next test release cygwin-3.6.0-0.28.g918c3eda4176 as well. HTH, Corinna -- 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