Issue: NSWindow drag regions should only be invalidated on the Main Thread!

Hey guys,

I am currently building a streamlit app which relies on plotly.
Everything ran fine and suddenly, this morning, when I executed the code, this error message was raised.

Does anyone have any idea what could be the reason for it?

Best,
Jo

2022-04-08 15:49:37.111 python3.7[2940:56437] WARNING: NSWindow drag regions should only be invalidated on the Main Thread! This will throw an exception in the future. Called from (
	0   AppKit                              0x00007ff80593b6e3 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 352
	1   AppKit                              0x00007ff805927674 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1288
	2   AppKit                              0x00007ff805927166 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42
	3   libtk8.6.dylib                      0x000000013a80d2c2 TkMacOSXMakeRealWindowExist + 754
	4   libtk8.6.dylib                      0x000000013a80ce11 TkWmMapWindow + 81
	5   libtk8.6.dylib                      0x000000013a751d6c Tk_MapWindow + 204
	6   libtk8.6.dylib                      0x000000013a75bc41 MapFrame + 65
	7   libtcl8.6.dylib                     0x000000013a2b1966 TclServiceIdle + 134
	8   libtcl8.6.dylib                     0x000000013a28fd31 Tcl_DoOneEvent + 401
	9   libtk8.6.dylib                      0x000000013a7fdd7e TkpInit + 766
	10  libtk8.6.dylib                      0x000000013a753740 Initialize + 2704
	11  _tkinter.cpython-37m-darwin.so      0x00000001387bab1e Tkapp_New + 894
	12  _tkinter.cpython-37m-darwin.so      0x00000001387ba65a _tkinter_create + 298
	13  python3.7                           0x00000001047f6f86 _PyMethodDef_RawFastCallKeywords + 230
	14  python3.7                           0x000000010492540b call_function + 251
	15  python3.7                           0x000000010491d97a _PyEval_EvalFrameDefault + 21370
	16  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	17  python3.7                           0x00000001047f5daf _PyFunction_FastCallDict + 239
	18  python3.7                           0x0000000104872175 slot_tp_init + 181
	19  python3.7                           0x0000000104878e06 type_call + 246
	20  python3.7                           0x00000001047f697f _PyObject_FastCallKeywords + 175
	21  python3.7                           0x00000001049254db call_function + 459
	22  python3.7                           0x000000010491e583 _PyEval_EvalFrameDefault + 24451
	23  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	24  python3.7                           0x00000001047f5daf _PyFunction_FastCallDict + 239
	25  python3.7                           0x0000000104872175 slot_tp_init + 181
	26  python3.7                           0x0000000104878e06 type_call + 246
	27  python3.7                           0x00000001047f697f _PyObject_FastCallKeywords + 175
	28  python3.7                           0x00000001049254db call_function + 459
	29  python3.7                           0x000000010491e583 _PyEval_EvalFrameDefault + 24451
	30  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	31  python3.7                           0x00000001049253c7 call_function + 183
	32  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	33  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	34  python3.7                           0x00000001047f6e68 _PyFunction_FastCallKeywords + 200
	35  python3.7                           0x00000001049253c7 call_function + 183
	36  python3.7                           0x000000010491d97a _PyEval_EvalFrameDefault + 21370
	37  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	38  python3.7                           0x0000000104911dce builtin_exec + 350
	39  python3.7                           0x00000001047f6f86 _PyMethodDef_RawFastCallKeywords + 230
	40  python3.7                           0x000000010492540b call_function + 251
	41  python3.7                           0x000000010491e583 _PyEval_EvalFrameDefault + 24451
	42  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	43  python3.7                           0x00000001049253c7 call_function + 183
	44  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	45  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	46  python3.7                           0x00000001047f97ba method_call + 122
	47  python3.7                           0x00000001047f756f PyObject_Call + 127
	48  python3.7                           0x000000010491d0e5 _PyEval_EvalFrameDefault + 19173
	49  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	50  python3.7                           0x00000001049253c7 call_function + 183
	51  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	52  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	53  python3.7                           0x00000001049253c7 call_function + 183
	54  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	55  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	56  python3.7                           0x00000001047f97ba method_call + 122
	57  python3.7                           0x00000001047f756f PyObject_Call + 127
	58  python3.7                           0x0000000104a0aade t_bootstrap + 174
	59  python3.7                           0x0000000104991704 pythread_wrapper + 36
	60  libsystem_pthread.dylib             0x00007ff802ef14e1 _pthread_start + 125
	61  libsystem_pthread.dylib             0x00007ff802eecf6b thread_start + 15
)
2022-04-08 15:49:37.169 python3.7[2940:56437] *** Assertion failure in -[NSMenuItem initWithTitle:action:keyEquivalent:], NSMenuItem.m:477
2022-04-08 15:49:37.173 python3.7[2940:56437] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: aString != nil'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007ff8030327fb __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007ff802d93e58 objc_exception_throw + 48
	2   Foundation                          0x00007ff803e0cc23 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 267
	3   AppKit                              0x00007ff8059067e9 -[NSMenuItem initWithTitle:action:keyEquivalent:] + 363
	4   libtk8.6.dylib                      0x000000013a805607 +[NSMenuItem(TKUtils) itemWithSubmenu:] + 71
	5   libtk8.6.dylib                      0x000000013a801381 -[TKApplication(TKMenu) tkSetMainMenu:] + 257
	6   libtk8.6.dylib                      0x000000013a802a3b TkpSetMainMenubar + 171
	7   libtk8.6.dylib                      0x000000013a7640e9 TkSetWindowMenuBar + 1241
	8   libtk8.6.dylib                      0x000000013a75c3de ConfigureFrame + 286
	9   libtk8.6.dylib                      0x000000013a75bf25 FrameWidgetObjCmd + 597
	10  libtcl8.6.dylib                     0x000000013a1d00d2 Tcl_EvalObjv + 370
	11  _tkinter.cpython-37m-darwin.so      0x00000001387b5728 Tkapp_Call + 200
	12  python3.7                           0x00000001047f7001 _PyMethodDef_RawFastCallKeywords + 353
	13  python3.7                           0x0000000104802ed4 _PyMethodDescr_FastCallKeywords + 84
	14  python3.7                           0x00000001049254cb call_function + 443
	15  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	16  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	17  python3.7                           0x00000001049253c7 call_function + 183
	18  python3.7                           0x000000010491d97a _PyEval_EvalFrameDefault + 21370
	19  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	20  python3.7                           0x00000001047f6e68 _PyFunction_FastCallKeywords + 200
	21  python3.7                           0x00000001049253c7 call_function + 183
	22  python3.7                           0x00000001049199fa _PyEval_EvalFrameDefault + 5114
	23  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	24  python3.7                           0x00000001047f6e68 _PyFunction_FastCallKeywords + 200
	25  python3.7                           0x00000001049253c7 call_function + 183
	26  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	27  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	28  python3.7                           0x00000001047f5daf _PyFunction_FastCallDict + 239
	29  python3.7                           0x0000000104872175 slot_tp_init + 181
	30  python3.7                           0x0000000104878e06 type_call + 246
	31  python3.7                           0x00000001047f697f _PyObject_FastCallKeywords + 175
	32  python3.7                           0x00000001049254db call_function + 459
	33  python3.7                           0x000000010491e583 _PyEval_EvalFrameDefault + 24451
	34  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	35  python3.7                           0x00000001049253c7 call_function + 183
	36  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	37  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	38  python3.7                           0x00000001047f6e68 _PyFunction_FastCallKeywords + 200
	39  python3.7                           0x00000001049253c7 call_function + 183
	40  python3.7                           0x000000010491d97a _PyEval_EvalFrameDefault + 21370
	41  python3.7                           0x0000000104916ee7 _PyEval_EvalCodeWithName + 535
	42  python3.7                           0x0000000104911dce builtin_exec + 350
	43  python3.7                           0x00000001047f6f86 _PyMethodDef_RawFastCallKeywords + 230
	44  python3.7                           0x000000010492540b call_function + 251
	45  python3.7                           0x000000010491e583 _PyEval_EvalFrameDefault + 24451
	46  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	47  python3.7                           0x00000001049253c7 call_function + 183
	48  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	49  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	50  python3.7                           0x00000001047f97ba method_call + 122
	51  python3.7                           0x00000001047f756f PyObject_Call + 127
	52  python3.7                           0x000000010491d0e5 _PyEval_EvalFrameDefault + 19173
	53  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	54  python3.7                           0x00000001049253c7 call_function + 183
	55  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	56  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	57  python3.7                           0x00000001049253c7 call_function + 183
	58  python3.7                           0x000000010491cb97 _PyEval_EvalFrameDefault + 17815
	59  python3.7                           0x00000001047f6751 function_code_fastcall + 145
	60  python3.7                           0x00000001047f97ba method_call + 122
	61  python3.7                           0x00000001047f756f PyObject_Call + 127
	62  python3.7                           0x0000000104a0aade t_bootstrap + 174
	63  python3.7                           0x0000000104991704 pythread_wrapper + 36
	64  libsystem_pthread.dylib             0x00007ff802ef14e1 _pthread_start + 125
	65  libsystem_pthread.dylib             0x00007ff802eecf6b thread_start + 15
)
libc++abi: terminating with uncaught exception of type NSException

I can only guess, but I suspect you are using some GUI widgets (Tk?) alongside Streamlit.
Can you share your github repo link?

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.