Skip to content

[Bug] UTF8 decoder fail to decode a byte array in a WASM app on combo Android ARM + Chrome + AOT #106755

Closed
@dbriard

Description

@dbriard

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:
image

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

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.

image

Expected behavior

The result should be:

image

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:
image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions