Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug summary
When the macOS backend is used to draw a figure in Ventura (I am on 13.4.1), it crashes with an XPC misuse error when it is run from a non-root and non-logged-in user (from what I can tell).
...Crashed Thread: 0 Dispatch queue: com.apple.main-threadException Type: EXC_BREAKPOINT (SIGTRAP)Exception Codes: 0x0000000000000001, 0x0000000181f5db40Termination Reason: Namespace SIGNAL, Code 5 Trace/BPT trap: 5Terminating Process: exc handler [35989]Application Specific Signatures:API MisuseThread 0 Crashed:: Dispatch queue: com.apple.main-thread0 libxpc.dylib 0x181f5db40 _xpc_api_misuse + 921 libxpc.dylib 0x181f3fb2c xpc_connection_set_target_uid + 2162 WindowManagement 0x208de9cf0 -[WMClientWindowManager _createXPCConnection] + 9683 WindowManagement 0x208dea630 -[WMClientWindowManager _xpcConnection] + 1724 WindowManagement 0x208de83f0 -[WMClientWindowManager stages] + 845 AppKit 0x185e5e568 __54-[NSWMWindowCoordinator initializeStageFramesIfNeeded]_block_invoke + 326 libdispatch.dylib 0x18204c400 _dispatch_client_callout + 207 libdispatch.dylib 0x18204dc40 _dispatch_once_callout + 328 AppKit 0x185e5e514 -[NSWMWindowCoordinator initializeStageFramesIfNeeded] + 3049 AppKit 0x18550b278 -[NSWindow _commonInitFrame:styleMask:backing:defer:] + 66010 AppKit 0x18550ac50 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 68411 AppKit 0x18550a998 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 4812 ??? 0x118de0980 -[Window initWithContentRect:styleMask:backing:defer:withManager:] + 6813 ??? 0x118de3f74 FigureManager_init + 24014 ??? 0x101106744 wrap_init + 2015 ??? 0x1010a735c wrapperdescr_call + 39216 ??? 0x10109e400 _PyObject_MakeTpCall + 360...
Code for reproduction
N/A
Actual outcome
N/A
Expected outcome
N/A
Additional information
The most common place I have seen this is when a module consuming matplotlib draws figures in its tests without specifying a backend. When that module is built by thenix package manager, the build is performed by a non-root, non-logged-in user, triggering this crash.
I do not think there is anything actionable here but wanted to open an issue to help anyone else who runs into this. Perhaps detection is possible during backend selection, but it's not entirely obvious to me how to do it robustly. If the team agrees, we can close this issue.
Operating system
macOS 13.4.1
Matplotlib Version
3.7.1
Matplotlib Backend
macosx
Python version
3.10.11
Jupyter version
No response
Installation
None