Thanks for the hint. I checked the initialization process and there are
only two cases in which VirtualProtect could be called at init time:
- Fixing inherited shared memory regions created by the parent process
using the POSIX mmap call in the child process after fork.
- Reloading shared libraries dynamically loaded by the parent process
using the LD_PRELOAD mechanism in the child process after fork.
Both cases are only triggered by a fork() and there's no fork involved
in the crashing cases. In fact, bash already crashes when called
immediately or through a cmd script. To be sure I debugged this again
and no VirtualProtect call within Cygwin gets called.
Thanks all the same. Every idea could be helpful.
Cygwin Project Co-Leader