[Android 9.0.3] Enabling LLVM leads to incorrect SkiaSharp drawing behavior in some cases
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- android, csharp
- Domain
- compilers, mobile-dev
Research direction
Start with the GnollHackMAUIEasyBuild reproduction repository and follow its Android Release build instructions. Reproduce the drawing failure with EnableLLVM enabled and AndroidEnableProfiledAot disabled, then compare it with LLVM disabled and profiled AOT enabled. Done means the radial-transparency drawing works correctly in the reported configuration or the runtime cause is isolated with a minimal reproduction.
Written by the indexing model from the issue text.
Description
Description
In my game GnollHack, I have a specialized drawing function called DrawTileWithRadialTransparency that uses SkiaSharp to draw radial transparency for a bitmap. The function works always (on all platforms and in both Xamarin and MAUI), except for MAUI in Android in release mode when EnableLLVM is set to true and AndroidEnableProfileAot set to false, in which case it either does not draw anything or draws something in the wrong place with a wrong size. This seems to be some sort of an LLVM code generation bug, as the behavior makes otherwise little sense (it feels like the program does not do what is instructed in the code). Not sure why the problems occur just with this function, although it is a bit more complicated than the other ones. If I comment some parts of the code out (e.g. the unsafe block) or add something, the function most often still does not work as intended.
Reproduction Steps
- Clone the reproduction repository at https://github.com/hyvanmielenpelit/GnollHackMAUIEasyBuild
- Open GnollHackM solution
- Build it for Android in Release configuration according to instructions in the repository
- Note that EnableLLVM is on.
- Start the app on your Android device
- Press Settings button and switch Developer Mode on in System section, then press Close
- Switch on Wizard Mode
- Press Play Game, create a character and start playing
- Press More Commands button on bottom right corner, and scroll then left to Wizard Mode Commands
- Select Genesis and type yellow light
- A yellow light monster appears, but it has no graphics
- Quit the game and exit app
- Switch EnableLLVM to off and AndroidEnableProfiledAot to true.
- Go to step 3. In step 11, note that the yellow light has now graphics.
Expected behavior
Radial transparency function works with Android Release mode with EnableLLVM = true just like in every other case.
Actual behavior
The drawn picture either is not drawn or is drawn in the wrong position with the wrong size.
Regression?
Not sure. This is an LLVM problem.
Known Workarounds
None. Cannot use LLVM if I want to use the function in question.
Configuration
.NET 9.0.3, .NET MAUI 9.0.50, SkiaSharp 3.116.1
Android 15, ARM64
Other information
No response
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·