Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Description
Bug summary
I periodically try the Macosx backend instead of Tkagg since I'd like to display in retina-quality at some point – and it gets a lot farther now than it used to! – but now the problem is that it segfaults when firing aclose_event. Crash report below.
Code for reproduction
importtkinterastk,randomimportmatplotlib,matplotlib.pyplotaspltmatplotlib.use('macosx')#Works ok with tkagggo=Falsedeflaunch():data= []globals()['go']=Truefig,axes=plt.subplots(1)defstop(_):globals()['go']=Falsefig.canvas.mpl_connect('close_event',stop)line,=axes.plot(data,label='Some data',color='#CC0000')fig.canvas.draw_idle()plt.show(block=False)whileglobals()['go']:data+= [random.randint(0,50)foriinrange(20)]tseries=range(0,len(data))line.set_ydata(data)line.set_xdata(tseries)axes.relim()axes.autoscale_view(tight=False)iffig.stale:fig.canvas.draw()fig.canvas.flush_events()#Listen for user inputwindow=tk.Tk()runButton=tk.Button(window,text='Run',command=launch)runButton.pack()window.mainloop()
Actual outcome
Process: Python [4760]
Path: /Library/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python
Identifier: org.python.python
Version: 3.12.3 (3.12.3)
Code Type: X86-64 (Native)
Parent Process: zsh [4326]
Responsible: Electron [460]
User ID: 501
Date/Time: 2024-07-05 16:48:27.2154 -0400
OS Version: macOS 14.5 (23F79)
Report Version: 12
Bridge OS Version: 8.5 (21P5077)
Anonymous UUID: 8A649286-9529-6CA1-264F-F3369F36AB91
Sleep/Wake UUID: 63FCC38F-5F38-475C-8556-B706B4E6CB1D
Time Awake Since Boot: 21000 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000020
Exception Codes: 0x0000000000000001, 0x0000000000000020
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [4760]
VM Region Info: 0x20 is not in any region. Bytes before following region: 4547239904
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 10f096000-10f09a000 [ 16K] r-x/r-x SM=COW /Library/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python
Kernel Triage:
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
Expected outcome
The model should stop on close and be able to be relaunched with the run button, as indeed it does with Tkagg.
Additional information
No response
Operating system
Mac OS 14.5 X86
Matplotlib Version
3.9.1
Matplotlib Backend
Macosx
Python version
3.12.3
Jupyter version
No response
Installation
pip