Recent

Author Topic: SIGSTOP when pausing debugger and ttimer problem  (Read 1149 times)

certsoftor

  • New member
  • *
  • Posts: 8
SIGSTOP when pausing debugger and ttimer problem
« on: December 03, 2020, 06:11:34 am »
Using 2.0.10 on Mojave working on an app compiled for 64 bit Cocoa converted from an old Delphi 5 program. If the program is running and I want to pause I get this popup. Same thing for Dwarf2 and Dwarf with sets. Any ideas?

Also I'm using a ttimer with 250ms interval to poll for network input (just some low rate UDP stuff) and check the DSR line of a USB<->Serial adaptor once per second. Runs find if the program window is visible but if it is completely covered then instead of the ontimer event firing every 250ms it will be many seconds. I've used ttimer for decades and never seen this. Google didn't help.

Preview didn't show my attachment so just in case: http://www.certsoft.com/SIGSTOP.png


trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: SIGSTOP when pausing debugger and ttimer problem
« Reply #1 on: December 03, 2020, 07:32:57 am »
The timer slow down is due to App Nap which was a new power saving feature introduced in Mac OS X 10.9 Mavericks. When an application is completely hidden behind other windows and is not currently executing a task like playing music or checking for email, Mavericks will deem that application to be  "inactive" and put it to sleep to save power and free up your computer’s resources. See this Apple article for the gory details: App Nap.

I'm surprised you've not come across the phenomenon before.

In theory you should be able to avoid app nap with something like:

Code: Pascal  [Select][+][-]
  1. myActivityObj.beginActivityWithOptions_reason(NSActivityUserInitiated or NSActivityLatencyCritical, NSSTR('Good Reason'));

but I never could get it to stop app nap from operating.
« Last Edit: December 03, 2020, 07:43:27 am by trev »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: SIGSTOP when pausing debugger and ttimer problem
« Reply #2 on: December 03, 2020, 02:00:47 pm »
About the error, can you open menu: VIew > Debug windows > Debug output
And after the error copy the content?

Or do a full log https://forum.lazarus.freepascal.org/index.php/topic,42869.0.html

It may be a while until I can look at it. Quite busy, and also will be away for some days.

certsoftor

  • New member
  • *
  • Posts: 8
Re: SIGSTOP when pausing debugger and ttimer problem
« Reply #3 on: December 03, 2020, 07:57:39 pm »
Now that I know what this devious "App Nap" thing is called made searching much more useful. The plist file in the app bundle has the app name as "com.certsoft.SS660" and so doing a "defaults write com.certsoft.SS660 NSAppSleepDisabled -bool YES" seems to have done the trick.

Thanks for the "magic words"

certsoftor

  • New member
  • *
  • Posts: 8
Re: SIGSTOP when pausing debugger and ttimer problem
« Reply #4 on: December 03, 2020, 10:10:02 pm »
About the error, can you open menu: VIew > Debug windows > Debug output
And after the error copy the content?

Or do a full log https://forum.lazarus.freepascal.org/index.php/topic,42869.0.html

It may be a while until I can look at it. Quite busy, and also will be away for some days.

Could it be because I'm using XCode Version 9.4.1? I need to keep using it because some of my projects will actually be running on a 32-bit ARM Linux embedded computer and I do my development on Unix (the Mac) with just a few conditionals for Linux.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: SIGSTOP when pausing debugger and ttimer problem
« Reply #5 on: December 03, 2020, 11:08:55 pm »
I don't have access to all the different X-Code versions.

The message you get is because lldb returned with a message that the IDE did not expect.
That is because it is possible that diff versions of lldb have differences in the text the output for the same event.
So probably the IDE does not know the text returned in your case.

Despite the error, the IDE should still expect lldb to have paused your app. If lldb did, then you can continue, with stepping or running.

 

TinyPortal © 2005-2018