-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
TPA map hash calculation in case of "the Turkish-I Problem" if locale was changed. #37910
Comments
Tagging subscribers to this area: @vitek-karas |
Comparison of assembly names is case insensitive throughout the stack. Switching this one to case sensitive comparison would introduce a different set of inconsistencies. Can this be fixed by using Ideally, the assembly binder would be written in C# where we have the well tested globalization functions available, but that's quite a bit of work. |
I think both Basically, if string comparisons(or calculation for the strings) are made between a cached case insensitive one based on the initial locale and a newly converted string based on the current locale, there is a chance of malfuntion regardless of changing this to case sensitive. |
The |
I tested
looks like all works fine with this changes. I could see, that generated hashes not connected to locale any more (tested with us, tr and az locales), we could avoid "the Turkish-I Problem" in this way. |
* Fix TPA map hash calculation. The point of issue is "the Turkish-I Problem". After locale changed, towupper() provide another result for "i" and different hash are calculated in case if file name have "i" letter. * Regression test for #37910
We are faced with issue, when CoreCLR calculate TPA hash for map entry with not Turkish and not Azeri locale and call TPA map lookup after locale was changed to Turkish or Azeri:
runtime/src/coreclr/src/binder/assemblybinder.cpp
Line 1066 in 97e553f
The point of issue is "the Turkish-I Problem" (https://docs.microsoft.com/en-us/previous-versions/dotnet/articles/ms973919(v=msdn.10)?redirectedfrom=MSDN#the-motivation-the-turkish-i-problem). After locale changed,
towupper()
provide another result fori
and different hash are calculated in case if file name havei
letter.All works fine (for Linux) if hash function
HashiString()
replaced byHashString()
(case-sensitive, withouttowupper()
call).Is the any restrictions for
HashString()
usage here instead ofHashiString()
in case of Linux with case sensitive filesystems? Or, could we fix this in another way?CC @alpencolt @jkotas
The text was updated successfully, but these errors were encountered: