Description
Description
I’m developing a game called GnollHack using .NET MAUI 9.0.50 / .NET SDK 9.0.202, and it uses NuGet package called Azure.Storage.Blobs
(see https://github.com/hyvanmielenpelit/GnollHack). The game and the package works just fine on iOS, Windows and also on Android when EnableLLVM
is set to false or when using x64 ABI. When EnableLLVM
is turned on on Android ARM64, the game works otherwise very well, except for when it tries to call a function called GetBlobContainers
from Azure.Storage.Blobs
, in which case the app freezes. There is no crash, just the main thread seems to freeze. If I use GetBlobContainersAsync
instead, the function just does not work, but there is no freeze.
We investigated this in detail, and it turns out that LLVM version of ARM64 ABI library for System.Net.Sockets.dll.so
causes the issue. If the LLVM version is changed to Mono AOT version while keeping all the other libraries LLVM compiled, the game works just fine.
We suspect that this is some sort of an LLVM code generation bug on Android ARM64.
Reproduction Steps
- Clone the reproduction repository at https://github.com/hyvanmielenpelit/GnollHackMAUIEasyBuild
- Open GnollHackM.sln solution file located at win/win32/xpl/GnollHackM in Visual Studio 2022
- Select Release configuration
- Build the solution according to instructions in the repository
- Start the game on your Android device by pressing Start without Debugging green arrow in Visual Studio’s toolbar
- Go to the game’s settings screen by pressing Settings button on the main screen
- Switch Record Game and Auto-Upload to Cloud on under Replays subtitle
- Press Play Game, and start playing
- Open game menu from the button in top-right corner, and select Save & Exit Game (answer ‘yes’ to any questions)
- The game freezes upon return to the main screen (the game tries to upload a recorded replay file to Azure)
- (If you switch EnableLLVM off, the game does not freeze anymore)
- You can also see that Azure.Storage.Blobs malfunctions by going to Vault > Replays, and changing the location in the selection dropdown list from Local to Cloud, which returns a number of directories if working, and stucks at (Loading...) if not
Expected behavior
Azure.Storage.Blobs works normally on Android ARM64 when using LLVM
Actual behavior
Using Azure.Storage.Blobs either freezes the app or generally malfunctions on Android ARM64 when using LLVM
Regression?
Not sure.
Known Workarounds
Replace the LLVM generated library for System.Net.Sockets.dll.so
with the one generated by Mono AOT
Configuration
.NET 9.0.3, Android 15, ARM64
Other information
Jonathan Peppers suggested that I file the bug report here.