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

Assembly loader cache is case-insensitive even on cache-sensitive file systems #57286

Open
jkotas opened this issue Aug 12, 2021 · 1 comment

Comments

@jkotas
Copy link
Member

jkotas commented Aug 12, 2021

FEATURE_CASE_SENSITIVE_FILESYSTEM is never defined. It means that the assembly loader ends up doing case-insensitive caching even on OSes that are naturally case-insensitive. It leads to odd behaviors like #57237 (comment) .

Repro:

  1. Create a dummy TestAssembly.dll somewhere
  2. Run on Linux:
Assembly.LoadFrom(@"/path_to_test_assembly/TestAssembly.dll");

// This will succeed by using cached copy of TestAssembly.dll even though testassembly.dll does not actually exist on the case-sensitive filesystem
Assembly.LoadFrom(@"/path_to_test_assembly/testassembly.dll");

Note that calling Assembly.LoadFrom(@"/path_to_test_assembly/testassembly.dll"); without the previous LoadFrom call that populates the cache is going to fail.

We need to:

  • Decide whether whether to fix the current behavior. (Note that Mono does not have this bug, and that fixing it in CoreCLR would be a minor breaking change.)
  • Add tests for this scenario.
@dotnet-issue-labeler dotnet-issue-labeler bot added area-AssemblyLoader-coreclr untriaged New issue has not been triaged by the area owner labels Aug 12, 2021
@ghost
Copy link

ghost commented Aug 12, 2021

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

FEATURE_CASE_SENSITIVE_FILESYSTEM is never defined. It means that the assembly loader ends up doing case-insensitive caching even on OSes that are naturally case-insensitive. It leads to odd behaviors like #57237 (comment) .

Repro:

  1. Create a dummy TestAssembly.dll somewhere
  2. Run on Linux:
Assembly.LoadFrom(@"/path_to_test_assembly/TestAssembly.dll");

// This will succeed by using cached copy of TestAssembly.dll even though it does not actually exist on the case-sensitive filesystem
Assembly.LoadFrom(@"/path_to_test_assembly/testassembly.dll");

Note that calling Assembly.LoadFrom(@"/path_to_test_assembly/testassembly.dll"); without the previous LoadFrom call that populates the cache is going to fail.

We need to:

  • Decide whether whether to fix the current behavior. (Note that Mono does not have this bug, and that fixing it in CoreCLR would be a minor breaking change.)
  • Add tests for this scenario.
Author: jkotas
Assignees: -
Labels:

area-AssemblyLoader-coreclr, untriaged

Milestone: -

@agocke agocke added this to the 7.0.0 milestone Sep 7, 2021
@agocke agocke removed the untriaged New issue has not been triaged by the area owner label Sep 7, 2021
@agocke agocke modified the milestones: 7.0.0, 8.0.0 Jul 25, 2022
@agocke agocke modified the milestones: 8.0.0, 9.0.0 Jul 26, 2023
@agocke agocke modified the milestones: 9.0.0, 10.0.0 Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants