Simple Mac ProgressIndicator causes crash: "caught causing excessive wakeups"

6

I have this Button click handler (MonoMac on OS X 10.9.3):

partial void OnDoButtonClick(NSObject sender)
{
    DoButton.Enabled = false;

    // Start animation
    ProgressIndicator.StartAnimation(this);

    ThreadPool.QueueUserWorkItem(_ => {

        // Perform a task that last for about a second:
        Thread.Sleep(1 * 1000);

        // Stop animation:
        InvokeOnMainThread(() => {
            ProgressIndicator.StopAnimation(this);
            DoButton.Enabled = true;
        });
    });
}

However, when i run the code by pressing the button, the main thread stops the following error occurs:

(lldb) quit* thread #1: tid = 0x2bf20, 0x98fd9f7a libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP

And, the following log is recorded in the system log:

2014/05/21 13:10:51.752 com.apple.debugserver-310.2[3553]: 1 +0.000001 sec [0de1/1503]: error: ::read ( 0, 0x107557a40, 1024 ) => -1 err = Connection reset by peer (0x00000036)
2014/05/21 13:10:51.752 com.apple.debugserver-310.2[3553]: 2 +0.000001 sec [0de1/0303]: error: ::ptrace (request = PT_THUPDATE, pid = 0x0ddc, tid = 0x1a03, signal = -1) err = Invalid argument (0x00000016)
2014/05/21 13:10:51.753 com.apple.debugserver-310.2[3553]: Exiting.
2014/05/21 13:11:05.000 kernel[0]: process <AppName>[3548] caught causing excessive wakeups. Observed wakeups rate (per sec): 1513; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45061
2014/05/21 13:11:05.302 ReportCrash[3555]: Invoking spindump for pid=3548 wakeups_rate=1513 duration=30 because of excessive wakeups
2014/05/21 13:11:07.452 spindump[3556]: Saved wakeups_resource.spin report for <AppName> version 1.2.1.0 (1) to /Library/Logs/DiagnosticReports/<AppName>_2014-05-21-131107_<UserName>-MacBook-Pro.wakeups_resource.spin

Extract from above: Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45061

The problem does NOT happen if I remove the ProgressIndicator.StartAnimation(this); and ProgressIndicator.StopAnimation(this); lines.

Why is the main thread stopped by SIGSTOP?

multithreading
cocoa
osx-mavericks
monomac
asked on Stack Overflow May 21, 2014 by M.Soma • edited May 23, 2014 by M.Soma

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0