You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating the thread with some more info I found while investigating this issue...
The root cause of this is dotnet/coreclr#27515. The new MethodDetails event tries to take the TypeHash lock when it tries to add a type to the cache we have for emitting type data in rundown, but it does that while holding the CodeHeapIterator lock which is a SingleUseLock, so there is this violation.
As far as I can see, there isn't really a "good" way to fix this in the short run. A potential solution is to emit these events without storing the type in the cache, but that'll be really slow when we're not under rundown (this event will get called during assembly unload as well).
I will come back to this later since this isn't really blocking any product development.
I am now hitting this locally in any attempt to run coreclr tests with a checked or debug build of runtime on OSX and Linux. I have a clean build of the current master. All tests are failing with this assert. I wonder how is it possible that we are not hitting it in the CI.
I am now hitting this locally in any attempt to run coreclr tests with a checked or debug build of runtime on OSX and Linux. I have a clean build of the current master. All tests are failing with this assert. I wonder how is it possible that we are not hitting it in the CI.
Do you know if you have any eventing turned on? As far as I know there aren’t any tests that turn on the keywords necessary to hit this issue.
Same here. I am getting this once in a while when trying to collect profile information using perfcollect on linux arm64 and dotnet-trace on windows arm64.
@sywhang I have looked at the tests/runtest.sh and it enables event logging by default. I've just found that the tests are not failing if I execute them individually using their .sh files. But if I run them all using ./tests/runtest.sh --coreOverlayDir=/home/janvorli/git/runtime/artifacts/tests/coreclr/Linux.x64.Debug/Tests/Core_Root --testNativeBinDir=/home/janvorli/git/runtime/artifacts/obj/coreclr/Linux.x64.Debug/tests --testRootDir=/home/janvorli/git/runtime/artifacts/tests/coreclr/Linux.x64.Debug --copyNativeTestBin Debug (launched from the src/coreclr), then they fail.
When I do test runs on Linux right now from a clean source checkout I get a ton of these errors in various tests. I'm also using runtest.sh with the recommended arguments.
Consistency check failed: Crst Level violation: Can't take level 7 lock CrstEtwTypeLogHash because you already holding level 5 lock CrstSingleUseLock
I see this on both x64/ux and arm64/ux. Thanks to the hint from @janvorli I added --disableEventLogging to my test run. It still reports them as failures at the end of the output, but not in the rolled-up results, making it much easier to figure out where any new failures are.
FWIW, even though this is not "really blocking any product development", it is pretty painful to deal with.
Activity
[-]Crst Level Violation on rundown[/-][+]Crst Level Violation on rundown event emit[/+]sywhang commentedon Jan 11, 2020
Updating the thread with some more info I found while investigating this issue...
The root cause of this is dotnet/coreclr#27515. The new MethodDetails event tries to take the TypeHash lock when it tries to add a type to the cache we have for emitting type data in rundown, but it does that while holding the CodeHeapIterator lock which is a SingleUseLock, so there is this violation.
As far as I can see, there isn't really a "good" way to fix this in the short run. A potential solution is to emit these events without storing the type in the cache, but that'll be really slow when we're not under rundown (this event will get called during assembly unload as well).
I will come back to this later since this isn't really blocking any product development.
janvorli commentedon Mar 10, 2020
I am now hitting this locally in any attempt to run coreclr tests with a checked or debug build of runtime on OSX and Linux. I have a clean build of the current master. All tests are failing with this assert. I wonder how is it possible that we are not hitting it in the CI.
sywhang commentedon Mar 18, 2020
Do you know if you have any eventing turned on? As far as I know there aren’t any tests that turn on the keywords necessary to hit this issue.
kunalspathak commentedon Mar 19, 2020
Same here. I am getting this once in a while when trying to collect profile information using perfcollect on linux arm64 and dotnet-trace on windows arm64.
janvorli commentedon Mar 19, 2020
@sywhang I have looked at the tests/runtest.sh and it enables event logging by default. I've just found that the tests are not failing if I execute them individually using their .sh files. But if I run them all using
./tests/runtest.sh --coreOverlayDir=/home/janvorli/git/runtime/artifacts/tests/coreclr/Linux.x64.Debug/Tests/Core_Root --testNativeBinDir=/home/janvorli/git/runtime/artifacts/obj/coreclr/Linux.x64.Debug/tests --testRootDir=/home/janvorli/git/runtime/artifacts/tests/coreclr/Linux.x64.Debug --copyNativeTestBin Debug(launched from the src/coreclr), then they fail.CarolEidt commentedon May 7, 2020
I am also seeing this in my test runs on x64/ux. I had 61 instances of this in a test run with no changes.
kg commentedon May 15, 2020
When I do test runs on Linux right now from a clean source checkout I get a ton of these errors in various tests. I'm also using runtest.sh with the recommended arguments.
Consistency check failed: Crst Level violation: Can't take level 7 lock CrstEtwTypeLogHash because you already holding level 5 lock CrstSingleUseLockCarolEidt commentedon May 18, 2020
I see this on both x64/ux and arm64/ux. Thanks to the hint from @janvorli I added
--disableEventLoggingto my test run. It still reports them as failures at the end of the output, but not in the rolled-up results, making it much easier to figure out where any new failures are.FWIW, even though this is not "really blocking any product development", it is pretty painful to deal with.
echesakov commentedon May 21, 2020
Carol brought to my attention the question Jan asked:
I would like to answer: we never set COMPlus_EnableEventLog in our Helix runs and the CI doesn't use runtest.sh that sets this variable to 1.
I wonder thought if want to enable the event log in our CI (maybe, in a separate test scenario) so we can catch issues like this?
sywhang commentedon Jun 3, 2020
This issue should now be fixed with #36932.