crash caused by stack-allocated array in child process after fork?

Thomas Wolff towo@towo.net
Sun Apr 3 19:12:00 GMT 2016


Mintty has been struck by a mysterious crash condition which seems to be 
related to a weird combination of circumstances, involving the creation 
of an array on the stack, like
   wchar msg[1024];
in a child process after a fork (as used for daemonizing).

Details are described in 
https://github.com/mintty/mintty/issues/530#issuecomment-205035847 -
note that the crash does not happen if the line quoted above is changed 
to any non-stack array creation, like
   wchar * msg = malloc...
   static wchar msg[1024]
   wchar msg[wlen]; // with int wlen = ..., in which case the array is 
created on the heap
or even, more mysteriously
   wchar msg[1800];

Has anyone experienced a similar issue? Could this be a gcc bug or 
cygwin bug? Might it be related to 
https://cygwin.com/ml/cygwin-developers/2016-03/msg00000.html ?

Thomas

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list