Skip to content

Commit

Permalink
Do not show Error dialogs by default
Browse files Browse the repository at this point in the history
In #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`.

However, when this got upstreamed as 21ec498 (cygwin: use
CREATE_DEFAULT_ERROR_MODE in spawn, 2020-12-09), that flag was deemed
unnecessary.

But it would appear that it _is_ necessary: As reported in
msys2/MSYS2-packages#2414 (comment)
this new behavior is pretty disruptive e.g. in CI scenarios.

So let's introduce that `winjitdebug` flag (settable via the environment
variable `MSYS`) at long last.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho authored and lazka committed Dec 10, 2022
1 parent b17b7ae commit a3ff0a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions winsup/cygwin/environ.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ static struct parse_thing
{"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}},
{"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
{"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
{"winjitdebug", {&winjitdebug}, setbool, NULL, {{false}, {true}}},
{NULL, {0}, setdword, 0, {{0}, {0}}}
};

Expand Down
1 change: 1 addition & 0 deletions winsup/cygwin/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ bool reset_com;
bool wincmdln = true;
winsym_t allow_winsymlinks = WSYM_deepcopy;
bool disable_pcon;
bool winjitdebug = false;

bool NO_COPY in_forkee;

Expand Down
2 changes: 1 addition & 1 deletion winsup/cygwin/spawn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ child_info_spawn::worker (const char *prog_arg, const char *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 |= CREATE_DEFAULT_ERROR_MODE;

/* We're adding the CREATE_BREAKAWAY_FROM_JOB flag here to workaround
Expand Down

0 comments on commit a3ff0a6

Please sign in to comment.