Skip to content
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

In-proc event listener listening to native runtime event source events crashes on Mono Linux #66854

Closed
kouvel opened this issue Mar 18, 2022 · 2 comments
Labels
area-Tracing-mono disabled-test The test is disabled in source code against the issue os-linux Linux OS (any supported distro) os-mac-os-x macOS aka OSX
Milestone

Comments

@kouvel
Copy link
Member

kouvel commented Mar 18, 2022

In PR #66765 I tried to use an in-proc EventListener to listen to a thread pool event. On Mono, this appears to work fine on Windows but is crashing at the following stack on Linux. Also crashed on OSX in the PR's CI.

The test is in System.Threading.ThreadPool tests named 'CooperativeBlockingCanCreateThreadsFaster'. For now, I'll disable the test on Mono in that PR.

  =================================================================
        Managed Stacktrace:
  =================================================================
          at <unknown> <0xffffffff>
          at System.Runtime.InteropServices.GCHandle:InternalGet <0x00079>
          at System.Runtime.InteropServices.GCHandle:get_Target <0x00047>
          at HandleManager:FromHandle <0x000ab>
          at System.Threading.WaitSubsystem:SetEvent <0x0002b>
          at System.Threading.EventWaitHandle:Set <0x0004b>
          at System.Diagnostics.Tracing.EventPipeEventDispatcher:StopDispatchTask <0x0009b>
          at System.Diagnostics.Tracing.EventPipeEventDispatcher:CommitDispatchConfiguration <0x0007b>
          at System.Diagnostics.Tracing.EventPipeEventDispatcher:RemoveEventListener <0x000cb>
          at System.Diagnostics.Tracing.EventListener:RemoveReferencesToListenerInEventSources <0x002eb>
          at System.Diagnostics.Tracing.EventListener:Dispose <0x0010f>
          at <>c:<CooperativeBlockingCanCreateThreadsFaster>b__38_0 <0x0052f>
          at System.Object:runtime_invoke_void__this__ <0x00091>
          at <unknown> <0xffffffff>
          at System.Reflection.RuntimeMethodInfo:InternalInvoke <0x000b9>
          at System.Reflection.RuntimeMethodInfo:InvokeWorker <0x0009f>
          at System.Reflection.RuntimeMethodInfo:Invoke <0x001d3>
          at System.Reflection.MethodBase:Invoke <0x00049>
          at Microsoft.DotNet.RemoteExecutor.Program:Main <0x00313>
          at <Module>:runtime_invoke_int_object <0x00091>
  =================================================================
      System.Threading.ThreadPools.Tests.ThreadPoolTests.CooperativeBlockingCanCreateThreadsFaster [FAIL]
        Exit code was 134 but it should have been 42
        Expected: True
        Actual:   False
        Stack Trace:
          /_/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs(239,0): at Microsoft.DotNet.RemoteExecutor.RemoteInvokeHandle.Dispose(Boolean disposing)
          /_/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs(57,0): at Microsoft.DotNet.RemoteExecutor.RemoteInvokeHandle.Dispose()
          /home/user/runtime/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs(914,0): at System.Threading.ThreadPools.Tests.ThreadPoolTests.CooperativeBlockingCanCreateThreadsFaster()
          /home/user/runtime/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.Mono.cs(386,0): at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
    Finished:    System.Threading.ThreadPool.Tests
@kouvel kouvel added disabled-test The test is disabled in source code against the issue os-linux Linux OS (any supported distro) os-mac-os-x macOS aka OSX area-Tracing-mono labels Mar 18, 2022
@lambdageek lambdageek added this to the 7.0.0 milestone Mar 21, 2022
@lateralusX
Copy link
Member

lateralusX commented Jul 18, 2022

Most likely fixed by #68320. @kouvel is the test still disabled? I couldn't find any reference in the test to this issue anymore. If not, then I guess this issue could be closed.

@lateralusX
Copy link
Member

I run the CooperativeBlockingCanCreateThreadsFaster from ThreadPoolTests.cs test suite. Test runs and pass on OSX x64, so test is no longer disabled and works, closing issue.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tracing-mono disabled-test The test is disabled in source code against the issue os-linux Linux OS (any supported distro) os-mac-os-x macOS aka OSX
Projects
None yet
Development

No branches or pull requests

3 participants