Hi Takashi,

On Sat, 3 Feb 2024, Johannes Schindelin wrote:

> On Fri, 2 Feb 2024, Takashi Yano wrote:
>
> > If non-cygwin process is executed in console, the exit code is not
> > set correctly. This is because the stub process for non-cygwin app
> > crashes in fhandler_console::set_disable_master_thread() due to NULL
> > pointer dereference. This bug was introduced by the commit:
> > 3721a756b0d8 ("Cygwin: console: Make the console accessible from
> > other terminals."), that the pointer cons is accessed before fixing
> > when it is NULL. This patch fixes the issue.
> >
> > Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from 
> > other terminals.")
> > Reported-by: Johannes Schindelin <johannes.schinde...@gmx.de>
> > Signed-off-by: Takashi Yano <takashi.y...@nifty.ne.jp>
>
> Thank you for fixing this so swiftly. I still wish the logic was
> drastically simpler to understand so that even mere humans like myself
> would stand a chance to fix such bugs, but I am happy that it is fixed
> now.

On IRC, you reported that the thread would crash if `cons` was not fixed
up. The symptom was that that crash would apparently prevent the exit code
from being read, and it would be left at 0, indicating potentially
incorrectly that the non-Cygwin process succeeded.

I wonder: What would it take to change this logic so that the crash would
be detected (and not be misinterpreted as exit code 0)?

Ciao,
Johannes

Reply via email to