Closed aaronayres35 closed 2 years ago
traceback after enabling faulthandler:
Code near end of traceback:
https://github.com/enthought/traitsui/blob/75a694a82b455a0b29db481ad6b63cedc9d01c6d/traitsui/editor.py#L738-L757
Note that the error
call does complete (I can see the output of a print statement after it but before raise
). Commenting out the raise
the segfault does not occur (at least immediately, but I am able to trigger one shortly after by clicking cancel and closing the new dialog.
https://github.com/enthought/traitsui/blob/75a694a82b455a0b29db481ad6b63cedc9d01c6d/traitsui/qt4/editor.py#L72-L90
Okay so some how after adding a bunch of print statements the traceback now includes the following:
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.
seems the exception is just slipping through the cracks
Note this can also be observed by changing the text to 0.0 and hitting enter.
I am confused by the 2 dialogs appearing, and print statements tell me that update_object_on_editor
is being called twice. I believe it is being called based off a signal emitted by qt, based on this line: text.editingFinished.connect(self.update_object_on_enter)
Perhaps the signal is getting emitted 2x? But also this is occurring with scroll
Shockingly, when scrolling to 0 I see that update_object_on_enter
is called! This is resulting in the 2 dialogs in this case and I have a fix for it. The enter case is trickier... I believe what is happening is the first is triggered. Then the error dialog pops up as there is an invalid value. This dialog is modal, and steals the focus. Losing focus on the QLineEdit causes it to emit another editingFinished
signal! (at least I think).
This looks like it may have been a duplicate of #158
see PR #1546 for original inspiration.
To reproduce run:
and drag the slider all the way to
0.0
. Result is:and closing the dialogs triggers a segfault