Skip to content

Remove reliance on s_isTracking to detect recursion #297

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

Merged
merged 2 commits into from
Jan 16, 2019

Conversation

sharwell
Copy link
Contributor

@sharwell sharwell commented Jan 15, 2019

Fixes dotnet/coreclr#21994

The stack overflow was caused when a call to RecordHit occurred prior to the initialization of HitsArray, which in turn called an instrumented constructor for NullReferenceException.

@codecov
Copy link

codecov bot commented Jan 15, 2019

Codecov Report

Merging #297 into master will increase coverage by 0.21%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
+ Coverage   88.85%   89.06%   +0.21%     
==========================================
  Files          16       16              
  Lines        1875     1912      +37     
==========================================
+ Hits         1666     1703      +37     
  Misses        209      209
Impacted Files Coverage Δ
src/coverlet.core/Instrumentation/Instrumenter.cs 99.04% <100%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a50c10a...96b1594. Read the comment docs.

@codemzs
Copy link

codemzs commented Jan 15, 2019

@sharwell Is this PR ready to be merged?

@sharwell
Copy link
Contributor Author

@codemzs No, I'm working with @ViktorHofer to figure this out still

@sharwell sharwell changed the title Remove reliance on s_isTracking to detect recursion [WIP] Remove reliance on s_isTracking to detect recursion Jan 15, 2019
@sharwell sharwell force-pushed the default-init branch 2 times, most recently from 367315f to db5dbc5 Compare January 15, 2019 22:35
@sharwell sharwell changed the title [WIP] Remove reliance on s_isTracking to detect recursion Remove reliance on s_isTracking to detect recursion Jan 15, 2019
@sharwell
Copy link
Contributor Author

OK this should be ready now 😄

@@ -76,6 +77,7 @@ private void InstrumentModule()

using (var module = ModuleDefinition.ReadModule(stream, parameters))
{
var containsAppContext = module.GetType(nameof(System), nameof(AppContext)) != null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📝 This could be modified to also check the name of the containing assembly, but it didn't seem necessary.

@ViktorHofer
Copy link
Contributor

I validated the fix together with @sharwell offline and we finally got our code coverage for System.Private.CoreLib back hooray.

Calculating coverage result...
  Generating report 'C:\git\corefx\artifacts\bin\tests\System.Diagnostics.Debug.Tests\netcoreapp-Windows_NT-Debug-x64\coverage.xml'
+--------------------------+--------+--------+--------+
| Module                   | Line   | Branch | Method |
+--------------------------+--------+--------+--------+
| System.Diagnostics.Debug | 100%   | 100%   | 100%   |
+--------------------------+--------+--------+--------+
| System.Private.CoreLib   | 16.2%  | 11.4%  | 14.4%  |
+--------------------------+--------+--------+--------+

+---------+--------+--------+--------+
|         | Line   | Branch | Method |
+---------+--------+--------+--------+
| Total   | 16.2%  | 11.4%  | 14.4%  |
+---------+--------+--------+--------+
| Average | 8.1%   | 5.7%   | 7.2%   |
+---------+--------+--------+--------+

@ViktorHofer
Copy link
Contributor

cc @tonerdo

@tonerdo
Copy link
Collaborator

tonerdo commented Jan 16, 2019

I see you all have been busy 😄. Thanks for all the help guys

@tonerdo tonerdo merged commit a69645c into coverlet-coverage:master Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants