Open
Description
GenericPInvokeCalliHelper
produces a problem on linux.
GenericPInvokeCalliHelper
takes away VASigCookie
argument from the stack and moves on its place return address value. It breaks 16 byte stack alignment and leads to further problems on esp
usage: execution could break inside CHECK_STACK_ALIGNMENT
macro or on movap [esp+offset]
instruction. The problem spreads until caller of GenericPInvokeCalliHelper
will restore esp
from ebp
on self epilog.
runtime/src/coreclr/vm/i386/asmhelpers.S
Lines 619 to 677 in aa52611
I see couple of options to resolve the problem:
- Besides
VASigCookie
GenericPInvokeCalliHelper
takesthe unmanaged target
argument viaeax
register. Caller could create a structure{the unmanaged target; VASigCookie}
and pass a pointer to the structure viaeax
.GenericPInvokeCalliHelper
able to read the structure and placethe unmanaged target
ineax
to the moment ofIL_STUB_PIvoke
call. So this option changes only caller->GenericPInvokeCalliHelper
interface,GenericPInvokeCalliHelper
->IL_STUB_PIvoke
interface remains unchanged. - Change all caller->
IL_STUB_PIvoke
calling convention to use only stack instead ofecx
+edx
+ stack to pass arguments. It will freeecx
register which could be used during caller->GenericPInvokeCalliHelper
to keepVASigCookie
value.
@jkotas Will such changes break some code outside of GenericPInvokeCalliHelper
case? Which variant is preferable?
Metadata
Metadata
Assignees
Type
Projects
Status
No status