X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AD353857C4F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1706883522; bh=wpn5uiz66wNkzHsLTtf8vz2okrNwGXqgwDPDmlhRMqc=; 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=I+ni1s5jGd2kpXhQlv/CcdKLevpXFPC7V2jQ1OCgdVbLP9wld6YGJtY2BaZXxme4M wA/wJVyDuF4yUYLMGgXDKsfVpylRbRLZ8a1KytdVYFeKDV6Tyvi6RWrHMyaR8OHPhd yVNVfgXN1pHvwu8V81L7jXZ249s0f91oTLQllSZE= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D6FD3857C43 Date: Fri, 2 Feb 2024 15:16:44 +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 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 2 13:35, David Allsopp via Cygwin wrote: > Jon Turney via Cygwin wrote: > > > > I'm sympathetic, and personally I would prefer to revert the patch and > > > stick to SEM_FAILCRITICALERRORS by default. > > > > > > The question is this: Why does, apparently, everybody expect Cygwin to > > > do the "right thing", with different definitions of "right", when in > > > fact the executable in question can easily call SetErrorMode by itself? > > > > Yeah, if cygwin wasn't involved in the process ancestry, how would you > > get the behaviour you want? > > Ah, but that's how I hit this (and started digging further) - > precisely because the non-Cygwin program I'm using _has_ called > SetErrorMode and its direct calls to the faulty program _are_ doing > what's wanted (no popup dialog) but the calls which happen via Cygwin > are then torching that preference. > > Not really suggesting it be done this way (it feels more complicated > than just reverting the change), but in some ways perhaps Cygwin > should be using GetErrorMode on startup and instead of not inheriting > it, ensuring that it sets whatever it received? i.e. just before the > call to CreateProcess for a non-Cygwin binary, Cygwin restores the > error mode (for that thread only) to the value read at startup, calls > CreateProcess and then sets the error mode back. This sounds like a good ide, but... 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. 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