-
Notifications
You must be signed in to change notification settings - Fork 5k
[Bug] UTF8 decoder fail to decode a byte array in a WASM app on combo Android ARM + Chrome + AOT #106755
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
Comments
Additional details: I tried without AOT compilation and the problem do not happen. I also tested on Firefox android, no problem, and on iPhone (Safari and Chrome), no problem... So in the end, not sure if the issue is in .NET8 or Chrome ARM on android... If you need additionnal info, let me know. |
Tagging subscribers to 'arch-wasm': @lewing |
Tagging subscribers to this area: @dotnet/area-system-globalization |
Tagging subscribers to this area: @dotnet/area-system-text-encoding |
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger |
CC @lewing |
I think this is probabaly a chrome issue where there is a bug when running wasm on a 32bit build, Chrome on android is shipped as a 32 bit executable by default. All the scenarios where chrome works are 64 bit builds. @kg what is the best way to file issues like this? |
@dbriard, I don't have a setup for direct reproduction of this but for now, let's focus on this point. The line is here:
You could build the runtime repository from source, if you have never done it, the instructions are here. Then, in your client project replace the runtime used by the application by adding:
Let me know if you can step in after this operation and if there's any more hints on what's going on. Edit: |
Given that it is the first 128bits that are zero, can you also try building with |
This issue has been marked |
This issue has been automatically marked |
Description
Hi all,
I discoved a strange issue in .NET8.
I have a WASM application build using Avalonia framework that was running fine on my platforms (desktop browsers, and android browsers).
After I migrated from .NET7 to .NET8, the "website" failed to load on my Android device throwning a exception.
I debugged as deep as I could and found that the problem come from the GetChars function in Encoding.UTF8.GetDecoder().
The function is used by ReadString() of BinaryReader.
Here my debug output on platforms that works:

And here is the same on my android phone using Chrome latest version.

The 15 first characters are not read correctly! I read severals strings, and for each strings the first 15 characters are 0.
What is really strange, is that on the same device, there is no problem when I run the website on Edge browser. Same issue on a different phone.
Here more tests:
Android device 1/Chrome => BUG
Android device 2/Chrome => BUG
Android device 1/Chrome BETA => BUG
Android simulator on Windows 11/Chrome => work
Android device 1/Edge => work
Windows11/Edge => work
Windows11/Firefox => work
Windows11/Chrome => work
My code is compiled using AOT.
Reproduction Steps
Try to decode the following byte array on a WASM app (AOT?) on Android physical device in Chrome browser.
Expected behavior
The result should be:
Actual behavior
The 15 first chars are 0 on android device using chrome.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
I cannot debug more deeper as the code is not accessible:

The text was updated successfully, but these errors were encountered: