This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] Update: mintty 2.1.2

> Hi Thomas,
> Let me rephrase/summarize my findings:
> Executing 'mintty -D' (i.e. v212)
>     from a shortcut to bash (i.e. Cygwin console),
> will fork itself, where the child will turn itself into a session leader, as
> desired.
> i.e. the following code will be executed:
> #if 1 // Thomas
>  if (daemonize && !isatty(0)) { // daemonize == true, !isatty(0) == true
>    if (fork() > 0) exit(0);
>    setsid(); // executed by child
>  }
> #endif
> 1. if 'Windows Basic' has been selected (Personalization), the child will crash.
> 2. if 'Windows 7' has been selected (Personalization), the child will NOT crash,
>    ... and, eventually, fork itself, where the "grandchild" will replace itself
>    by bash in the end.

Hi Thomas,

I _may_ have found the cause of the problem ... (but all bets are off!).

main() in winmain.c starts as follows:

main(int argc, char *argv[])
  main_argv = argv;
  main_argc = argc;
// Henri: too early?
#if 0

load_dwm_funcs() apparently "loads" a library, as follows:

    LoadLibrary ...

Will the library still be loaded in the child, I asked myself ...

As an experiment, I moved the call to load_dwm_funcs() after fork/setsid.

... fork()
... setsid()

// child continues ...

// Henri: will dwmapi.dll still be loaded after the fork() call ?????
#if 1

Still more testing is needed ... but I _may_ have found why mintty -D crashes. But
I cannot explain why the crash does not occur when "eye candy" has been enabled.


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]