-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: macOS backend run by non-logged-in user crashes in Ventura #26292
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
Comments
I'm not sure I completely understand but I can imagine it doesn't make sense to use any gui backend if the user is not logged in and hence has no display. |
The quick fix is for nix to set the For linux we have a helper to detect if we have a usable display and if not, the auto-backend selection falls back to a non-interactive backend. I suspect that something similar is possible for OSX to detect if we have a usable GUI display. I tried to reproduce this by sshing into a mac without being logged in, but that failed in other ways (blocking I think this is a good first issue because it will be adding a private helper function + one or two calls to it in the backend selection logic and/or the backend start up code. Tasks:
I would say this is medium difficulty as it is possible that there is a call in the OSX SDK that just answers this question, but might require research to find it. You will also have to understand the auto backend selection logic. |
Good first issue - notes for new contributorsThis issue is suited to new contributors because it does not require understanding of the Matplotlib internals. To get started, please see our contributing guide. We do not assign issues. Check the Development section in the sidebar for linked pull requests (PRs). If there are none, feel free to start working on it. If there is an open PR, please collaborate on the work by reviewing it rather than duplicating it in a competing PR. If something is unclear, please reach out on any of our communication channels. |
I labeled this as 3.9 to keep it out of our 3.8 wrap up workstream for now. If this ends up being simple no problem in backporting it to 3.8.x . |
Thank you for responding! I cobbled together these reproduction steps on my macOS 13.4.1 M1 machine:
|
Thank you for the reproduction examples but that is not something we can put in the test suite! |
I wonder if we look at the list of screens, it would be empty in this case? |
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).
Code for reproduction
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 the nix 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
The text was updated successfully, but these errors were encountered: