delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/02/02/08:36:26

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53C6A385803F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1706880985;
bh=O0NCJNWuZk7Lv3w78+SMVTsdfCMl+xz7TpbUlmtfzv8=;
h=References:In-Reply-To:Date:Subject:To:Cc:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=advyypoxbxI+nttFWP0Efb1QUtMzoQOQgN8uUI82kG8jJmw7MsN6XK139iZDNRDXN
WTK4TnwLwt59Q2AAmM/2OBdwKSCfIs2fKSx8QssLX3lCwwHFuJZ6YxtmZ5cqt34Ru9
ov2mQFycWD1fd0F5n2BUTlUXPFjhbZ/NMUdJaU6c=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19704385802F
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 19704385802F
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706880959; cv=none;
b=es6dXcMIEDd6G/k6NKKNRL7L5Zf5jDU7oPtvsPbBSOp4rOhjY3GUR/XebCoahK1ZA0fIozpxSHsKRm7UAs1wdgX87H60lJ87uRI6c0PqymeIrbmo/BNfeRqByFgat1zwYCuxcMbpVXf6WPqKNqIJ82SdAUTgBllRpqylRa01uUo=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1706880959; c=relaxed/simple;
bh=ucnxN3fMI3XGBNJ95gr1B1kDJ/RAX/IWfYPQ2bkNkZA=;
h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
b=WVorYUpflM8vcw5YnTb5BI1CbXv9yUxwYjyRe1PFc2jFIl3l+NGyJdeJpkxg8fAmxtCzmqii91IirN2YvxgARSK8Ipu8FePngSrNXIufxDi3l/CqwnJ4G+Nab8uD2UkjoB828NPoWkkVSkRmNqNotEjjxfmoSBX2fTC0ltQmMFY=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1706880957; x=1707485757;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=ucnxN3fMI3XGBNJ95gr1B1kDJ/RAX/IWfYPQ2bkNkZA=;
b=miDV3j8ENptxrOBUjO8qxmtV3qeljk4O45HZonIe+G6Ncwwen1gpnu6eVkIK0BhGDZ
GURS5Ata7roNlim484PVhH6Mx2SIP6wIO0U7n3bsa5LZ+xEM3d63GfMwtu5beoAraw49
utzdh2nu7F32HJUUMzVdqPhmvIPwaRqu1qdphpwhWG7PF0RUxCIrD4JKPcEh8Bi3hiYt
a60b6//CXp5fzQQBRedTMCAD58ZmmJB3lEcGAC0sduj4SLmD/aS9cIHedTEjxo1mREN7
nQg3P+L6zWP4E+FlsWc5GvzZyKuRHth83IdfJLT9odqTQBXmPawMMNKPvjUDGyQ8LEMQ
E/nA==
X-Gm-Message-State: AOJu0YzvfaDcFN6HlYUkbm35IKMM02RLyq2ekzdKN1nmfcRoQoLUwFk6
tY1g/f7+zFEvSlQJHSoKQbR0fWJfNAdZfu8nJF3fNo20kl2pyiHkVSHjBdkeAskVZafKBL9yg6X
kVlunY9i/TbjiWrEyddAbG25rCcRH8E+z4tyC4b8vopmxme5x
X-Google-Smtp-Source: AGHT+IFWYZ1i7SUKqitdoWYJluzlqgSi8u+jPRJ9XypgtcZVywFWhhTXuY87zMQzZKSzkI68AodUuuryxn1oKGew0No=
X-Received: by 2002:aa7:c718:0:b0:55f:f13b:9b62 with SMTP id
i24-20020aa7c718000000b0055ff13b9b62mr1090681edq.2.1706880956661; Fri, 02 Feb
2024 05:35:56 -0800 (PST)
MIME-Version: 1.0
References: <CAJQQdJiOEduFeAthZ+q+LNXV33aJOhAXqq3sCaxdCqRpAjVmvA AT mail DOT gmail DOT com>
<CAB8Xom-PnumWSLoDFgERXA4GX0zotQiKFvi_wL7Bvsv133WAmw AT mail DOT gmail DOT com>
<CAJQQdJhzSNZ5dG254g5dv_AuWRxt+R-HLdiCPTkCNv=o+4PVeQ AT mail DOT gmail DOT com>
<ZbtsBD2IKYtH-duQ AT calimero DOT vinschen DOT de>
<CAJQQdJhS3QgJe_KsfGof_6XM6cwtNRkbPQPR32-JaKCu8_8KEA AT mail DOT gmail DOT com>
<ZbzmLRByzmDJxUcb AT calimero DOT vinschen DOT de>
<16b354c2-bba4-40b8-8359-7eb9a79b3ee3 AT dronecode DOT org DOT uk>
In-Reply-To: <16b354c2-bba4-40b8-8359-7eb9a79b3ee3@dronecode.org.uk>
Date: Fri, 2 Feb 2024 13:35:19 +0000
Message-ID: <CAJQQdJhYSkjGOFxF=-CnvBGgZa_Qv3HaH8nr8b3fjwqnizq3_Q@mail.gmail.com>
Subject: Re: Restore SEM_FAILCRITICALERRORS [was: Aren't Windows System Error
popups meant to be disabled in Cygwin?]
To: Jon Turney <jon DOT turney AT dronecode DOT org DOT uk>
Cc: cygwin AT cygwin DOT com
X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
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: David Allsopp via Cygwin <cygwin AT cygwin DOT com>
Reply-To: David Allsopp <david AT tarides DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

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.

To explain in the context of the actual call chain:
- I have opam.exe (compiled with mingw-w64), which is calling
SetErrorMode in main
- It's calling ocamlc.exe (in PATH) which requires the zstd DLL, but
that has not been put in PATH
- A direct call - not via Cygwin - to ocamlc -vnum therefore returns
an exit code
- Another call, already there from the Unix side, instead does sh -c
"ocamlc -config | sed ......." but Cygwin has then _removed_ the
calling applications preference

Thanks,


David

-- 
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 © 2019   by DJ Delorie     Updated Jul 2019