Skip to content
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

[MonoVM] Fix calculation of code size for AOT assemblies mixing JIT and LLVM #58491

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

filipnavara
Copy link
Member

@filipnavara filipnavara commented Sep 1, 2021

Fixes #56100

Here's a little bit of background on the problem. When multiple AOT modules got linked into the same executable for iOS/MacCatalyst the LLVM and JIT code sections of different modules got interleaved. The resulting AOT module info looks something like this:

JIT start: 0x101002100 JIT end: 0x1010035e0
LLVM start: 0x104c027c8 LLVM end: 0x104c603e8
Sorted methods:
  0x101002250
  0x101002390
  0x101002470
  0x104c027c8
  0x104c027e0
  ...

The previous code incorrectly assumed that the third method had a code size 0x104c027c8 - 0x101002470. When inserted into lookup table any of the AOT code inside the range 0x1010035e0 (JIT code end) - 0x104c027c8 (LLVM code start) would incorrectly end up being mapped to the last JIT method.

(Note: The JIT name here is misleading.)

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Sep 1, 2021
@lambdageek
Copy link
Member

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2021

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1190642261

@imhameed
Copy link
Contributor

imhameed commented Sep 1, 2021

The "Build MacCatalyst x64 Release AllSubsets_Mono" failures are also present in a completely unrelated PR. Ditto for "Build iOSSimulator x64 Release AllSubsets_Mono".

@lambdageek lambdageek merged commit f8f4aeb into dotnet:main Sep 1, 2021
@SamMonoRT SamMonoRT requested a review from rolfbjarne September 1, 2021 17:18
@ghost ghost locked as resolved and limited conversation to collaborators Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Codegen-LLVM-mono community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS: building with LLVM causes some exception catch clauses to not work
3 participants