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

trace output when focusing/unfocusing #2730

Closed
ChristopherBiscardi opened this issue Mar 11, 2023 · 8 comments
Closed

trace output when focusing/unfocusing #2730

ChristopherBiscardi opened this issue Mar 11, 2023 · 8 comments
Labels
B - bug Dang, that shouldn't have happened DS - macos

Comments

@ChristopherBiscardi
Copy link

On a machine with macos Ventura 13.2.1 (22D68), any application that uses winit produces a trace like this when focusing or unfocusing a window. I first noticed this in my Bevy game and the Bevy examples before confirming it also happens in the winit example in this repo.

It doesn't seem to affect the running program as far as I can tell, but is very noisy in the console and I can't figure out how to disable the output.

1   HIToolbox                           0x00000001b8162d4c _ZN15MenuBarInstance21IsAutoShowHideAllowedEv + 284
2   HIToolbox                           0x00000001b803c230 _ZN15MenuBarInstance24UpdateAutoShowVisibilityE5Pointh + 40
3   HIToolbox                           0x00000001b7fa930c _ZN15MenuBarInstance16ForEachMenuBarDoEU13block_pointerFvPS_E + 72
4   HIToolbox                           0x00000001b803c8a0 _ZN15MenuBarInstance20AutoShowHideObserverEjP14OpaqueEventRefPv + 216
5   HIToolbox                           0x00000001b7f9fcd0 _NotifyEventLoopObservers + 176
6   HIToolbox                           0x00000001b7fd3bb0 PostEventToQueueInternal + 696
7   HIToolbox                           0x00000001b7fd5340 _ZL29CreateAndPostEventWithCGEventP9__CGEventjhP17__CFMachPortBoost + 460
8   HIToolbox                           0x00000001b7fe1c28 _ZL15Convert1CGEventh + 264
9   HIToolbox                           0x00000001b7fe1ab0 _ZL16MainLoopObserverjP14OpaqueEventRefPv + 56
10  HIToolbox                           0x00000001b7f9fcd0 _NotifyEventLoopObservers + 176
11  HIToolbox                           0x00000001b7fc7f60 RunCurrentEventLoopInMode + 228
12  HIToolbox                           0x00000001b7fc7c30 ReceiveNextEventCommon + 236
13  HIToolbox                           0x00000001b7fc7b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
14  AppKit                              0x00000001b1b6d84c _DPSNextEvent + 632
15  AppKit                              0x00000001b1b6c9dc -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
16  AppKit                              0x00000001b1b60e0c -[NSApplication run] + 464
17  window                              0x00000001026d8aa8 _ZN61_$LT$$LP$$RP$$u20$as$u20$objc2..message..MessageArguments$GT$8__invoke17h91ebd089c3bd3626E + 64
18  window                              0x00000001026d9ad0 _ZN5objc27message8platform15send_unverified28_$u7b$$u7b$closure$u7d$$u7d$17hf344f5e33163c46cE + 40
19  window                              0x00000001026d87fc _ZN5objc27message15conditional_try17hf73f2593dd8e1751E + 40
20  window                              0x00000001026d8fc8 _ZN5objc27message8platform15send_unverified17h34d26d65013b7cb0E + 72
21  window                              0x000000010266eeec _ZN5objc27message15MessageReceiver12send_message17hce923e2457412259E + 112
22  window                              0x00000001026b99d8 _ZN5winit13platform_impl8platform6appkit11application13NSApplication3run17hf8fb3880b1fe2dcbE + 76
23  window                              0x0000000102656d48 _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$10run_return28_$u7b$$u7b$closure$u7d$$u7d$17h7c132b5d68a0e5f6E + 364
24  window                              0x000000010265d554 _ZN5objc22rc11autorelease15autoreleasepool17h557197b48fea9040E + 132
25  window                              0x0000000102656b7c _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$10run_return17hd228c358e7b30f11E + 296
26  window                              0x0000000102656f04 _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$3run17h4ad230ddfbfc7df4E + 36
27  window                              0x00000001026598d0 _ZN81_$LT$winit..event_loop..EventLoop$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hdc3ee671c2e24b62E + 0
28  window                              0x00000001026573fc _ZN6window4main17hdc5806338b92f314E + 460
29  window                              0x0000000102658580 _ZN4core3ops8function6FnOnce9call_once17hfc2e70ee94e5e25eE + 20
30  window                              0x0000000102657a60 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h5f8cc57e32e220faE + 24
31  window                              0x000000010265b434 _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hef49eca8852a1becE + 28
32  window                              0x00000001027005d0 _ZN3std2rt19lang_start_internal17h9f0566e553deb11eE + 648
33  window                              0x000000010265b400 _ZN3std2rt10lang_start17h8db0f81836a31d26E + 84
34  window                              0x000000010265743c main + 36
35  dyld                                0x00000001ae4dfe50 start + 2544
1   HIToolbox                           0x00000001b7fc790c _ZN15MenuBarInstance22RemoveAutoShowObserverEv + 44
2   HIToolbox                           0x00000001b7fdf214 SetMenuBarObscured + 120
3   HIToolbox                           0x00000001b7fe6390 _ZN13HIApplication11FrontUILostEv + 44
4   HIToolbox                           0x00000001b7fdf04c _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 528
5   HIToolbox                           0x00000001b7fd8f70 _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 204
6   HIToolbox                           0x00000001b7f9fcd0 _NotifyEventLoopObservers + 176
7   HIToolbox                           0x00000001b7fd896c AcquireEventFromQueue + 432
8   HIToolbox                           0x00000001b7fc7c84 ReceiveNextEventCommon + 320
9   HIToolbox                           0x00000001b7fc7b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
10  AppKit                              0x00000001b1b6d84c _DPSNextEvent + 632
11  AppKit                              0x00000001b1b6c9dc -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
12  AppKit                              0x00000001b1b60e0c -[NSApplication run] + 464
13  window                              0x00000001026d8aa8 _ZN61_$LT$$LP$$RP$$u20$as$u20$objc2..message..MessageArguments$GT$8__invoke17h91ebd089c3bd3626E + 64
14  window                              0x00000001026d9ad0 _ZN5objc27message8platform15send_unverified28_$u7b$$u7b$closure$u7d$$u7d$17hf344f5e33163c46cE + 40
15  window                              0x00000001026d87fc _ZN5objc27message15conditional_try17hf73f2593dd8e1751E + 40
16  window                              0x00000001026d8fc8 _ZN5objc27message8platform15send_unverified17h34d26d65013b7cb0E + 72
17  window                              0x000000010266eeec _ZN5objc27message15MessageReceiver12send_message17hce923e2457412259E + 112
18  window                              0x00000001026b99d8 _ZN5winit13platform_impl8platform6appkit11application13NSApplication3run17hf8fb3880b1fe2dcbE + 76
19  window                              0x0000000102656d48 _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$10run_return28_$u7b$$u7b$closure$u7d$$u7d$17h7c132b5d68a0e5f6E + 364
20  window                              0x000000010265d554 _ZN5objc22rc11autorelease15autoreleasepool17h557197b48fea9040E + 132
21  window                              0x0000000102656b7c _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$10run_return17hd228c358e7b30f11E + 296
22  window                              0x0000000102656f04 _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$3run17h4ad230ddfbfc7df4E + 36
23  window                              0x00000001026598d0 _ZN81_$LT$winit..event_loop..EventLoop$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hdc3ee671c2e24b62E + 0
24  window                              0x00000001026573fc _ZN6window4main17hdc5806338b92f314E + 460
25  window                              0x0000000102658580 _ZN4core3ops8function6FnOnce9call_once17hfc2e70ee94e5e25eE + 20
26  window                              0x0000000102657a60 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h5f8cc57e32e220faE + 24
27  window                              0x000000010265b434 _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hef49eca8852a1becE + 28
28  window                              0x00000001027005d0 _ZN3std2rt19lang_start_internal17h9f0566e553deb11eE + 648
29  window                              0x000000010265b400 _ZN3std2rt10lang_start17h8db0f81836a31d26E + 84
30  window                              0x000000010265743c main + 36
31  dyld                                0x00000001ae4dfe50 start + 2544
56 }) }
@kchibisov
Copy link
Member

Which winit version have you tried?

@ChristopherBiscardi
Copy link
Author

versions:

with Bevy, in git examples and separate project: 0.28.2
commit b18295a
commit 3217eaa

@kchibisov
Copy link
Member

cc @madsmtm we had the same with alacritty btw for some users.

@terran42
Copy link

terran42 commented Mar 25, 2023

I'm facing the same issue. When my system auto-hides the menu bar, this call stack appears. However, when I turn off the auto-hide menu bar option in system settings, the call stack disappears. I'm using macOS 13.2 M1.

After further research, it appears that this issue is a known bug in the operating system. Here are some related links:

@kchibisov
Copy link
Member

Could someone bisect winit? Or at least try the commits touching objc2 dependency?

@terran42
Copy link

If it's an OS problem, bisecting winit won't help. We just have to wait for Apple to fix it in a new OS version, If I understand correctly.

@kchibisov
Copy link
Member

It could be winit updating to objc2 causing issues along the line, we never had such issue with old winit in alacritty fro example and the users don't have traces of that.

@madsmtm madsmtm added the B - bug Dang, that shouldn't have happened label Jun 2, 2023
@madsmtm
Copy link
Member

madsmtm commented Aug 24, 2023

The issues linked in #2730 (comment) show that this was fixed in Ventura 13.3.1 (and have tested myself that the bug is not present in 13.5).

@madsmtm madsmtm closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - macos
Development

No branches or pull requests

4 participants