This is the mail archive of the cygwin-patches 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] |
Hello, Looks like ch.stacklimit wasn't being page-aligned correctly in fork.cc; you need to subtract 1 from page_size to do it correctly (see the attached patch). As a result, this was causing stack-overflow exceptions whenever the stack needed to grow beyond the stacklimit value. When the stack grows beyond stacklimit value, Windows uses ntdll!_chkstk() function to check the stack and map in additional stack pages. However, it expects stacklimit to be page aligned, and the function does not work correctly if it is not (it triggers STATUS_STACK_OVERFLOW, even if there is enough stack space). Normally, this was not causing any issues, as the stack never really needs to grow, but it was causing issues when AV software was being injected into the process (specifically, HitmanPro.Alert being injected into git’s sh.exe process). Due to function hooks, it lead to a bigger callstack, and more stack space being required. Making the change specified in the patch actually resolves the issue. I am providing my patches to the Cygwin sources under the 2-clause BSD license. Regards, Sergejs
Attachment:
0001-Cygwin-Fixing-the-math-behind-rounding-down-ch.stack.patch
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |