Repository navigation
tracing/eventpipe/eventsourceerror/eventsourceerror/eventsourceerror failure #80666
Copy link
Copy link
Closed
Closed
Copy link
Labels
Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tabarea-System.Diagnostics.Tracingblocking-outerloopBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runsBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runsbugdisabled-testThe test is disabled in source code against the issueThe test is disabled in source code against the issuein-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedos-linuxLinux OS (any supported distro)Linux OS (any supported distro)os-macosmacOS aka OSXmacOS aka OSX
Milestone
Description
Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=137937
Build error leg or test failing: Build / coreclr Pri1 Runtime Tests Run osx x64 checked / Send tests to Helix (Unix)
Pull request: #80626
Error Message
Fill the error message using known issues guidance.
{
"ErrorPattern": "eventsourceerror\\.sh:.*Segmentation fault",
"BuildRetry": false
}Known issue validation
Build: 🔎
Result validation:
Validation performed at: 7/21/2024 2:00:18 AM UTC
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 1 | 21 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tabarea-System.Diagnostics.Tracingblocking-outerloopBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runsBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runsbugdisabled-testThe test is disabled in source code against the issueThe test is disabled in source code against the issuein-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedos-linuxLinux OS (any supported distro)Linux OS (any supported distro)os-macosmacOS aka OSXmacOS aka OSX
Activity
tommcdon commentedon Jan 17, 2023
Test output indicates that the test is crashing with a seg fault and createdump fails either because the process is gone or there is a signing/entitlement issue. @hoyosjs @mikem8361
hoyosjs commentedon Jan 19, 2023
It's an entitlement issue. The regex is looking for a string that can hit on any osx coreclr crash. Adjusting the string since the issue is also not OSX specific.
EgorBo commentedon Jan 24, 2023
Can we disable the test until it's fixed? UPD: #81094
25 remaining items
JulieLeeMSFT commentedon Jul 22, 2024
failed in outerloop: runtime-coreclr outerloop/20240721.3
Failed configs:
Log
mdh1418 commentedon Jul 23, 2024
Based solely on the console logs from the recent failures on OSX, it looks like the readerTask does complete, so it's just stopTask that is causing the crash,
runtime/src/tests/tracing/eventpipe/common/IpcTraceTest.cs
Line 301 in cb4d8a2
@davmason , do you happen to recall any recent modifications to the DiagnosticsClient EventPipeSession that could be causing crashes for specifically the eventsourceerror test?
jkotas commentedon Jul 24, 2024
This issue was opened 1.5 years ago. Based on the symptoms, it is an intermittent crash that can come and go due to unrelated changes in timing, etc.
jkotas commentedon Jul 25, 2024
The crash happens at this line:
runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs
Line 65 in 3ec6286
We are crashing because the GCHandle was freed already. We are freeing the GCHandle here:
runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs
Line 97 in 3ec6286
I do not see anything in the implementation of EventPipeInternal.DeleteProvider to guarantee there are no callback in flight when it returns. In fact,
runtime/src/native/eventpipe/ep.c
Lines 1317 to 1322 in 3ec6286
@mdh1418 Does this make sense - could you please take it from here?
mdh1418 commentedon Jul 26, 2024
Thanks for pinpointing the crash @jkotas!
After some offline discussions with @noahfalk , I'm seeing that ETW has the behavior of blocking during EventProvider.Dispose() until all already in-flight callbacks are finished, so if any callbacks happen to be initiated after the EventListenersLock in EventProvider.Dispose(), then this p/invoke will block here at Interop.Advapi32.EventUnregister until the ETW command releases the ETW lock as described in the comment.
Would parity between ETW and EventPipe in that aspect be better than deferring deleting the GC handle, as in having
EventPipeEventProviders Disposal blocked by in flight callbacks?Perhaps for EventPipe, we could invoke Unregister under the EventListenersLock since the original reason for not doing so was because of deadlocking with the ETW lock + EventListenersLock.(edit: since having managed locks do different behaviors for ETW/EventPipe would bring inconsistency).jkotas commentedon Jul 26, 2024
I do not have an opinion. If you think that synchronous blocking would be better, it is fine with me.
I think that the synchronous blocking would have to be in the unmanaged event pipe code. I do not see how you can use locks on the managed side to fix this.
noahfalk commentedon Jul 26, 2024
Yeah, I want to do it unmanaged code because I want to match behavior between EtwEventProvider.Unregister() and EventPipeProvider.Unregister(). Both of them invoke a p/invoke to do the unregister work and I am recommending we give those p/invokes identical blocking behavior.
mdh1418 commentedon Aug 1, 2024
The attempt to introduce a new lock to coordinate in-flight callbacks with provider disposal broke concurrent callbacks. Still looking to block provider disposal with a weaker blocking behavior
mdh1418 commentedon Aug 6, 2024
Signal wait/set blocking implementation: #106040