New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] FreeCAD crashes when using Draft_Edit #8749
Comments
azuk
added a commit
to azuk/FreeCAD
that referenced
this issue
Mar 6, 2023
This mitigates the crash reported in issue FreeCAD#8749. The crash happens when using Draft_Edit and using keyboard to enter a coordinate in Edit node dialog. This change partially restores behaviour before commit fc14567, after which FreeCADGui.Control.closeDialog and showDialog calls during execution of DraftToolBar.editUi are no longer made using the todo.delay mechanism. The crash can still be triggered by artificially slowing down key event processing, so this is not a proper fix, just a mitigation.
1 task
luzpaz
added
Bug
This issue or PR is related to a bug
WB Draft
Related to the Draft Workbench
Crash
For issues describing crashes or PRs fixing one
labels
Mar 8, 2023
Roy assigned to you. Feel free to unassign if not appropriate. |
Roy-043
pushed a commit
that referenced
this issue
Mar 11, 2023
This mitigates the crash reported in issue #8749. The crash happens when using Draft_Edit and using keyboard to enter a coordinate in Edit node dialog. This change partially restores behaviour before commit fc14567, after which FreeCADGui.Control.closeDialog and showDialog calls during execution of DraftToolBar.editUi are no longer made using the todo.delay mechanism. The crash can still be triggered by artificially slowing down key event processing, so this is not a proper fix, just a mitigation.
Fixed with #8750. |
Roy-043
pushed a commit
that referenced
this issue
Mar 12, 2023
This mitigates the crash reported in issue #8749. The crash happens when using Draft_Edit and using keyboard to enter a coordinate in Edit node dialog. This change partially restores behaviour before commit fc14567, after which FreeCADGui.Control.closeDialog and showDialog calls during execution of DraftToolBar.editUi are no longer made using the todo.delay mechanism. The crash can still be triggered by artificially slowing down key event processing, so this is not a proper fix, just a mitigation.
chennes
pushed a commit
to chennes/FreeCAD
that referenced
this issue
Mar 13, 2023
This mitigates the crash reported in issue FreeCAD#8749. The crash happens when using Draft_Edit and using keyboard to enter a coordinate in Edit node dialog. This change partially restores behaviour before commit fc14567, after which FreeCADGui.Control.closeDialog and showDialog calls during execution of DraftToolBar.editUi are no longer made using the todo.delay mechanism. The crash can still be triggered by artificially slowing down key event processing, so this is not a proper fix, just a mitigation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Forums discussion
https://forum.freecad.org/viewtopic.php?t=73045
Version
0.21 (Development)
Full version info
Subproject(s) affected?
Draft
Issue description
In addition to the forum link given above, there is another forum thread about the same issue here: https://forum.freecad.org/viewtopic.php?t=76516&sid=2b48d079e2c3bb0f01f4c7c05023b41c
Steps to reproduce:
The problem cannot be reproduced by moving the line endpoint with mouse, you need to enter the delta X value to the dialog.
On a fast computer the problem may never happen. Even on a slower computer it may not happen every time. One can artificially slow down key event processing in debugger (by adding a breakpoint that does nothing but logs something and then continues, for example) to reproduce it more easily.
Stacktrace from one attempt:
I bisected the problem to commit fc14567.
Edit.endEditing in Mod/Draft/draftguitools/gui_edit.py calls DraftToolBar.editUi and before that commit editUi called self.taskUi which did this (partial copy&paste):
Now editUi calls self.makeDumbTask which does this (class TaskPanel definition not included):
So, observe that both the old code and the new close the current dialog and show a new one. However, the old code does both of those things using the todo.delay mechanism.
Right after filing this issue report, I will try to submit a PR that wraps closeDialog and showDialog calls in makeDumbTask in todo.delay, effectively restoring the behaviour before fc14567. That mitigates the problem so that I can no longer reproduce it when running FreeCAD normally on my slower computer.
However, I can still reproduce the problem when running FreeCAD under a debugger (with breakpoint-logging in a key event processing method, just to introduce extra delay). Seems to be timing sensitive and while todo.delay helps, it's not a proper fix. So I'd recommend leaving this issue open despite the mitigation PR.
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: