From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 5BFF33858404; Sat, 3 Feb 2024 19:19:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BFF33858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706987962; bh=qlBc/DV7Nhp6UQXvNeyU5PTnqtNZSjIr2IaScVCYC6c=; h=From:To:Subject:Date:From; b=PklLbT8yVFc2cZw389qO8uvaNF05x96UqkVAsPpY4Z9qnzu73jrO7eDGjhLovmOQm PPBveT7nZiyV5gKIobUAceQwvCsrvfdfY8EZ5dxbs+Uvlh5FTPwLwL9bdw+OQw9K0J NRDjlhibNys7S0KAEcdy4ifsA+LlbtIo+pvmS/50= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_5-branch] Cygwin: Do not show Error dialogs by default X-Act-Checkin: newlib-cygwin X-Git-Author: Johannes Schindelin X-Git-Refname: refs/heads/cygwin-3_5-branch X-Git-Oldrev: aa392df06bb3eb42e07dd68bda2443614ba6a051 X-Git-Newrev: 6d6e1e354d214ba70981afe8c92cb9c58d33ac54 Message-Id: <20240203191922.5BFF33858404@sourceware.org> Date: Sat, 3 Feb 2024 19:19:22 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D6d6e1e354d2= 14ba70981afe8c92cb9c58d33ac54 commit 6d6e1e354d214ba70981afe8c92cb9c58d33ac54 Author: Johannes Schindelin AuthorDate: Wed Mar 31 11:38:41 2021 +0200 Commit: Corinna Vinschen CommitDate: Sat Feb 3 20:03:43 2024 +0100 Cygwin: Do not show Error dialogs by default =20 ...in a non-Cygwin child process. Backported from MSYS2. Downstream commit message follows. =20 In https://github.com/msys2/msys2-runtime/pull/18, we discussed a change that would allow default Windows error handling of spawned processes to kick in (such as registered JIT debuggers). We even agreed that it would make sense to hide this functionality behind a flag, `winjitdebug`. =20 However, when this got upstreamed as 21ec498d7f (cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn, 2020-12-09), that flag was deemed unnecessary. =20 But it would appear that it _is_ necessary: As reported in https://github.com/msys2/MSYS2-packages/pull/2414#issuecomment-810841296 this new behavior is pretty disruptive e.g. in CI scenarios. =20 So let's introduce that `winjitdebug` flag (settable via the environment variable `MSYS`) at long last. =20 Signed-off-by: Johannes Schindelin Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/environ.cc | 1 + winsup/cygwin/globals.cc | 1 + winsup/cygwin/spawn.cc | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index dca5c5db056b..d35b9564b622 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -122,6 +122,7 @@ static struct parse_thing {"wincmdln", {&wincmdln}, setbool, NULL, {{false}, {true}}}, {"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}}, {"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}}, + {"winjitdebug", {&winjitdebug}, setbool, NULL, {{false}, {true}}}, {NULL, {0}, setdword, 0, {{0}, {0}}} }; =20 diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index a94aa5694e2d..d14ea593f666 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -72,6 +72,7 @@ bool reset_com; bool wincmdln; winsym_t allow_winsymlinks =3D WSYM_default; bool disable_pcon; +bool winjitdebug =3D false; =20 /* Taken from BSD libc: This variable is zero until a process has created a pthread. It is used diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index dc1c4ac17c80..77dc6dff4858 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -413,7 +413,7 @@ child_info_spawn::worker (const char *prog_arg, const c= har *const *argv, get the default error mode instead of inheriting the mode Cygwin uses. This allows things like Windows Error Reporting/JIT debugging to work with processes launched from a Cygwin shell. */ - if (!real_path.iscygexec ()) + if (winjitdebug && !real_path.iscygexec ()) c_flags |=3D CREATE_DEFAULT_ERROR_MODE; =20 /* We're adding the CREATE_BREAKAWAY_FROM_JOB flag here to workaround