Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Description
Bug summary
Python with the 'TkAgg' backend crashes out when figure windows are moved around between multiple monitors.
How to reproduce
Create a few figures e.g.:
frommatplotlibimportpyplotaspltimportnumpyasnpdeffoo():plt.figure()plt.plot(np.random.randn(1000),np.random.randn(1000),'k.')forninrange(4):foo()plt.show()
Move the figures between windows, rearrange them, swap between desktops, perhaps close the windows and rerun the script and repeat. There is a very high probability that Python will crash.
Actual outcome
IPython crashes with
2017-01-04 13:01:00.136 python[13315:466208] *** Assertion failure in -[_NSCGSWindow setFrame:], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.76/CGS.subproj/NSCGSWindow.m:6632017-01-04 13:01:00.141 python[13315:466208] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: CGRectContainsRect(CGRectMake((CGFloat)INT_MIN, (CGFloat)INT_MIN, (CGFloat)INT_MAX - (CGFloat)INT_MIN, (CGFloat)INT_MAX - (CGFloat)INT_MIN), frame)'*** First throw call stack:(0 CoreFoundation 0x00007fff89111e7b __exceptionPreprocess + 1711 libobjc.A.dylib 0x00007fff9dceccad objc_exception_throw + 482 CoreFoundation 0x00007fff89116b82 +[NSException raise:format:arguments:] + 983 Foundation 0x00007fff8ab60d50 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 1954 AppKit 0x00007fff86d2f519 -[_NSCGSWindow setFrame:] + 2525 AppKit 0x00007fff86dac644 _NXCreateWindowWithStyleMask + 1576 AppKit 0x00007fff86dac4c2 _NSCreateWindow + 1847 AppKit 0x00007fff86df5fe4 -[NSWindow _commonAwake] + 14658 AppKit 0x00007fff874a92d6 -[NSWindow _resolveAutomaticEnterFullScreenFlags] + 519 AppKit 0x00007fff86df58cf -[NSWindow makeKeyAndOrderFront:] + 3110 Tk 0x0000000106761487 XMapWindow + 16411 Tk 0x00000001066d2c9d Tk_MapWindow + 17812 Tk 0x00000001066db3c5 TkInstallFrameMenu + 27113 Tcl 0x000000010664ea57 TclServiceIdle + 7714 Tcl 0x0000000106635619 Tcl_DoOneEvent + 35015 _tkinter.so 0x00000001065ab48d _tkinter_tkapp_mainloop + 44516 libpython3.5m.dylib 0x000000010004ff38 PyCFunction_Call + 28017 libpython3.5m.dylib 0x00000001000bd2df PyEval_EvalFrameEx + 2243118 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177919 libpython3.5m.dylib 0x00000001000c19ae fast_function + 33420 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277221 libpython3.5m.dylib 0x00000001000c192f fast_function + 20722 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277223 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177924 libpython3.5m.dylib 0x00000001000b7b1e PyEval_EvalCodeEx + 7825 libpython3.5m.dylib 0x000000010003430f function_call + 35126 libpython3.5m.dylib 0x000000010000fd73 PyObject_Call + 9927 libpython3.5m.dylib 0x000000010002130d method_call + 14128 libpython3.5m.dylib 0x000000010000fd73 PyObject_Call + 9929 libpython3.5m.dylib 0x0000000100064c55 slot_tp_call + 11730 libpython3.5m.dylib 0x000000010000fd73 PyObject_Call + 9931 libpython3.5m.dylib 0x00000001000bdec8 PyEval_EvalFrameEx + 2548032 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177933 libpython3.5m.dylib 0x00000001000c19ae fast_function + 33434 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277235 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177936 libpython3.5m.dylib 0x00000001000b7ac1 PyEval_EvalCode + 8137 libpython3.5m.dylib 0x00000001000b52ab builtin_exec + 55538 libpython3.5m.dylib 0x000000010004ff38 PyCFunction_Call + 28039 libpython3.5m.dylib 0x00000001000bd2df PyEval_EvalFrameEx + 2243140 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177941 libpython3.5m.dylib 0x00000001000c19ae fast_function + 33442 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277243 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177944 libpython3.5m.dylib 0x00000001000c19ae fast_function + 33445 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277246 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177947 libpython3.5m.dylib 0x00000001000c19ae fast_function + 33448 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277249 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177950 libpython3.5m.dylib 0x00000001000c19ae fast_function + 33451 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277252 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177953 libpython3.5m.dylib 0x00000001000c19ae fast_function + 33454 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277255 libpython3.5m.dylib 0x00000001000c192f fast_function + 20756 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277257 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177958 libpython3.5m.dylib 0x00000001000b7b1e PyEval_EvalCodeEx + 7859 libpython3.5m.dylib 0x000000010003430f function_call + 35160 libpython3.5m.dylib 0x000000010000fd73 PyObject_Call + 9961 libpython3.5m.dylib 0x00000001000bdec8 PyEval_EvalFrameEx + 2548062 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177963 libpython3.5m.dylib 0x00000001000c19ae fast_function + 33464 libpython3.5m.dylib 0x00000001000bd434 PyEval_EvalFrameEx + 2277265 libpython3.5m.dylib 0x00000001000c10c3 _PyEval_EvalCodeWithName + 177966 libpython3.5m.dylib 0x00000001000b7ac1 PyEval_EvalCode + 8167 libpython3.5m.dylib 0x00000001000e6937 PyRun_FileExFlags + 21568 libpython3.5m.dylib 0x00000001000e60ea PyRun_SimpleFileExFlags + 84269 libpython3.5m.dylib 0x00000001000fcc5b Py_Main + 335570 python 0x0000000100000dc7 main + 21571 python 0x0000000100000ce4 start + 5272 ??? 0x0000000000000002 0x0 + 2)libc++abi.dylib: terminating with uncaught exception of type NSExceptionAbort trap: 6
This is the most common form of stack trace, though more terse errors, such as
called Tcl_FindHashEntry on deleted tableAbort trap: 6
may be encountered.
Expected outcome
This kind of crash should not occur when we simply move windows from one monitor to the other.
Matplotlib version
- matplotlib.version = 1.5.3 (installed via miniconda)
- matplotlib.get_backend() == 'TkAgg'
- Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:52:12)
- IPython 5.1.0
- Darwin MacBook-Pro.local 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64