Skip to content
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/7.0][mono] Use unsigned char when computing UTF8 string hashes #83302

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Mar 11, 2023

Backport of #83273 to release/7.0

Resolves #82187
Resolves #78638

The corresponding 6.0 PR is #83303

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.

@ghost ghost assigned lambdageek Mar 11, 2023
@lambdageek lambdageek added the Servicing-consider Issue for next servicing release review label Mar 11, 2023
@lambdageek lambdageek added this to the 7.0.x milestone Mar 11, 2023
@lambdageek
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/4392646513

@lambdageek

This comment was marked as outdated.

@azure-pipelines

This comment was marked as resolved.

@lambdageek
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/4406095701

@lambdageek
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/4407943691

@carlossanlop
Copy link
Member

Hey @lambdageek - Are you intending to get this approved for the April servicing release? Code-complete is today.

@lambdageek
Copy link
Member Author

@carlossanlop I don't think we'll make it. Let's try for the next one

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 dotnet#82187
Fixes dotnet#78638
@leecow leecow removed the Servicing-consider Issue for next servicing release review label Mar 14, 2023
@leecow leecow added the Servicing-approved Approved for servicing release label Mar 14, 2023
@leecow leecow modified the milestones: 7.0.x, 7.0.5 Mar 14, 2023
@lambdageek
Copy link
Member Author

@vargaz review plz. And also #83303

@lambdageek lambdageek changed the base branch from release/7.0 to release/7.0-staging March 28, 2023 18:23
@lambdageek
Copy link
Member Author

@vargaz @thaystg could I get a review for this PR and for #83303

@carlossanlop
Copy link
Member

I'm retargeting this PR to the new release/7.0-staging branch, which is the one that we will use from now on for servicing fixes.

Repo maintainers will now be allowed to merge their own servicing PR as long as it meets the requirements:

  • It is appoved by Tactics (signaled by adding the Servicing-approved label).
  • It's signed-off by an area owner.
  • The CI is green, or the failures are investigated as unrelated.
  • And if the PR touches an OOB package, the necessary OOB authoring changes are added.

The new process is described here: runtime/docs/project/library-servicing.md.

The infra team will be actively monitoring servicing PRs to ensure all requirements are met and to help with any issues.

Let me know if you have any questions.

@carlossanlop
Copy link
Member

I see you already retargeted it, @lambdageek. You're awesome.

@lambdageek lambdageek added Servicing-approved Approved for servicing release and removed Servicing-approved Approved for servicing release labels Mar 30, 2023
@lambdageek lambdageek merged commit 05038f9 into dotnet:release/7.0-staging Mar 30, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-meta-mono Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants