Bug 9419 - Debugger does not switch to breakpoint
Summary: Debugger does not switch to breakpoint
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Reported: 2013-01-09 09:53 UTC by Marek Safar
Modified: 2015-01-07 11:57 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

project (5.58 KB, application/zip)
2013-01-14 11:19 UTC, Marek Safar

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Marek Safar 2013-01-09 09:53:15 UTC
This is for master MT

var dg = DispatchGroup.Create ();
var dq2 = DispatchQueue.GetGlobalQueue (DispatchQueuePriority.Default);

dg.DispatchAsync (dq2, delegate {
	Console.WriteLine ("Inside dispatch");	// Set a breakpoint here if 'waiting' is hit before this line does not break

while (!dg.Wait (DispatchTime.Now)) // DispatchTime.Forever);
      Console.WriteLine ("waiting"); // Set a breakpoint here
Comment 1 Zoltan Varga 2013-01-12 07:53:14 UTC
For me, the 'waiting' bp is hit about 3 times, then the 'Inside dispatch' line gets hit. This is on a simulator.
Comment 2 Marek Safar 2013-01-14 11:16:07 UTC
Tried again today. I can easily reproduce it with master XS and master MT.
Comment 3 Marek Safar 2013-01-14 11:19:00 UTC
Created attachment 3216 [details]

Test project attached
Comment 4 Zoltan Varga 2013-01-14 20:24:03 UTC
I can reproduce this with the latest mt master. The debugger stops. but the stack traces are empty.
Comment 5 Zoltan Varga 2013-01-15 08:28:58 UTC
So what seems to happen is we send a signal to the thread in notify_thread () which goes to pthread_kill () which returns a 45 error code (ENOTSUP). I couldn't find any information about why pthread_kill () would return such an error code. Because of this, we set tls->terminated to TRUE, causing the thread to be ignored during stack trace calculation.

The target thread is trying to lock the loader lock, which is held by the thread which called notify_thread ().
This could be the source of the problem.
Comment 6 Zoltan Varga 2015-01-07 11:57:19 UTC
We are using a different code now on osx/ios which doesn't have this problem anymore.