Title: [Bug]: macosx subplot tool causes segfault when window closed · Issue #23653 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: macosx subplot tool causes segfault when window closed · Issue #23653 · matplotlib/matplotlib
X Title: [Bug]: macosx subplot tool causes segfault when window closed · Issue #23653 · matplotlib/matplotlib
Description: Bug summary On current main, clicking on the subplot tool the additional figure pops up and can be interacted with properly, however when clicking the close button the app crashes with a segfault. Possibly trying to release an object tha...
Open Graph Description: Bug summary On current main, clicking on the subplot tool the additional figure pops up and can be interacted with properly, however when clicking the close button the app crashes with a segfault. ...
X Description: Bug summary On current main, clicking on the subplot tool the additional figure pops up and can be interacted with properly, however when clicking the close button the app crashes with a segfault. ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23653
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: macosx subplot tool causes segfault when window closed","articleBody":"### Bug summary\n\nOn current main, clicking on the subplot tool the additional figure pops up and can be interacted with properly, however when clicking the close button the app crashes with a segfault. Possibly trying to release an object that has already been released/garbage collected previously... I can only reproduce this by clicking the subplot button. Manually calling `fig.canvas.toolbar.configure_subplots()` seems to work fine when closing that window. Perhaps we need an explicit retain on the objc side...\r\n\r\nThis was brought about by the change to ARC in #23060. I'm going to put the release critical label on it, because a segfault seems worse than memory leaks. Probably smart to revert #23060 if no one has an immediate fix for it.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\nplt.figure()\r\nplt.show()\n```\n\n\n### Actual outcome\n\nRelevant traceback:\r\n```\r\nException Type: EXC_BAD_ACCESS (SIGSEGV)\r\nException Codes: KERN_INVALID_ADDRESS at 0x0000000000000020\r\nException Codes: 0x0000000000000001, 0x0000000000000020\r\nException Note: EXC_CORPSE_NOTIFY\r\n\r\nTermination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11\r\nTerminating Process: exc handler [42279]\r\n\r\nVM Region Info: 0x20 is not in any region. Bytes before following region: 140737486852064\r\n REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL\r\n UNUSED SPACE AT START\r\n---\u003e \r\n VM_ALLOCATE 7fffffe91000-7fffffe92000 [ 4K] r-x/r-x SM=ALI \r\n\r\nThread 0 Crashed:: Dispatch queue: com.apple.main-thread\r\n0 libobjc.A.dylib \t 0x7ff80c2cd01f objc_release + 31\r\n1 libobjc.A.dylib \t 0x7ff80c2d10da AutoreleasePoolPage::releaseUntil(objc_object**) + 164\r\n2 libobjc.A.dylib \t 0x7ff80c2cdf5f objc_autoreleasePoolPop + 168\r\n3 CoreFoundation \t 0x7ff80c4bfb8a _CFAutoreleasePoolPop + 22\r\n4 Foundation \t 0x7ff80d3334f0 -[NSAutoreleasePool drain] + 133\r\n5 AppKit \t 0x7ff80ef2bf9b -[NSApplication run] + 636\r\n6 _macosx.cpython-310-darwin.so \t 0x1161d13c3 show + 211\r\n```\n\n### Expected outcome\n\nNo segfault\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\nmain\n\n### Matplotlib Backend\n\nmacosx\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\n_No response_","author":{"url":"https://github.com/greglucas","@type":"Person","name":"greglucas"},"datePublished":"2022-08-17T22:13:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/23653/matplotlib/issues/23653"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0f6ee909-b7ce-4e6c-1255-c7953fc7efbc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E326:272982:2744C7:3277FC:6A52EA9F |
| html-safe-nonce | f28d0a66ab7f8679e4433faf99ab51b18f55ce1dfe66d820ddc892aa5737f110 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzI2OjI3Mjk4MjoyNzQ0Qzc6MzI3N0ZDOjZBNTJFQTlGIiwidmlzaXRvcl9pZCI6IjkwMjA0OTUyNzI2ODIzODQwMzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2bd7e4eed7bffb3182e6d135d45266c41d67e0c6216fe5328a9a860f6ba38ba4 |
| hovercard-subject-tag | issue:1342340983 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/23653/issue_layout |
| twitter:image | https://opengraph.githubassets.com/66c3387f75134929024313bbdc852c98040273101bedf01dccfedd642dd753dd/matplotlib/matplotlib/issues/23653 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/66c3387f75134929024313bbdc852c98040273101bedf01dccfedd642dd753dd/matplotlib/matplotlib/issues/23653 |
| og:image:alt | Bug summary On current main, clicking on the subplot tool the additional figure pops up and can be interacted with properly, however when clicking the close button the app crashes with a segfault. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | greglucas |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width