Sometimes, extending a perspective grid lock up Krita. Reproducible: Sometimes Steps to Reproduce: 1.Place a Perspective ruler 2.Extend the ruler to many direction quickly towards various direction Actual Results: Krita locks up on mouse release. Midpoint of the last extended grid seems to be missing. Expected Results: Krita does not lock up. So far I only managed to repro this with quick operation with tablet.
Created attachment 91841 [details] Screencapture of freeze
Created attachment 91842 [details] Simpler_lockup_step Create a perspective grid using the attached image as template, grab right mid point to start extending. Trying to extend it around(to the right and to the left), Krita suddenly locks up. Can repro with mouse as well.
Created attachment 91843 [details] Test template
Yes. I'm able to reproduce this with Krita: 2.9.1 (git 1115da8) - Ubuntu 14.04 Unity. Krita hangs by clicking and dragging a midpoint of one of the edges of the perspective assistant. At some point, Krita doesn't respond and you have to kill the program to exit.
Have you been able to get a backtrace by attaching gdb when Krita hangs? Something like, ps ax | grep krita on the command line will give 23390 pts/1 Sl+ 0:05 krita Then, gdb attach 23390 (you will have a different number) Will land you in the gdb prompt where you can do thread apply all bt
Created attachment 91942 [details] I can't get a gdb report with above steps (after 'gdb attach <ID>' it complains the file is not found). So I started Krita through gdb, hit 'CTRL+C' and did 'thread apply all bt'. See attachment.
...I didn't explained well. I feel to clarify a bit further: In this case, if I run Krita through gdb when the window freezes, no error is reported in the terminal (no error = no gdb prompt). That is: even though I'm still able to enter (type+enter) the command "thread apply all bt" in the terminal, nothing seems to happen. So I've hit 'CTRL+C' to get the gdb prompt back and then issued the command "thread apply all bt" to create the gdb report. I'm not sure if 'CTRL+C' interferes with the generation of the report. Please, let me know and I will be more than glad to help.
I think it may have something to do with the assistant previews, but it's weird, because those rely on the same code that the two little X shapes marking the vanishing points rely on, and the vanishing point assistant doesn't have this issue :/ Maybe remove previews from perspective alltogether?
I have an idea for this one (Basically, avoid having the lines be determined when the angle of the points is too vertical or horizontal), but it'll need to wait till my exams are over.
Git commit 064536486d16967ece781588660a22669ba76bac by Wolthera van Hovell. Committed on 05/06/2015 at 11:28. Pushed by woltherav into branch 'calligra/2.9'. This was caused by an attempt to calculate the intersection on two nearly parallel lines. The fix is of course to not do the calculation when two lines are practically parallel. M +31 -26 krita/plugins/assistants/RulerAssistant/PerspectiveAssistant.cc http://commits.kde.org/calligra/064536486d16967ece781588660a22669ba76bac
Created attachment 93020 [details] Video example. Hi wolthera :) hope your exams went well and thank you for updating. On my part I've tried with the last commit but it seems that a problem is still present. I'm attaching a video example. The program seems to freeze. P.S.: When the freeze occurs I'm not sure how to get a proper gdb report. I'm not sure that would be the right procedure by doing CTRL+C and get the output of "then thread apply all bt".
Git commit 1ea16431b21240358a779ec32bd79c5930423cee by Wolthera van Hovell. Committed on 05/06/2015 at 13:32. Pushed by woltherav into branch 'calligra/2.9'. This should prevent lockups on computer with higher resolution than mine. M +3 -3 krita/plugins/assistants/RulerAssistant/PerspectiveAssistant.cc http://commits.kde.org/calligra/1ea16431b21240358a779ec32bd79c5930423cee
Hm, it seems I can reproduce it again... I'll try again with a clean build of Krita. These are the terminal output lines when the program freezes up (tested at first start soon after updating, with default document and prefs): [code]FIXME: handle dialog end. uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu QSpiAccessible::accessibleEvent not handled: "8008" obj: QObject(0x0) " invalid interface!" QSpiAccessible::accessibleEvent not handled: "8008" obj: QObject(0x0) " invalid interface!" QSpiAccessible::accessibleEvent not handled: "8008" obj: QObject(0x0) " invalid interface!"[/code]
mwowada, can you or can't you reproduce it when you turn off assistant previews under view? Because it might be something different from what I suspect it is...
Created attachment 93023 [details] Video example with assistant previews turned off. I'm sorry, it seems I can still reproduce it also with assistant previews turned off (video). No luck with a clean build.
Git commit c0f4f2fabea1294e7839f44f2e7e80c74028e838 by Wolthera van Hovell. Committed on 05/06/2015 at 16:58. Pushed by woltherav into branch 'calligra/2.9'. Another attempt at fixing lockups. If this doesn't work I am fresh out of ideas. M +8 -4 krita/plugins/assistants/RulerAssistant/PerspectiveAssistant.cc http://commits.kde.org/calligra/c0f4f2fabea1294e7839f44f2e7e80c74028e838
Thank you very much. I tried one last thing, and if this doesn't fix it the issue is somewhere else entirely, and we'll need a backtrace.
Created attachment 93024 [details] gdb threads. Never mind, I can reproduce myself... I have no idea what is going on here...
Git commit aede3037897c6974a39b05272c8ad34f4dcf99eb by Wolthera van Hovell. Committed on 05/06/2015 at 17:50. Pushed by woltherav into branch 'calligra/2.9'. Related: bug 120, bug 300 As indicated by the commit message the issue was that in 360 degrees there's always two values which can be parallel. Fixed with an fmod. I can now not reproduce this bug any more. The downside of course is that perspective squares with parallel sides don't do preview lines for that side, but we can look at that in the future. M +4 -4 krita/plugins/assistants/RulerAssistant/PerspectiveAssistant.cc M +1 -1 krita/plugins/assistants/RulerAssistant/kis_ruler_assistant_tool.cc http://commits.kde.org/calligra/aede3037897c6974a39b05272c8ad34f4dcf99eb
Mvowada, it is fixed for me now, hope it is fixed for you too! My apologies that mention bugs 120 and 300 may have led to people being mailed. I wasn't aware that arbitrary mentions of numbers would do that :(
Oh yes, it works beautifully now. Thank you for everything!