[mono][interp] Fix null dereference for a calli with a vararg signature - #134133
Open
PavlNekrasov wants to merge 2 commits into
Open
PavlNekrasov wants to merge 2 commits into
PavlNekrasov wants to merge 2 commits into
Conversation
Problem: In interp_transform_call() target_method stays NULL for a calli, and every other use of it in the function is guarded by a NULL check. The vararg branch is not, and mono_method_get_signature_checked() dereferences its first argument, so a calli with a vararg signature crashes the transform. Solution: Only re-resolve the signature when target_method is not NULL. Nothing has to be re-resolved for a calli, because csignature is already the call site signature taken from the standalone signature token. Signed-off-by: p.nekrasov@fobos-nt.ru Signed-off-by: morgonf@altlinux.org
PavlNekrasov
requested review from
BrzVlad,
kotlarmilos,
steveisok and
vitek-karas
as code owners
September 17, 2026 12:24
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @vitek-karas, @BrzVlad, @kotlarmilos |
lewing
reviewed
Sep 17, 2026
lewing
left a comment
Member
There was a problem hiding this comment.
This looks like it will fix the missing null check but still fail later. The change needs a working test to verify.
Problem: Guarding the NULL only moves the failure: the call then emits MINT_CALLI, and MINT_INIT_ARGLIST, the first instruction of every vararg method, reads the call site signature from the caller assuming MINT_CALL_VARARG is there. MINT_CALLI is 4 slots wide instead of 6, so a bogus data_items index is used as a MonoMethodSignature *. Solution: Report a vararg calli as not supported next to the existing thiscall check. target_method is only NULL for a calli, so the signature re-resolution needs no guard. Added a test. Signed-off-by: p.nekrasov@fobos-nt.ru Signed-off-by: morgonf@altlinux.org
Contributor
Author
You were right: the null check alone just moves the crash into |
Contributor
Author
|
@dotnet-policy-service agree company="Fobos-NT" |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #134129
Only re-resolve the signature when target_method is not NULL
Signed-off-by: p.nekrasov@fobos-nt.ru
Signed-off-by: morgonf@altlinux.org