-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[release/6.0] [mono] Use unsigned char when computing UTF8 string hashes #83303
[release/6.0] [mono] Use unsigned char when computing UTF8 string hashes #83303
Conversation
94292ee
to
7b786c2
Compare
Hello - Today is code-complete day for merging changes that should go into the April servicing release. Todos:
If it's not critical to get it merged in the April release, we can wait until next month. |
7b786c2
to
0e4ca74
Compare
The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes #82187 Fixes #78638
0e4ca74
to
e6dd087
Compare
@lambdageek not sure if you saw but the new check-service-labels CI leg was stuck because there were some weird problems with GitHub Actions yesterday. The fix is to remove and readd the |
Backport of #83273 to release/6.0
Resolves #82187
Resolves #78638
The corresponding 7.0 PR is #83302
Customer Impact
Resolves crashes in Release builds of Android apps that include classes with non-ASCII names that use AOT compilation.
Testing
Manual testing. New regression test.
Risk
Low. For code that uses ASCII names the hash code computation is unchanged.