This is a follow-up to my previous question: Function keys stop working after a while in Mojave

The issue I had is that loginwindow kept freezing. In this Gist, the issue is explained in detail. The explanation can be found below.

macOS Mojave build >18A326g has a nasty issue.

Basically, loginwindow likes threads. It's so passionate about threads that
it will continue to collect threads endlessly. Now, the problem with such a
process collecting so many threads is that, as the owner of all processes
running under your account, if the process crashes, say goodbye to most of

Well, this is exactly what happens. loginwindow freezes at 4096 threads and
causes most of macOS to become unstable or unusable. For example, most of the
menu items under the apple menu become useless, such as About This Mac or the
Sleep/Restart/Shut Down options. Some of the function/media keys stop working
as well, such as the brightness, keyboard backlight, and volume keys.

I also believe the log out option gets disabled too, but I haven't tested it.
However, if this is indeed the case, this means the only way to log out
reliably is using this script with the --kill option, which finds and kills
loginwindow for you.

loginwindow does indeed collect 4096 threads and then freeze. Every time. In fact, I built a notifier using JXA to warn me when corruption (threads / 4096) reaches over 90%.

That's beside the point, however. As far as I can tell, nobody else has the issue (either that or they never figured out why).

I've reported this issue to Apple 4 betas ago, but the issue's still here.

How do I figure out what's causing this issue? How do I prevent it?

  • I'd try a new admin account & see if it still happens. My current uptime is 6 days [never gets much past that these days with a new beta every week;) & loginwindow is showing just 2 threads; so my guess is it's not System per se, it's something else you have running. – Tetsujin Sep 11 '18 at 6:41
  • Huh... I'll try a new account. – Dev Sep 11 '18 at 7:59
  • @Tetsujin I can confirm it's system-wide, just logged in via root and the issue persists. (threads are already at 9 as soon as I log in!) – Dev Sep 11 '18 at 8:04
  • Sorry, still can't repro on b10. 2 threads only. It has to be something you have installed; maybe test safe boot. – Tetsujin Sep 13 '18 at 7:53
  • This sounds very similar to issues I've been having. It occurs for me after I've let the computer sit for a while, usually overnight. I've been trying lots of debugging, but still haven't figured out a root cause, although I did find that booting the computer into Safe Mode prevented the issue. I'll keep an eye on loginwindow and see if that's what causing my issue as well. – hisaac Sep 13 '18 at 12:55

I know the StackExchange community tends to hate these kinds of answers, but I don't know exactly what fixed my issue.

loginwindow is now ending threads correctly. That is to say, at some point it had less threads than before, and it's hovering around 2-3.

I messed around with kexts and LaunchDaemons. I uninstalled certain things, like Karabiner Elements, and Camtasia's audio driver. I disabled certain startup items, like SIMBL. But I don't know exactly what fixed the issue.

If anyone else with this issue has any of this same software, I'd recommend trying to disable some in /Library/LaunchDaemons. (/Library/Extensions for kexts)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .