Skip to content

[release/9.0.1xx-rc2] [Xamarin.Android.Build.Tasks] Disable LLVM marshal methods (#9336) - #9346

Merged
jonathanpeppers merged 2 commits into
release/9.0.1xx-rc2from
DisableMarshalMethodsRC2
Sep 30, 2024
Merged

jonathanpeppers merged 2 commits into
release/9.0.1xx-rc2from
DisableMarshalMethodsRC2

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Context: #8253
Context: #9343

We've had a number of reports about hangs when LLVM Marshal Methods are enabled (see also #8253), but we had been willing to accept having LLVM Marshal Methods enabled by default as it helps improve app startup time.

However, a customer reported a native crash when LLVM Marshal Methods are enabled:

Thread Stack Trace

syscall at line 28 within libc
__futex_wait_ex(void volatile*, bool, int, bool, timespec const*) at line 144 within libc
sem_wait at line 108 within libc
within libmonosgen-2.0.so (Build Id: …)
within <anonymous:…>

This native crash suggests "something going wrong" within MonoVM. We find this "scary" enough that we feel it is once again prudent to disable LLVM Marshal Methods by default in .NET 9, by setting the default value of $(AndroidEnableMarshalMethods)=False.

Even though #9343 has a potential fix for the hang, we feel that we're too close to .NET 9 GA to validate in the wild. This feature will need to wait for .NET 10. 🙁

To explicitly enable LLVM Marshal Methods, set
$(AndroidEnableMarshalMethods)=True in your App .csproj.

Context: #8253
Context: #9343

We've had a number of reports about *hangs* when LLVM Marshal Methods
are enabled (see also #8253), but we had been willing
to accept having LLVM Marshal Methods enabled by default as it helps
improve app startup time.

However, [a customer reported a native crash][0] when LLVM Marshal
Methods are enabled:

> ![Thread Stack Trace][1]

	syscall at line 28 within libc
	__futex_wait_ex(void volatile*, bool, int, bool, timespec const*) at line 144 within libc
	sem_wait at line 108 within libc
	within libmonosgen-2.0.so (Build Id: …)
	within <anonymous:…>

This native crash suggests "something going wrong" within MonoVM.
We find this "scary" enough that we feel it is once again prudent
to disable LLVM Marshal Methods by default in .NET 9, by setting the
default value of `$(AndroidEnableMarshalMethods)`=False.

Even though #9343 has a potential fix for the hang, we feel that
we're too close to .NET 9 GA to validate in the wild.  This feature
will need to wait for .NET 10.  🙁

To explicitly enable LLVM Marshal Methods, set
`$(AndroidEnableMarshalMethods)`=True in your App `.csproj`.

[0]: https://discord.com/channels/732297728826277939/732297837953679412/1288758900627345463
[1]: https://cdn.discordapp.com/attachments/732297837953679412/1288758900522483712/05F6ED48-2BBA-4FC0-A54F-81BB57606500.png?ex=66f659c1&is=66f50841&hm=8f6f78f283f8c03e9fb37a452ad5d0babaaad3dd4bcc1b4887f4dcf60f651c12&
@jonathanpeppers

Copy link
Copy Markdown
Member Author

There were merge conflicts in the .apkdesc files, so I had to open a PR.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

FastDeployEnvironmentFiles(False) is expected to fail, merging.

@jonathanpeppers
jonathanpeppers merged commit d6240d4 into release/9.0.1xx-rc2 Sep 30, 2024
@jonathanpeppers
jonathanpeppers deleted the DisableMarshalMethodsRC2 branch September 30, 2024 18:03
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants