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

IL: optimize attribute cluster reading (Fixed version) #15941

Merged
merged 10 commits into from
Oct 31, 2023

Conversation

DedSec256
Copy link
Contributor

Fixed version of #13821

This PR contains fix 1e0ebe5 for the loop counter that previously caused seek to hang in an unsorted table #14651.
Search in a sorted table is also slightly refactored to be more clear.

Without this fix, the hang reproduced at build time and in the IDE while analyzing file SplitApp.Android/MainActivity.fs from the issue above, when trying to read attributes for assembly System.Runtime.CompilerServices.Unsafe.dll (Metadata v4.0.30319).

cc @auduchinok

@DedSec256 DedSec256 requested a review from a team as a code owner September 6, 2023 15:48
Copy link
Member

@auduchinok auduchinok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DedSec256 Thanks!

@auduchinok
Copy link
Member

Would it be possible to write a test that references System.Runtime.CompilerServices.Unsafe.DLL and can reproduce the issue without your fixes?

@vzarytovskii
Copy link
Member

This will probably have to go past net8, just to be safe

@psfinaki
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@psfinaki
Copy link
Member

@DedSec256 hey Alex, this LGTM, if possible please add a test described by Eugene, then we can probably pull this in.

@DedSec256
Copy link
Contributor Author

@psfinaki, I tried to add a test, but it requires the specific version of System.Runtime.CompilerServices.Unsafe.dll (Metadata v4.0.30319) on which the problem is known to reproduce. So we need to push this version of the library, or come up with something else.

@vzarytovskii
Copy link
Member

@psfinaki, I tried to add a test, but it requires the specific version of System.Runtime.CompilerServices.Unsafe.dll (Metadata v4.0.30319) on which the problem is known to reproduce. So we need to push this version of the library, or come up with something else.

Just have a separate manual test under tests/projects/ which demonstrates the issue + uses a just built compiler. We don't run them for now, though we probably can add them as we do with trimming tests.

@DedSec256
Copy link
Contributor Author

DedSec256 commented Oct 25, 2023

Sorry, I tried to reproduce it yesterday and today, but for some reason I couldn't. The fix from 1e0ebe5

seems obvious, maybe is it possible to merge this as is?

@vzarytovskii
Copy link
Member

Just to be clear, the change compared to previous revision is an off-by-one fix?

@DedSec256
Copy link
Contributor Author

Yes, the current version differs from the previous one by only one commit 1e0ebe5 that has two changes:

  1. Fix for the loop counter that previously caused seek to hang in an unsorted table.
  2. Search in a sorted table is also slightly refactored to be more clear.

@psfinaki psfinaki merged commit acd147b into dotnet:main Oct 31, 2023
24 checks passed
@DedSec256 DedSec256 deleted the il-attrs-array-2 branch October 31, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants