-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Code coverage: crash when instrumenting CoreLib with Coverlet #26913
Comments
Full stack just before the crash:
|
Has this been fixed now support had been added to coverlet? Or do we need to update the libraries |
@ViktorHofer owns code coverage now and may know. It is not obvious that coverlet-coverage/coverlet#209 would fix it. |
@ViktorHofer @danmosemsft out of curiosity, what extra stuff is needed to finalize coverage support from Coverlet? |
Hi everyone, what is missing is to deploy latest coverlet.console as a global tool instead of a msbuild task (see dotnet/buildtools#2184). Meanwhile if coverlet.msbuild is updated to latest you should be able to get coverage against CoreLib using coverlet (I did test it before leaving). @danmosemsft here is the explanation on why the fix works: coverlet-coverage/coverlet#209 (comment) |
So closing this one... |
Thank you @pjanotti! Glad to see you again! |
The instrumentation added by coverlet adds a reference to "coverlet.tracker", however, this reference is causing a crash in coreclr when trying to jit the instrumented System.Private.CoreLib. At this stage I'm not sure yet about the best way to handle the issue, for now opening it on CoreFx repo where we collect coverage numbers for System.Private.CoreLib.
Basically when jitting a instrumented method from System.Private.CoreLib (coverage runs by default use the IL version of CoreLib) reference to "coverlet.tracker" causes a null reference exception because the call:
https://github.com/dotnet/coreclr/blob/1f28125ad1f9975fbe68dd6839908aa6e63fc43b/src/vm/coreassemblyspec.cpp#L135-136
return null so later the code hits the null exception at:
https://github.com/dotnet/coreclr/blob/1f28125ad1f9975fbe68dd6839908aa6e63fc43b/src/vm/coreassemblyspec.cpp#L171
In debug builds it a, corresponding, earlier assert checking for
pBinder
null:The text was updated successfully, but these errors were encountered: