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

[macOS - Ventura] native exception when un-maximizing window #117663

Closed
tvolkert opened this issue Dec 26, 2022 · 15 comments
Closed

[macOS - Ventura] native exception when un-maximizing window #117663

tvolkert opened this issue Dec 26, 2022 · 15 comments
Labels
a: desktop Running on desktop c: crash Stack traces logged to the console e: OS-version specific Affects only some versions of the relevant operating system engine flutter/engine repository. See also e: labels. found in release: 3.7 Found to occur in 3.7 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-mac Building on or for macOS specifically

Comments

@tvolkert
Copy link
Contributor

Steps to reproduce

  1. Run the following app in macOS (flutter run -d macos). Note the actual content of the app doesn't matter.
    void main() {
      runApp(const ColoredBox(color: Color(0xffff0000)));
    }
  2. Maximize the app by hitting the green button in the window trim
  3. Restore the window to its normal size by either hitting the green button again or hitting the escape key on the keyboard

Expected results

You expect nothing out of the ordinary to happen.

Actual results

The following native stack trace shows up in the console:

1   HIToolbox                           0x00000001a71585c8 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 120
2   HIToolbox                           0x00000001a7158188 _ZN15MenuBarInstance14EnableAutoShowEv + 60
3   HIToolbox                           0x00000001a70c58bc _ZN15MenuBarInstance21UpdateAggregateUIModeE21MenuBarAnimationStylehhh + 1184
4   HIToolbox                           0x00000001a7158004 _ZN15MenuBarInstance19SetFullScreenUIModeEjj + 180
5   AppKit                              0x00000001a0f4e008 -[NSApplication _setPresentationOptions:instance:flags:] + 956
6   AppKit                              0x00000001a0de3bb0 -[NSApplication _updateFullScreenPresentationOptionsForInstance:] + 404
7   CoreFoundation                      0x000000019da05570 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
8   CoreFoundation                      0x000000019daa3054 ___CFXRegistrationPost_block_invoke + 88
9   CoreFoundation                      0x000000019daa2f9c _CFXRegistrationPost + 440
10  CoreFoundation                      0x000000019d9d6b74 _CFXNotificationPost + 708
11  Foundation                          0x000000019e8c472c -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
12  AppKit                              0x00000001a0f4e58c spacesNotificationHandler + 96
13  SkyLight                            0x00000001a26384dc _ZN12_GLOBAL__N_123notify_datagram_handlerEj15CGSDatagramTypePvmS1_ + 896
14  SkyLight                            0x00000001a29644c4 _ZN21CGSDatagramReadStream26dispatchMainQueueDatagramsEv + 228
15  SkyLight                            0x00000001a29643c0 ___ZN21CGSDatagramReadStream15mainQueueWakeupEv_block_invoke + 28
16  libdispatch.dylib                   0x000000019d7a89dc _dispatch_call_block_and_release + 32
17  libdispatch.dylib                   0x000000019d7aa504 _dispatch_client_callout + 20
18  libdispatch.dylib                   0x000000019d7b8d1c _dispatch_main_queue_drain + 928
19  libdispatch.dylib                   0x000000019d7b896c _dispatch_main_queue_callback_4CF + 44
20  CoreFoundation                      0x000000019da51d50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
21  CoreFoundation                      0x000000019da0f7d0 __CFRunLoopRun + 2036
22  CoreFoundation                      0x000000019da0e888 CFRunLoopRunSpecific + 612
23  HIToolbox                           0x00000001a70e3fa0 RunCurrentEventLoopInMode + 292
24  HIToolbox                           0x00000001a70e3de4 ReceiveNextEventCommon + 672
25  HIToolbox                           0x00000001a70e3b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
26  AppKit                              0x00000001a0c90424 _DPSNextEvent + 632
27  AppKit                              0x00000001a0c8f5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
28  AppKit                              0x00000001a0c839e4 -[NSApplication run] + 464
29  AppKit                              0x00000001a0c5ae28 NSApplicationMain + 880
30  effect                              0x00000001021a7988 main + 12
31  dyld                                0x000000019d607e50 start + 2544
1   HIToolbox                           0x00000001a70e390c _ZN15MenuBarInstance22RemoveAutoShowObserverEv + 44
2   HIToolbox                           0x00000001a7158fbc _ZN15MenuBarInstance15DisableAutoShowEv + 36
3   HIToolbox                           0x00000001a71590b0 _ZN15MenuBarInstanceD2Ev + 128
4   HIToolbox                           0x00000001a7158ee0 _ZN15MenuBarInstance7ReleaseEv + 56
5   AppKit                              0x00000001a12eb5ec -[NSHIPresentationInstance discard] + 228
6   AppKit                              0x00000001a16aab58 -[_NSFullScreenSpace(PresentationInstance) discardPresentationInstance] + 32
7   AppKit                              0x00000001a16aabb0 -[_NSFullScreenSpace(PresentationInstance) activateFullScreenPresentationOptions] + 64
8   AppKit                              0x00000001a1504c20 -[_NSExitFullScreenTransitionController _doSucceededToExitFullScreen] + 40
9   AppKit                              0x00000001a15056f8 __63-[_NSExitFullScreenTransitionController _performExitFullScreen]_block_invoke + 236
10  libxpc.dylib                        0x000000019d6a222c _xpc_connection_reply_callout + 124
11  libxpc.dylib                        0x000000019d6a211c _xpc_connection_call_reply_async + 88
12  libdispatch.dylib                   0x000000019d7aa584 _dispatch_client_callout3 + 20
13  libdispatch.dylib                   0x000000019d7c8710 _dispatch_mach_msg_async_reply_invoke + 344
14  libdispatch.dylib                   0x000000019d7b8c70 _dispatch_main_queue_drain + 756
15  libdispatch.dylib                   0x000000019d7b896c _dispatch_main_queue_callback_4CF + 44
16  CoreFoundation                      0x000000019da51d50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
17  CoreFoundation                      0x000000019da0f7d0 __CFRunLoopRun + 2036
18  CoreFoundation                      0x000000019da0e888 CFRunLoopRunSpecific + 612
19  HIToolbox                           0x00000001a70e3fa0 RunCurrentEventLoopInMode + 292
20  HIToolbox                           0x00000001a70e3de4 ReceiveNextEventCommon + 672
21  HIToolbox                           0x00000001a70e3b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
22  AppKit                              0x00000001a0c90424 _DPSNextEvent + 632
23  AppKit                              0x00000001a0c8f5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
24  AppKit                              0x00000001a0c839e4 -[NSApplication run] + 464
25  AppKit                              0x00000001a0c5ae28 NSApplicationMain + 880
26  effect                              0x00000001021a7988 main + 12
27  dyld                                0x000000019d607e50 start + 2544

Flutter version

[✓] Flutter (Channel master, 3.7.0-13.0.pre.50, on macOS 13.1 22C65 darwin-arm64, locale en)
    • Flutter version 3.7.0-13.0.pre.50 on channel master at /Users/tvolkert/project/flutter/flutter
    • Framework revision daa2ecf165 (4 days ago), 2022-12-22 19:13:41 -0500
    • Engine revision ca0c843bf7
    • Dart version 3.0.0 (build 3.0.0-59.0.dev)
    • DevTools version 2.20.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
@tvolkert tvolkert added c: crash Stack traces logged to the console engine flutter/engine repository. See also e: labels. platform-mac Building on or for macOS specifically a: desktop Running on desktop P2 Important issues not at the top of the work list labels Dec 26, 2022
@divan
Copy link

divan commented Dec 30, 2022

Same here. Having these stacktraces for all MacOS app (debug mode, haven't tested release) when focusing or defocuing window (basically, switching between Flutter app and others)

1   HIToolbox                           0x00000001ad3a790c _ZN15MenuBarInstance22RemoveAutoShowObserverEv + 44
2   HIToolbox                           0x00000001ad3bf214 SetMenuBarObscured + 120
3   HIToolbox                           0x00000001ad3c6390 _ZN13HIApplication11FrontUILostEv + 44
4   HIToolbox                           0x00000001ad3bf04c _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 528
5   HIToolbox                           0x00000001ad3b8f70 _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 204
6   HIToolbox                           0x00000001ad37fcd0 _NotifyEventLoopObservers + 176
7   HIToolbox                           0x00000001ad3b896c AcquireEventFromQueue + 432
8   HIToolbox                           0x00000001ad3a7e0c ReceiveNextEventCommon + 712
9   HIToolbox                           0x00000001ad3a7b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
10  AppKit                              0x00000001a6f54424 _DPSNextEvent + 632
11  AppKit                              0x00000001a6f535b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
12  AppKit                              0x00000001a6f479e4 -[NSApplication run] + 464
13  AppKit                              0x00000001a6f1ee28 NSApplicationMain + 880
14  app                                 0x000000010451f744 main + 12
15  dyld                                0x00000001a38cbe50 start + 2544

@gspencergoog
Copy link
Contributor

cc @a-wallen

@spydon
Copy link

spydon commented Jan 10, 2023

Same here on latest stable:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.1 22C65 darwin-arm, locale en-SE)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

@divan
Copy link

divan commented Jan 19, 2023

Any ideas on how mitigate it or if it's being investigated?
I use MacOS native build as a default development case (faster and simpler than debug with emulators or real devices), so this bug makes reading debug output almost unusable as it pollutes the output on every switch.

@bleroux
Copy link
Contributor

bleroux commented Jan 19, 2023

@divan Can you confirm you see this on MacOS Ventura? I can't repro this issue on Monterey (12.6).

@Innovaitec0
Copy link

I have the same Issue with all of my Projects after upgrading to MacOS Ventura.

@bleroux bleroux changed the title [macOS] native exception when un-maximizing window [macOS - Ventura] native exception when un-maximizing window Jan 19, 2023
@bleroux bleroux added e: OS-version specific Affects only some versions of the relevant operating system has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.7 Found to occur in 3.7 labels Jan 19, 2023
@bleroux
Copy link
Contributor

bleroux commented Jan 19, 2023

This issue is not specific to Flutter (it was reported too for other UI toolkits, see links above for similar reports on Electron and TKinter).

The following stackoverflow answer might help mitigate this issue while waiting for a fix: https://stackoverflow.com/questions/74609260/r-warnings-errors-in-a-fresh-install

@Innovaitec0
Copy link

Workaround works for me. Thanks!

@gspencergoog
Copy link
Contributor

Closing this, as it doesn't appear to be Flutter specific. (Desktop Triage)

@divan
Copy link

divan commented Jan 19, 2023

@bleroux thank you! That worked!

To save others' time of clicking the link above - this issue is related to the "Hide Menubar" option in MacOS Settings. (Settings -> Desktop & Dock -> Automatically hide and show the menu bar)

Values "In Full Screen Only" or "Never" show stop this output.

Screenshot 2023-01-20 at 00 54 54

@tvolkert
Copy link
Contributor Author

So we're saying this is likely going to be fixed in a future OS update?

@bleroux
Copy link
Contributor

bleroux commented Feb 23, 2023

This issue is still repro on Ventura 13.2.1.

Similar reports on various UI toolkits:

@ollyde
Copy link

ollyde commented Mar 1, 2023

For those who always hide the menu bar to reduce clutter and don't use full screen mode, you can set a filter in VSC.

Screenshot 2023-03-01 at 11 19 08

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2023
@bleroux
Copy link
Contributor

bleroux commented Apr 19, 2023

Good news, this issue was fixed by Apple on Ventura 13.3.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: desktop Running on desktop c: crash Stack traces logged to the console e: OS-version specific Affects only some versions of the relevant operating system engine flutter/engine repository. See also e: labels. found in release: 3.7 Found to occur in 3.7 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-mac Building on or for macOS specifically
Projects
None yet
Development

No branches or pull requests

7 participants