News:

Precision Simulator update 10.195 (15 September 2026) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

Random freezes on MacOS Monterey

Started by Balt, Wed, 19 Jan 2022 23:03

Balt

Since upgrading to Monterey I've noticed when running java applications (to include PSX as well as my own RealTraffic) there are seemingly random display freezes occurring, lasting about 5 seconds.

I've traced this down to the TCC process which is Apple's incredibly (ludicrously!) stupid way of "securing" user data from unsigned applications - TCC seems to scan any unsigned application every time it attempts to access files, and while it is doing the scanning, windowserver freezes.

Some people suggest signing the apps causing problems yourself, however, there doesn't seem to be a straightforward way to do so with java applications.

I have not been able to find a fix for this, posting it here in the hope that Hardy might have any ideas?

Hardy Heinlin

We have discussed this before here somewhere. The problem disappears when you mute the inbuilt Mac speakers by plugging in a headphone :-) (Or by starting PSX with PSX audio off.)

Bizarre, but it works for Enrique and me.

There was one Mac update that fixed it. But they re-introduced the problem. I'm on Big Sur 11.6.

Balt

Very interesting indeed. It doesn't seem linked to sound.

This shows the interruptions experienced in PSX: Graphic on the left shows message timestamps when receiving data from PSX (by RT), the right plot shows the traffic thread in RT which appears unaffected. There are 5 gaps in the left of ~5-6 seconds duration each.

https://www.dropbox.com/s/v19kt527tpw3q2q/Screen%20Shot%202022-01-20%20at%2012.43.21%20.png?dl=0

I'll try the audio off option.

Balt

Fascinating.
Audio off: works
BT headphones with audio on: works
disconnect BT headphones while PSX running with audio on: starts interrupting as soon as BT disconnects.

External BT speaker is the solution for now.

The original report that RealTraffic was also interrupting was a secondary effect from not getting the position data from PSX.

Jeroen Hoppenbrouwers

And now we start to understand why Boeing does not want to PROMISE that their B777 and B787 flight control systems are not affected by radio altimeter jamming.

Balt

Bad news Hardy. The windowserver lockups are back, now with audio turned off in PSX. I don't know what's different now other than having walked away from the computer for a few hours.

I suspect the root cause may indeed have more to do with the TCC daemon rather than with audio. Have a look on your mac, ssh into it, and during a lockup, do a sample of windowserver. You'll see it's TCC locking it up. From what I found elsewhere, TCC scans unsigned apps every time they access the file system (or certain parts thereof). See if you can reproduce that in your dev environment, e.g. skip any file access and see if that stops the lockups?

evaamo

As Hardy commented above, they reintroduced this issue after fixing it in Catalina (10.15.6 IIRC).

After upgrading to Monterey I can indeed confirm this issue is back as of 12.1 at least :-(

In my case it's been always related to built-in audio, the windowserver while remaining in high usage doesn't seem to cause the issue when running PSX. Balt, I will do your test later on and let you know. What JDK are you using? I have updated to JDK 17 and the audio related issues are the same (have also tried JDK 8, 11 and 13, including different flavors of the JDK and of the JIT).

Would be interesting to know if this is an Intel-only issue. Can anyone using an M1 Mac do the test?.

Thanks!
-E
Enrique Vaamonde

Hardy Heinlin

Balt, I have tested the file access theory before. It also freezes while no file access occurs.

When the aircraft is stationary and when there is no audio event and no user action, I can't see any trigger for a file access in my code.

Also, the freeze occurs at random and not in sync with PSX events. Maybe it's related to the garbage collector events in the Java VM?

Balt

Thanks Hardy & E, I've now seen more instances of freezing where TCC does not appear involved - at least not according to the process sampler.

After a reboot and using PSX without audio (i.e. not even trying to switch it on and back off) it runs smoothly again. Very strange.

I've just let it fly zig zag across the US for more than 7 hours, and there was only one ~2.5s stumble, not sure it was a windowserver lockup as I wasn't at the computer, but the data received on the network interface stumbled.

https://www.dropbox.com/s/vlose0jouy329n6/Screen%20Shot%202022-01-21%20at%2008.47.36%20.png?dl=0

If it was the garbage collector, that would have happened far more frequently. Also, I'm not seeing the lockups in RealTraffic (which is also a Java app). I'm running jdk1.8.0_161

Jeroen Hoppenbrouwers

This %@$#%$@ makes you appreciate the existence of realtime operating systems -- with all new @#%$@%$#% that they come with.

Hoppie