Skip to content

Improve call counting mechanism - #32250

Merged
kouvel merged 3 commits into
dotnet:masterfrom
kouvel:CallCounting
Mar 3, 2020
Merged

Improve call counting mechanism#32250
kouvel merged 3 commits into
dotnet:masterfrom
kouvel:CallCounting

Conversation

@kouvel

@kouvelkouvel commented Feb 13, 2020

Copy link
Copy Markdown
Contributor
  • Commit 1
  • Commit 2
    • Fixes crashes and assertion failures seen by the original change, fixesCrashes caused by "Improve call counting mechanism" change #29934
    • The crashes were caused by commit 6aa3c70 in the original PR
    • Call counting infos cannot be deleted when the corresponding call counting stubs may still run, because:
      • The remaining call count decremented by the stub is in the call counting info
      • The only way to get a code version / method desc from a stub is to go through the call counting info
    • Got one repro of the assertion failure in leakwheel GC test triggered assert #22786 and JIT.Methodical failing on coreclr outerloop #24664 (fixesJIT.Methodical failing on coreclr outerloop #24664) and it is most likely caused by the same issue, following heap corruption from modifying a deleted call counting info where the memory is reused for an object used by code versioning, messing up some data and making it look like the code version is not active when it actually is according to the dump
    • Fixed with a partial revert of the above commit. Added back the Complete stage and then call counting infos are deleted only after it's ensured that call counting stubs won't be used (shortly before deleting them).
  • Commit 3
    • Public static functions of CallCountingManager that may be called through the debugger may occur before static initialization, added a check for null as suggested in Fix createdump DAC segfault #29892

@kouvelkouvel added this to the 5.0 milestone Feb 13, 2020
@kouvelkouvel self-assigned this Feb 13, 2020
@kouvel

Copy link
Copy Markdown
ContributorAuthor

Got a consistent repro of the crash after a few hours of running a CoreFX test suite, verified no repro after fix after 12+ hours. Got one repro of the assertion failure, currently running again after fix, will continue running overnight.

@kouvel

Copy link
Copy Markdown
ContributorAuthor

No assertion failure after 12+ hours after fix. Rebased to fix conflicts.

@kouvelkouvel closed this Feb 18, 2020
@kouvelkouvel reopened this Feb 18, 2020

@noahfalknoahfalk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@kouvel

Copy link
Copy Markdown
ContributorAuthor

Thanks @noahfalk! Rebased to latest to run through the checks again.

@kouvel

Copy link
Copy Markdown
ContributorAuthor

Failures are same as #32951

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

Koundinya Veluri added 3 commits March 2, 2020 11:21
- Commit 1
- Reverts commit f954c6b, which reverted PR #1457 due to issues
- Commit 2
- Fixes crashes and assertion failures seen by the original change, fixes#29934
- The crashes were caused by commit 6aa3c70 in the original PR
- Call counting infos cannot be deleted when the corresponding call counting stubs may still run, because:
- The remaining call count decremented by the stub is in the call counting info
- The only way to get a code version / method desc from a stub is to go through the call counting info
- Got one repro of the assertion failure in #22786 and it is most likely caused by the same issue, following heap corruption from modifying a deleted call counting info where the memory is reused for a `NativeCodeVersionNode`, messing up the method desc pointer
- Fixed with a partial revert of the above commit. Added back the `Complete` stage and then call counting infos are deleted only after it's ensured that call counting stubs won't be used (shortly before deleting them).
- Commit 3
- Public static functions of `CallCountingManager` that may be called through the debugger may occur before static initialization, added a check for null as suggested in #29892
@kouvel

Copy link
Copy Markdown
ContributorAuthor

Rebased to fix conflict

@kouvel
kouvel merged commit f30ea37 into dotnet:masterMar 3, 2020
@kouvel
kouvel deleted the CallCounting branch March 3, 2020 15:55
gbalykov added a commit to gbalykov/runtime that referenced this pull request Apr 4, 2020
jkotas pushed a commit that referenced this pull request Apr 6, 2020
* Fix Linux x86 build
Related to #33005
* Fix Linux x86 build
Related to #33653, #33005
* Fix Linux x86 build
Related to #32250
@richlanderrichlander mentioned this pull request Jun 6, 2020
@ghostghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crashes caused by "Improve call counting mechanism" change JIT.Methodical failing on coreclr outerloop

3 participants

@kouvel@noahfalk@davidwrighton