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
Crash when working with text fields #359
Comments
It seems this is the same problem as #354. I hadn't been able to figure out what caused that, but with your new details a theory is emerging. Since 7.2.18, the UI no longer freezes while Latex is running. At some point, the Latex run updates all the PDF resources, and it would seem that this might not be thread-safe: if a text object is being redisplayed exactly while the resources update, then this could explain this crash. Is it true that the crash always happens while Latex is running (that is, just after you modified a text object)? Could you try to edit the file
into
This moves the Latex run into the GUI thread. If the problem is caused by a race condition, this would fix it. I'll have to think about a proper fix. Most likely I'll move the update of the resources into the main thread. |
Thanks for the quick answer! What you are describing very accurately matches what I am experiencing. When the latex compiles there's always a very small delay (I mean, also when everything works), and it seems to crash exactly after this short delay. And as far as I can tell, all the crashes that I experienced happened after the latex rendering ran. Unfortunately, right now I somehow cannot reproduce it anymore. As soon as it comes back, I will check what you suggested and report back. Maybe it also just occurs shortly before SoCG deadlines. ;D |
That sounds consistent with my experience in #354. The crashes tend to happen when I rapidly undo multiple times, so it would be plausible that the results of one compile run come in just as I'm pressing Ctrl+Z again. I've noticed this especially with files for which the latex run doesn't complete instantaneously, which makes it easier to hit undo again before the previous undo operation's latex run has completed and updated the document's fields. |
I now tried this again (when creating a text field containing "$x$" and changing the font size multiple times) and got a crash 3 out of 3 tries without this modification and could not get any crash with this modification. So, from my side it looks a lot like you found the cause! :) Tell me if I can help you further with resolving this bug. |
I can also confirm that the proposed change solves the segfault in a debian/KDE system. In addition, if the option "Enable the online latex compilation" is set, the problem does not occur, but I think there is no a race condition in this case. |
Here is a proposed fix for this bug. If you can compile Ipe yourself, it would be great if you could test if it really fixes the issue for you (I have never encountered it on my own system). |
I could not make it crash anymore with the version that you linked. However, as I also couldn't reproduce the bug deterministically, I cannot say with full certainty that it is fixed. It might be good if other people check as well. |
I checked this fix and it is working well in my system. Thanks! |
This bug appears again for me in version 7.2.26. Unfortunately, I cannot tell you exactly in which version the regression happened. The fix proposed above again resolves the issue for me. (actually, I just added Is there anything I can do to help resolving the issue? |
I am also experiencing the same problem in version 7.2.26. I can confirm that adding |
Hi Otfried,
I experience crashes when working with text fields. The most reliable way to trigger this crash seems to be to create a text field, .e.g, containing$x$ , and then change the font size several times and at some point it tends to crash on me. It also crashes in all sorts of other situations when working with text fields, but most reliably when changing the font size.
Operating System: Manjaro (fully updated)
Ipe Version: 7.2.21
Desktop (if this might be important for any reason): KDE
As I regularly use ipe, I strongly suspect that this bug was introduced in 7.2.21.
I created a trace on a crash that was triggered as described above. Unfortunately, it is not compiled with debug information, but I still hope that it is of help or that you can at least reproduce it.
Tell me if I can provide more useful information.
Thanks a lot for creating and maintaining ipe! :)
The text was updated successfully, but these errors were encountered: