id = 1902 title = "Crash on macOS when screen resolution changes when using SDL UI frontend" state = "opened" created_at = "2023-09-22T19:21:04.697Z" closed_at = "n/a" labels = ["GUI", "kind::Bug"] url = "https://gitlab.com/qemu-project/qemu/-/issues/1902" host-os = "macOS Sonoma" host-arch = "aarch64" qemu-version = "8.1.0" guest-os = "NetBSD" guest-arch = "aarch64" description = """In the above configuration, booting NetBSD works fine up to the point where the kernel sets the framebuffer resolution for the console, which results in a window size change. At this point, the OS terminates the qemu process with this error message: ``` *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow geometry should only be modified on the main thread!' *** First throw call stack: ( \t0 CoreFoundation 0x00000001849208c0 __exceptionPreprocess + 176 \t1 libobjc.A.dylib 0x0000000184419eb4 objc_exception_throw + 60 \t2 CoreFoundation 0x0000000184945bac _CFBundleGetValueForInfoKey + 0 \t3 AppKit 0x00000001880a6ab8 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 240 \t4 AppKit 0x00000001880b2a38 -[NSThemeFrame _tileTitlebarAndRedisplay:] + 88 \t5 AppKit 0x00000001880c18a0 -[NSTitledFrame _titleDidChange] + 116 \t6 AppKit 0x0000000188a92f04 -[NSTitledFrame setTitle:subtitle:] + 420 \t7 AppKit 0x00000001880c1570 -[NSThemeFrame setTitle:] + 52 \t8 AppKit 0x000000018866e0fc -[NSFrameView _updateTitleProperties:animated:] + 44 \t9 AppKit 0x0000000188a85e98 -[NSThemeFrame _updateTitleProperties:animated:] + 156 \t10 CoreFoundation 0x00000001848a0780 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 \t11 CoreFoundation 0x00000001849349a8 ___CFXRegistrationPost_block_invoke + 88 \t12 CoreFoundation 0x00000001849348f0 _CFXRegistrationPost + 440 \t13 CoreFoundation 0x000000018486f434 _CFXNotificationPost + 764 \t14 Foundation 0x0000000185960c74 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88 \t15 AppKit 0x000000018881da88 -[NSWindowTitleController _propertiesChanged:] + 128 \t16 AppKit 0x00000001880c1388 -[NSWindow _dosetTitle:andDefeatWrap:] + 156 \t17 libSDL2-2.0.0.dylib 0x0000000106aa9abc Cocoa_SetWindowTitle + 104 \t18 qemu-system-aarch64 0x0000000105006628 sdl_update_caption + 256 \t19 qemu-system-aarch64 0x0000000105007838 sdl_mouse_mode_change + 168 \t20 qemu-system-aarch64 0x00000001054ab100 notifier_list_notify + 36 \t21 qemu-system-aarch64 0x0000000104d28124 qemu_input_check_mode_change + 96 \t22 qemu-system-aarch64 0x0000000104e13a74 hid_pointer_activate + 32 \t23 qemu-system-aarch64 0x0000000104f44c2c usb_process_one + 464 \t24 qemu-system-aarch64 0x0000000104f4491c usb_handle_packet + 120 \t25 qemu-system-aarch64 0x0000000104f58a94 xhci_kick_epctx + 1888 \t26 qemu-system-aarch64 0x00000001052d8f78 memory_region_write_accessor + 264 \t27 qemu-system-aarch64 0x00000001052d8db8 access_with_adjusted_size + 348 \t28 qemu-system-aarch64 0x00000001052d8c04 memory_region_dispatch_write + 428 \t29 qemu-system-aarch64 0x00000001052e6cfc flatview_write_continue + 344 \t30 qemu-system-aarch64 0x00000001052e4068 flatview_write + 156 \t31 qemu-system-aarch64 0x00000001052e9424 subpage_write + 124 \t32 qemu-system-aarch64 0x00000001052d8db8 access_with_adjusted_size + 348 \t33 qemu-system-aarch64 0x00000001052d8c04 memory_region_dispatch_write + 428 \t34 qemu-system-aarch64 0x000000010532ebf4 io_writex + 184 \t35 qemu-system-aarch64 0x000000010532ed44 do_st_mmio_leN + 104 \t36 qemu-system-aarch64 0x0000000105323e78 do_st4_mmu + 536 \t37 ??? 0x0000000108a91750 0x0 + 4440266576 \t38 qemu-system-aarch64 0x00000001053108f0 cpu_tb_exec + 164 \t39 qemu-system-aarch64 0x0000000105311754 cpu_exec_loop + 1084 \t40 qemu-system-aarch64 0x0000000105310edc cpu_exec_setjmp + 48 \t41 qemu-system-aarch64 0x0000000105310dcc cpu_exec + 560 \t42 qemu-system-aarch64 0x0000000105332650 tcg_cpus_exec + 44 \t43 qemu-system-aarch64 0x0000000105332c1c mttcg_cpu_thread_fn + 240 \t44 qemu-system-aarch64 0x00000001054a7494 qemu_thread_start + 128 \t45 libsystem_pthread.dylib 0x00000001847cf034 _pthread_start + 136 \t46 libsystem_pthread.dylib 0x00000001847c9e3c thread_start + 8 ) libc++abi: terminating due to uncaught exception of type NSException ``` I think there have been other bugs of a similar nature in the past with the Cocoa UI. The regression may be because of stricter checks in the new macOS version.""" reproduce = """1. Start qemu (the QEMU_EFI.fd is from Tianocore EDK2). 2. Wait for the NetBSD kernel to set framebuffer resolution and observe the crash. With `-nographic`, the problem does not occur.""" additional = "n/a"