Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AltTab hangs when launched from the Applications folder on Ventura beta 5 #1852

Closed
zacharee opened this issue Aug 9, 2022 · 49 comments
Closed
Labels
apple silicon Apple Silicon (e.g. M1) specific issue bug Something isn't working macOS 13 macOS 13 Ventura specific issue unactionable Further action is not possible due to lack of information or support

Comments

@zacharee
Copy link
Contributor

zacharee commented Aug 9, 2022

Describe the bug

I updated to Ventura beta 5 today on my M1 Pro MBP and noticed that AltTab was hanging on launch.

After playing around with building my own version, I noticed that when run from the Applications folder it hangs. Otherwise (with the debug version that doesn't move itself to /Applications) it runs fine.

Steps to reproduce the bug

  1. Update to Ventura beta 5 on an M1 Mac.
  2. Try opening AltTab from the Applications folder and notice it hangs.
  3. Try opening a debug version of AltTab from the Applications folder and notice it hangs.
  4. Try opening a debug version of AltTab from elsewhere and notice it has no issues.

Note: I built my debug version with Xcode 14.0 beta 5.

@zacharee zacharee added the bug Something isn't working label Aug 9, 2022
@lwouis
Copy link
Owner

lwouis commented Aug 9, 2022

Could you better describe what you mean by "hanging"? Does it spins with high CPU?

If you can build it locally, could you then launch it in debug mode locally? You could then pause the debug and see where the execution is spending cycles or where it's blocking.

Alternatively, a spin dump from Activity Monitor would help diagnose the issue.

@zacharee
Copy link
Contributor Author

zacharee commented Aug 9, 2022

Could you better describe what you mean by "hanging"? Does it spins with high CPU?

If you can build it locally, could you then launch it in debug mode locally? You could then pause the debug and see where the execution is spending cycles or where it's blocking.

Alternatively, a spin dump from Activity Monitor would help diagnose the issue.

As soon as it launches, it's marked as "not responding" in Activity Monitor. The menu bar icon consistently appears and the settings window occasionally appears but will have a beach ball of death. CPU usage is low.

The problem is that it only hangs if the .app is in /Applications. If I do a direct launch from AppCode there are no issues.

I can't seem to launch the debug executable inside /Applications through the terminal to get a log, either. It doesn't see it has screen recording permissions.

Here's a spindump:

Spindump.txt

@zacharee
Copy link
Contributor Author

zacharee commented Aug 9, 2022

Even weirder: now the debug app only successfully launches if it's run through AppCode. Double-clicking in Finder causes it to hang no matter where the file is located.

@lwouis lwouis added apple silicon Apple Silicon (e.g. M1) specific issue macOS 13 macOS 13 Ventura specific issue labels Aug 9, 2022
@lwouis
Copy link
Owner

lwouis commented Aug 9, 2022

I can't seem to launch the debug executable inside /Applications through the terminal to get a log, either. It doesn't see it has screen recording permissions.

I think it will work if you give the permissions to Terminal.app. Could you try that?

Here's a spindump

It's a bit unclear what the main thread is blocking on. It seems to be some internals from Apple, not code from AltTab. It could indicate a regression in macOS. After all AltTab works on the previous macOS version, and the one you're on is a beta, so that's possibly the root cause here.

@zacharee
Copy link
Contributor Author

zacharee commented Aug 9, 2022

That let me launch it through the terminal. This is the log:

zachary@zacharyMBP MacOS % ./AltTab 
"Current space" 1
"Adding app" 171 "com.apple.loginwindow"
"Adding app" 450 "com.apple.systemuiserver"
"Adding app" 446 "com.apple.dock"
"Adding app" 447 "com.apple.backgroundtaskmanagement.agent"
"Adding app" 449 "com.apple.controlcenter"
"Adding app" 455 "com.apple.WindowManager"
"Adding app" 445 "com.apple.talagent"
"Adding app" 451 "com.apple.finder"
"Adding app" 496 "com.apple.Spotlight"
"Adding app" 477 "com.apple.CoreLocationAgent"
"Adding app" 528 "com.google.Chrome"
"Adding app" 564 "com.apple.TextInputMenuAgent"
"Adding app" 527 "com.apple.notificationcenterui"
"Adding app" 555 "com.apple.AirPlayUIAgent"
"Adding app" 541 "com.apple.Siri"
"Adding app" 581 "com.apple.coreservices.uiagent"
"Adding app" 504 "com.apple.wifi.WiFiAgent"
"Adding app" 580 "com.apple.TextInputSwitcher"
"Adding app" 584 "com.BlueBubbles.BlueBubbles-Server"
"Adding app" 601 "com.microsoft.OneDrive"
"Adding app" 740 "com.spotify.client"
"Adding app" 741 "com.crowdcafe.windowmagnet"
"Adding app" 743 "com.IdeaPunch.ColorSlurp"
"Adding app" 744 "ai.krisp.krispMac"
"Adding app" 579 "com.teamviewer.Desktop"
"Adding app" 614 "com.apple.AppSSOAgent"
"Adding app" 553 "com.logi.cp-dev-mgr"
"Adding app" 746 "com.surteesstudios.Bartender"
"Adding app" 693 "com.apple.universalcontrol"
"Adding app" 550 "com.paragon-software.extfs.notification-agent"
"Adding app" 732 "com.google.chromeremotedesktop.me2me-host"
"Adding app" 538 "com.teamviewer.TeamViewer"
"Adding app" 729 "com.apple.security.Keychain-Circle-Notification"
"Adding app" 767 "com.google.drivefs"
"Adding app" 838 "com.apple.MobileSMS"
"Adding app" 847 "com.apple.SoftwareUpdateNotificationManager"
"Adding app" 881 "com.apple.locationmenu"
"Adding app" 1096 "com.hnc.Discord"
"Adding app" 1201 "com.apple.ActivityMonitor"
"Adding app" 1353 "com.apple.LocalAuthentication.UIAgent"
"Adding app" 1369 "com.apple.accessibility.universalAccessAuthWarn"
"Adding app" 2523 "com.apple.OSDUIHelper"
"Adding app" 3526 "ru.keepcoder.Telegram"
"Adding app" 4290 "com.apple.storeuid"
"Adding app" 4935 "com.apple.UserNotificationCenter"
"Adding app" 8993 "com.jetbrains.AppCode"
"Adding app" 9747 "com.apple.Family"
"Adding app" 10542 "com.apple.PowerChime"
"Adding app" 11831 "com.readdle.smartemail-Mac"
"Adding app" 13584 "com.apple.systempreferences"
"Adding app" 13623 "com.apple.Terminal"
"Adding app" 13943 "com.lwouis.alt-tab-macos"
2022-08-09 16:18:49.224 AltTab[13943:159378] It's not legal to call -layoutSubtreeIfNeeded on a view which is already being laid out.  If you are implementing the view's -layout method, you can call -[super layout] instead. Break on void _NSDetectedLayoutRecursion(void) to debug.  This will be logged only once.  This may break in the future.

@zacharee
Copy link
Contributor Author

zacharee commented Aug 9, 2022

Also, AltTab worked fine on beta 4, so whatever changed happened very recently.

@aliosmanyuksel
Copy link

I've that problem. I upgraded to macOS Ventura Beta 5 today. It has working to beta 4.

@aliosmanyuksel
Copy link

aliosmanyuksel commented Aug 9, 2022

Screenshot

@Write
Copy link

Write commented Aug 9, 2022

Same here :) on Beta 5

@dalsvk
Copy link

dalsvk commented Aug 10, 2022

Also, AltTab worked fine on beta 4, so whatever changed happened very recently.

can confirm, this has been driving me crazy

@bradhs
Copy link

bradhs commented Aug 10, 2022

Same problem. Upgraded to Beta 5 and now AltTab is stuck as Not Responding.

@bradhs
Copy link

bradhs commented Aug 10, 2022

2022-08-09 22:48:38.563 AltTab[3654:40136] It's not legal to call -layoutSubtreeIfNeeded on a view which is already being laid out. If you are implementing the view's -layout method, you can call -[super layout] instead. Break on void _NSDetectedLayoutRecursion(void) to debug. This will be logged only once. This may break in the future.

@GitSparTV
Copy link

Same for MacBookPro16,1 on Ventura Public Beta 3

@MalwarePup
Copy link

MalwarePup commented Aug 10, 2022

Same for MacBookPro 14 on Ventura Public Beta 3

@lwouis
Copy link
Owner

lwouis commented Aug 10, 2022

Could anyone here follow the error message and put a breakpoint on void _NSDetectedLayoutRecursion(void)? I don't have a VM with Ventura beta 5, so I can't reproduce this. On my Catalina machine, and my other VMs, I don't get this warning when running AltTab.

@aliosmanyuksel
Copy link

I can't build this project. If you wanna connect to me via AnyDesk or Teamviewer, i can send my connection code. @lwouis
mail: [email protected]

error

@samdenty
Copy link
Contributor

getting this as well, can do a teamviewer too if needed

@Write
Copy link

Write commented Aug 10, 2022

Could anyone here follow the error message and put a breakpoint on void _NSDetectedLayoutRecursion(void)? I don't have a VM with Ventura beta 5, so I can't reproduce this. On my Catalina machine, and my other VMs, I don't get this warning when running AltTab.

Could you use https://github.com/insidegui/VirtualBuddy ?

@zacharee
Copy link
Contributor Author

I'm not quite sure how to set a breakpoint on that function. I've tried [void _NSDetectedLayoutRecursion] and without brackets in AppCode's symbolic breakpoints menu but they don't catch it.

@Write
Copy link

Write commented Aug 10, 2022

I'm willing to help too, I have a VM Running beta 5, with anydesk, brew, and latest xcode installed.
EDIT : @lwouis I sent you all the details of the VM, feel free to connect it to at any time, I'll try to keep it running.

@elijahchan2019
Copy link

Same here. It seems like apple has changed some SDKs.

@Ashinch
Copy link

Ashinch commented Aug 11, 2022

I'm in Venture Beta 5 and can accept any test request

@lwouis
Copy link
Owner

lwouis commented Aug 11, 2022

I was able to connect @Write's Ventura VM, and try and debug the issue. Thank you again @Write for trusting me to use your VM 👍

I could reach the symbolic breaking by breaking on _NSDetectedLayoutRecursion:

image

However, it's pretty useful as it doesn't show which specific window or view is generating the log/issue.

I tried to manually remove the preferences window, feedback window, main window, etc, to try and guess where the issue is coming from, but I can't deduce anything.

Furthermore, I tried to google various pieces of the error message from Apple, but nothing comes up that's relevant.

I'm afraid my time is limited (please see #1179), so I'll wait until Ventura is out of beta to give it a second look.

@lwouis lwouis added the unactionable Further action is not possible due to lack of information or support label Aug 11, 2022
@Write
Copy link

Write commented Aug 11, 2022

I don't have any macOS coding knowledge, but I tried to look for what makes the app crash at launch, it seems to be in this function and has nothing to do with _NSDetectedLayoutRecursion since the error message is shown whether this line is commented out or not. But the app actually run when I comment out Applications.list.append(Application($0))

Screenshot du 2022-08-11 à 19 19 37

EDIT : Guessing you already saw that so I'm certainly making you lose your time, I'm sorry.

EDIT 2 : I managed to make it compile & work with an ugly """fix"" (don't know any side-effect, except, my guess is AltTab won't show itself when AltTabing). It always crashed when AltTab was adding itself to the list of apps.
Screenshot du 2022-08-11 à 19 48 03

A video of AltTab somewhat working on Beta 5: https://share.socialspill.com/w/5890bb78635279715c3dc7b814ff3082

@zaper4life
Copy link

Hi,
I don't know if it counts as a solution, but it works for me,
Remove altTab from your login items,
Start your machine.
After a few minutes, usually around 10 for me, start altTab,
All is good now.

@lilbillybiscuit
Copy link

lilbillybiscuit commented Aug 12, 2022

Hi,
I don't know if it counts as a solution, but it works for me,
Remove altTab from your login items,
Start your machine.
After a few minutes, usually around 10 for me, start altTab,
All is good now.

This workaround worked for me too, but I didn't have to restart my machine.

@bradhs
Copy link

bradhs commented Aug 12, 2022

Hi, I don't know if it counts as a solution, but it works for me, Remove altTab from your login items, Start your machine. After a few minutes, usually around 10 for me, start altTab, All is good now.

Did not work for me.

@dalsvk
Copy link

dalsvk commented Aug 12, 2022

Hi, I don't know if it counts as a solution, but it works for me, Remove altTab from your login items, Start your machine. After a few minutes, usually around 10 for me, start altTab, All is good now.

Did not work for me.

yup, same

@Write
Copy link

Write commented Aug 12, 2022

I don't have any macOS coding knowledge, but I tried to look for what makes the app crash at launch, it seems to be in this function and has nothing to do with _NSDetectedLayoutRecursion since the error message is shown whether this line is commented out or not. But the app actually run when I comment out Applications.list.append(Application($0))

Screenshot du 2022-08-11 à 19 19 37

EDIT : Guessing you already saw that so I'm certainly making you lose your time, I'm sorry.

EDIT 2 : I managed to make it compile & work with an ugly """fix"" (don't know any side-effect, except, my guess is AltTab won't show itself when AltTabing). It always crashed when AltTab was adding itself to the list of apps. Screenshot du 2022-08-11 à 19 48 03

A video of AltTab somewhat working on Beta 5: https://share.socialspill.com/w/5890bb78635279715c3dc7b814ff3082

Here's a debug build with my ugly fix, I think it'll only run on ARM and you'll certainly have to remove / re-add AltTab permissions manually. Please do not run it if you don't trust me.

AltTab.zip Link removed, please use this link instead.

@dalsvk
Copy link

dalsvk commented Aug 12, 2022

I don't have any macOS coding knowledge, but I tried to look for what makes the app crash at launch, it seems to be in this function and has nothing to do with _NSDetectedLayoutRecursion since the error message is shown whether this line is commented out or not. But the app actually run when I comment out Applications.list.append(Application($0))
Screenshot du 2022-08-11 à 19 19 37
EDIT : Guessing you already saw that so I'm certainly making you lose your time, I'm sorry.
EDIT 2 : I managed to make it compile & work with an ugly """fix"" (don't know any side-effect, except, my guess is AltTab won't show itself when AltTabing). It always crashed when AltTab was adding itself to the list of apps. Screenshot du 2022-08-11 à 19 48 03
A video of AltTab somewhat working on Beta 5: https://share.socialspill.com/w/5890bb78635279715c3dc7b814ff3082

Here's a debug build with my ugly fix, I think it'll only run on ARM and you'll certainly have to remove / re-add AltTab permissions manually. Please do not run it if you don't trust me.

AltTab.zip

tysm, it's working perfectly fine for me

@adamfeldman
Copy link

As a workaround, running from the Downloads folder is working great for me. It's a login item as well. Am on the latest release (6.46.1).

FWIW I'm a new user as of yesterday.

@lwouis
Copy link
Owner

lwouis commented Aug 12, 2022

@Write this is very interesting. You narrowed the issue down to AltTab monitoring AltTab itself.

We had people complain in the past that AltTab's windows (preferences, feedback form, auto-update window) don't show up in AltTab. So I added it. We could remove that, if it's making the app unusable on Ventura, but I can't imagine why it's crashing, especially since it's been working on like 5 major macOS releases.

What I'll do is that if this issue persists when the beta is over, and Ventura goes live, then I'll consider some kind of workaround. I may dig deeper then also, and find a fix that doesn't involve blacklisting AltTab.

@ccarpiog
Copy link

I don't have any macOS coding knowledge, but I tried to look for what makes the app crash at launch, it seems to be in this function and has nothing to do with _NSDetectedLayoutRecursion since the error message is shown whether this line is commented out or not. But the app actually run when I comment out Applications.list.append(Application($0))
Screenshot du 2022-08-11 à 19 19 37
EDIT : Guessing you already saw that so I'm certainly making you lose your time, I'm sorry.
EDIT 2 : I managed to make it compile & work with an ugly """fix"" (don't know any side-effect, except, my guess is AltTab won't show itself when AltTabing). It always crashed when AltTab was adding itself to the list of apps. Screenshot du 2022-08-11 à 19 48 03
A video of AltTab somewhat working on Beta 5: https://share.socialspill.com/w/5890bb78635279715c3dc7b814ff3082

Here's a debug build with my ugly fix, I think it'll only run on ARM and you'll certainly have to remove / re-add AltTab permissions manually. Please do not run it if you don't trust me.

AltTab.zip

Mmm... I'm getting a "AltTab.app is damaged and can't be opened" when trying to run you version. Strange.

@dalsvk
Copy link

dalsvk commented Aug 14, 2022

I don't have any macOS coding knowledge, but I tried to look for what makes the app crash at launch, it seems to be in this function and has nothing to do with _NSDetectedLayoutRecursion since the error message is shown whether this line is commented out or not. But the app actually run when I comment out Applications.list.append(Application($0))
Screenshot du 2022-08-11 à 19 19 37
EDIT : Guessing you already saw that so I'm certainly making you lose your time, I'm sorry.
EDIT 2 : I managed to make it compile & work with an ugly """fix"" (don't know any side-effect, except, my guess is AltTab won't show itself when AltTabing). It always crashed when AltTab was adding itself to the list of apps. Screenshot du 2022-08-11 à 19 48 03
A video of AltTab somewhat working on Beta 5: https://share.socialspill.com/w/5890bb78635279715c3dc7b814ff3082

Here's a debug build with my ugly fix, I think it'll only run on ARM and you'll certainly have to remove / re-add AltTab permissions manually. Please do not run it if you don't trust me.
AltTab.zip

Mmm... I'm getting a "AltTab.app is damaged and can't be opened" when trying to run you version. Strange.

You need to remove quarantine
xattr -d -r com.apple.quarantine
and followed by the application path (just drag and drop the application)

@ccarpiog
Copy link

I don't have any macOS coding knowledge, but I tried to look for what makes the app crash at launch, it seems to be in this function and has nothing to do with _NSDetectedLayoutRecursion since the error message is shown whether this line is commented out or not. But the app actually run when I comment out Applications.list.append(Application($0))
Screenshot du 2022-08-11 à 19 19 37
EDIT : Guessing you already saw that so I'm certainly making you lose your time, I'm sorry.
EDIT 2 : I managed to make it compile & work with an ugly """fix"" (don't know any side-effect, except, my guess is AltTab won't show itself when AltTabing). It always crashed when AltTab was adding itself to the list of apps. Screenshot du 2022-08-11 à 19 48 03
A video of AltTab somewhat working on Beta 5: https://share.socialspill.com/w/5890bb78635279715c3dc7b814ff3082

Here's a debug build with my ugly fix, I think it'll only run on ARM and you'll certainly have to remove / re-add AltTab permissions manually. Please do not run it if you don't trust me.
AltTab.zip

Mmm... I'm getting a "AltTab.app is damaged and can't be opened" when trying to run you version. Strange.

You need to remove quarantine xattr -d -r com.apple.quarantine and followed by the application path (just drag and drop the application)

Thanks, it worked.

@yans-8
Copy link

yans-8 commented Aug 14, 2022

Running AltTab from the application on desktop (just not in Applications) seems to work for me on Ventura beta 5 on the latest version 6.46.1 in case anyone facing this issue wants to try to tide them over.

@zacharee
Copy link
Contributor Author

I have a PR up that lets AltTab still show its own windows while working around the freeze: #1865.

You can either pull the repo and merge in that PR to build yourself or you can download the prebuilt debug app: https://github.com/lwouis/alt-tab-macos/files/9334145/AltTab.app.zip.

If you use the debug app, you'll need to run sudo xattr -cr /path/to/AltTab.app in a terminal before you can open it.

@Write
Copy link

Write commented Aug 14, 2022

I have a PR up that lets AltTab still show its own windows while working around the freeze: #1865.

You can either pull the repo and merge in that PR to build yourself or you can download the prebuilt debug app: https://github.com/lwouis/alt-tab-macos/files/9334145/AltTab.app.zip.

If you use the debug app, you'll need to run sudo xattr -cr /path/to/AltTab.app in a terminal before you can open it.

Thanks, as such, I removed the link to my build, and replaced it with a link to your message instead.

@elijahchan2019
Copy link

I have a PR up that lets AltTab still show its own windows while working around the freeze: #1865.

You can either pull the repo and merge in that PR to build yourself or you can download the prebuilt debug app: https://github.com/lwouis/alt-tab-macos/files/9334145/AltTab.app.zip.

If you use the debug app, you'll need to run sudo xattr -cr /path/to/AltTab.app in a terminal before you can open it.

It worked perfectly.

@mrsnakeoil
Copy link

I have a PR up that lets AltTab still show its own windows while working around the freeze: #1865.

You can either pull the repo and merge in that PR to build yourself or you can download the prebuilt debug app: https://github.com/lwouis/alt-tab-macos/files/9334145/AltTab.app.zip.

If you use the debug app, you'll need to run sudo xattr -cr /path/to/AltTab.app in a terminal before you can open it.

Happy to state this worked for me. Many thanks @zacharee for the work and especially for the build. Saving me time.

Ventura beta 13.0 (22A5321d)

@KevinXC5
Copy link

I have a PR up that lets AltTab still show its own windows while working around the freeze: #1865.

You can either pull the repo and merge in that PR to build yourself or you can download the prebuilt debug app: https://github.com/lwouis/alt-tab-macos/files/9334145/AltTab.app.zip.

If you use the debug app, you'll need to run sudo xattr -cr /path/to/AltTab.app in a terminal before you can open it.

Can you help compile an Intel chip version package? Thank you very much!

@lwouis
Copy link
Owner

lwouis commented Aug 23, 2022

@KevinXC5 the build i shared on the PR should be universal.

@KevinXC5
Copy link

@KevinXC5 the build i shared on the PR should be universal.
it can work, thks

@andylin2004
Copy link

Seems to still be an issue on macOS Ventura beta 6

@bradhs
Copy link

bradhs commented Aug 26, 2022

This is the only build that will work: #1865 (comment)

@ifsheldon
Copy link

Beta 7 works well with the original 6.46.1 on my M1 Mac. So I guess the previous problem was macOS's internal bug.

@lwouis
Copy link
Owner

lwouis commented Sep 10, 2022

@ifsheldon that's great news. It may mean that we won't need to do any patch to AltTab to work on Ventura, in the future.

@yusoofsh
Copy link

Could confirm with 13.0 Beta (22A5342f), this issue is fixed without a patch.

@lwouis
Copy link
Owner

lwouis commented Oct 14, 2022

Closing as Apple fixed their regression.

@lwouis lwouis closed this as completed Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apple silicon Apple Silicon (e.g. M1) specific issue bug Something isn't working macOS 13 macOS 13 Ventura specific issue unactionable Further action is not possible due to lack of information or support
Projects
None yet
Development

No branches or pull requests