Strange: KBM engine keeps turning off

Hello,
This problem never happened before: KBM engine keeps turning off spontaneously. I notice it because my usual KBM shortcuts no longer work. I have to goto KBM and turn the engine back on
I don’t know how to even start troubleshooting this issue.
thank you

Hey @ronald,

What macros have you created / edited recently?

Have you done something recently that could be crashing the engine?

Have you installed any other software in this timeframe?

Have you tried quitting and restarting the Keyboard Maestro Editor and Engine?

Have you tried rebooting?

-Chris

1 Like

thank you for your suggestions.
I will have to review my macros and recently installed apps.
I did quit both the engine and KBM and rebooted the computer.

I have seen an increase in crash reports for a small number of people, mostly in 10.13, and I suspect also related to sleeping/waking. It looks to be some sort of memory corruption, but I don’t know where or even if it is in my code or the system code.

I have not been able to reproduce the problem here, even with 10.13 and sleep/wakes, so there is something else involved as well, but I don’t know what.

I had a development build of Keyboard Maestro Engine that tries to detect the memory corruptions, but so far I have had no reports of any success in that identifying the issue.

I’m sorry I don’t have a better answer currently.

If it can be narrowed down to anything in particular, that would help tremendously. Whether that “anything” is third party software, specific Mac details, particular actions, particular triggers, specific Keyboard Maestro facilities, or whatever, it would definitely help (even if it just helped me duplicate it).

1 Like

Thank you Peter.
I deleted a few little apps which probably have nothing to do with the problem
Now that you mention it, it would seem that it always happens after the computer wakes up.
I will keep my eyes open.
Let’s keep in mind that you had only a few reports of the problem, and I am the #1 bungler in this forum, so the problem is most likely on my side than yours.
The only tidbit of information I can think of now is that I never solved the problem of the migrating global palette and had to move all macros to other palettes which I call up when needed. Just in case the combination of a moving palette and the engine shutting down point to a similar cause.

I also experience this problem of the engine quitting.
10.13.4 and 8.2
Not on the computer I work at but on 2 co-workers computers.
The editor will be running but the engine has to be re-launched.
They don’t know how to quit the engine so I’m sure it’s not them quitting it.

1 Like

Yes, there is no doubt that on some people’s Mac, something that Keyboard Maestro is doing or using is corrupting memory and leading to a crash.

Unfortunately, I have no leads on what the culprit might be.

Because it is a memory corruption, the crash comes at some later time and in completely unrelated code, making it hard to track down what the problem might be.

1 Like

I do have a beta build with a bunch of Apple Address Sanitiser stuff built in, if you want to try that to see if a more useful crash report results, email support@stairways.com.

1 Like

As a short term solution, a customer provided the following script which you can run in a cron job every couple minutes to relaunch the Keyboard Maestro Engine if it crashes. It’s certainly not ideal, but I don’t have anything better to offer currently.

#!/bin/bash
if pgrep "Keyboard Maestro Engine"; then
    echo 'No worries, Keyboard Maestro Engine is running.';
else
    osascript -e 'display notification "Attempted relaunching.  Please check that Keyboard Maestro Engine launched." with title "Keyboard Maestro Engine has Crashed"'
    open /Applications/Keyboard\ Maestro.app/Contents/MacOS/Keyboard\ Maestro\ Engine.app; 
fi
1 Like

It’s really a minor issue, once a week. I will just wait. Thanks for the offer.
Happened only once this week, after both waking up from sleep and having to login

Hello Peter,
Using the last edition of Sierra, and KBM 8.2.1, the frequency of crashes (engine stops but usually KBM still active) seems to have markedly increased.
It used to be approx 1 a week, now nearly once a day.
Not dramatic. Just wanted you to know.
Seems (?) to be related to computer waking up
thanks

Sierra or High Sierra?

Yes, I am seeing an annoying number of crashes of Keyboard Maestro Engine in High Sierra (10.13.x). It is very frustrating as all I have is that there is some sort of memory corruption and I don't know where (I don't even know if it is my code or system code that is causing the corruption). It seems far more prevalent on 10.13.x - in fact almost all crash reports I receive are for 10.13. Considering roughly 20% of Keyboard Maestro users still use 10.12, the crash rate in 10.13 is very much out of proportion to the users.

The previous release (8.2.1) and likely the next release (when it eventually comes) contain a multitude of “fixes” that are attempts to guess where the issue might be and adjust the code or add assertions that might indicate something, but because the crash does not happen until some time later I have very little in the way of useful data to work on - basically the crashlogs are more indicative of what Keyboard Maestro spends its time doing than what is related to the crash.

And yes, it is extremely frustrating as I am generally very proud of the low bug and crash rate in Keyboard Maestro, and this one bug (which may not even be in my code!) is causing a very unacceptable deviation from that.

Latest version of Sierra, not high Sierra.
As far as I am concerned it takes nothing away from your outstanding app.
I am sure that the problem is on the Apple side

If it is Sierra, you can email me the crash reports and I'll take a look just to confirm it looks to be the same issue and not something else. There are probably a few “needle” crashes in amongst the haystack of 10.13/Memory corruption crashes.

Perhaps related, I've recently (maybe last 2-3 weeks or so) been experiencing the Theme Editor freezing. All the controls move and change but the palette doesn't reflect any change. For awhile I was quitting and restarting KM which worked until I discovered that just closing and reopening the Theme Editor window got things working again.

Running 10.13.4 with KM 8.2.1

I doubt its related, but if you can find any way to duplicate it, I would be happy to hear it.

I have found a procedure that (not always but most of the time) causes the KM macros to stop working. If I open a palette (I have one that shows all the global macros I use to launch applications, and another that shows all the macros that open files or folders), then close that palette (almost all the time) KM macros no longer work. I am able to regain proper operation either by rebooting my computer or by using the menubar KM icon to "Quit Keyboard Maestro Engine," then opening and closing the Keyboard Editor.

To avoid this problem, I have made screenshots of both palettes and pasted them into a PDF file on my desktop that I consult when I forget one of my triggers.

My computer is running High Sierra (v.10.13.4) and I am using KM v.8.2.1

If you can do that, then the Keyboard Maestro Engine has not crashed. So if the macros are not working, you should use the Keyboard Maestro Help ➤ Assistance window, and select Something expected is not happening and see what you can learn.

Did this ever get figured out? I'm having it now with Big Sur 11.1 on an M1 MacBook Air.

The script seems to be working so far, but I'd rather a real fix here.