Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AOT compiler for .NET/iOS not built with MONOTOUCH defined #45002

Closed
rolfbjarne opened this issue Nov 20, 2020 · 5 comments
Closed

AOT compiler for .NET/iOS not built with MONOTOUCH defined #45002

rolfbjarne opened this issue Nov 20, 2020 · 5 comments
Assignees
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Nov 20, 2020

Description

The symptom is that an AOT-compiled iOS app can crash at runtime on device with:

error: Ran out of trampolines of type 0 in '/private/var/containers/Bundle/Application/D21C45AD-25AB-4FD9-A08F-706A43A7974D/link all.app/System.Private.CoreLib.dll' (limit 4096). See http://docs.xamarin.com/ios/troubleshooting for instructions on how to fix this condition.

I diagnosed a bit, and the reason is that this line is never executed:

#ifdef MONOTOUCH
acfg->aot_opts.use_trampolines_page = TRUE;
#endif

which presumably happens because MONOTOUCH isn't defined.

I decompiled the AOT compiler shipped with .NET, and the one we currently use for Xamarin.iOS, and only the latter contains the line above.

.Mono for Xamarin.iOS: https://gist.github.com/rolfbjarne/8607804c44f873ebf6ef711e50f30134#file-foo-diff-L217-L223
.NET: https://gist.github.com/rolfbjarne/37cebf4f43296d9f51474944dd424650#file-foo-diff-L219-L224

This is the missing line: https://gist.github.com/rolfbjarne/8607804c44f873ebf6ef711e50f30134#file-foo-diff-L222

CC @akoeplinger

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 20, 2020
@akoeplinger akoeplinger added area-Build-mono and removed untriaged New issue has not been triaged by the area owner labels Nov 20, 2020
@akoeplinger
Copy link
Member

/cc @vargaz

@imhameed
Copy link
Contributor

This should be fixed; does this particular crash still happen? (I haven't personally gotten to the point where I've run an AOT-compiled app on-device, so it might take me a little while to create and test a repro.)

@imhameed imhameed self-assigned this Nov 20, 2020
@rolfbjarne
Copy link
Member Author

This should be fixed; does this particular crash still happen?

I'll check once there are .NET packages with the fix.

@rolfbjarne
Copy link
Member Author

This is fixed.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 12, 2021
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants