New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[interp] Fix GetFunctionPointer #13708
Conversation
@monojenkins build failed |
This method returns a function pointer that can be called with a calli instruction. On interpreter we use a pointer to InterpMethod while on jit we use the native code address. Normally, GetFunctionPointer should return the InterpMethod pointer if called from interp or the native code address if called from jit. Since we don't have any information about the execution engine of the caller, we solve this by intrinsifying all these calls, that happen in the interpreter. Passing such function pointers between jitted and interp code is probably still unreliable. Fixes mono#13654
db7b5d8
to
b9fb268
Compare
let's wait with merging until @steveisok confirmed the fix |
I applied the fix and ran code I supplied in the original issue: https://gist.github.com/steveisok/a04557c332dfaf6ba5415a6b426ec39d It still results in a crash as detailed below: https://gist.github.com/steveisok/858c757e33596d6ccf874af6b82a379d I haven't had the chance to dig deeper yet. |
@steveisok Are you sure you applied the fix correctly. For me, this change fixes the crash on an amd64 linux with mono master. What platform are you running it on ? |
Ugh - I ran it on my mac :-). Linux is what we test the interpreter on, right? I confirmed it works on linux - GTG. |
@steveisok I think we test on linux just because it's easy to get the machines, but it should also work on macos. I tried it locally on my mac and it was also fixing the issue. |
@monojenkins backport 2019-04 |
@monojenkins backport 2019-02 |
@marek-safar backporting to 2019-04 failed, the patch results in conflicts:
Please backport manually! |
@marek-safar backporting to 2019-02 failed, the patch results in conflicts:
Please backport manually! |
This method returns a function pointer that can be called with a calli instruction. On interpreter we use a pointer to InterpMethod while on jit we use the native code address. Normally, GetFunctionPointer should return the InterpMethod pointer if called from interp or the native code address if called from jit. Since we don't have any information about the execution engine of the caller, we solve this by intrinsifying all these calls, that happen in the interpreter. Passing such function pointers between jitted and interp code is probably still unreliable. Fixes mono#13654
This method returns a function pointer that can be called with a calli instruction. On interpreter we use a pointer to InterpMethod while on jit we use the native code address. Normally, GetFunctionPointer should return the InterpMethod pointer if called from interp or the native code address if called from jit. Since we don't have any information about the execution engine of the caller, we solve this by intrinsifying all these calls, that happen in the interpreter.
Passing such function pointers between jitted and interp code is probably still unreliable.
Fixes #13654