Summary: | crash when exiting unfinished practice | ||
---|---|---|---|
Product: | [Applications] parley | Reporter: | Ansa <ansa.ansa> |
Component: | general | Assignee: | parley bug tracker <parley-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | andxav, inge |
Priority: | NOR | ||
Version: | 0.9.4 | ||
Target Milestone: | --- | ||
Platform: | Kubuntu | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=271695 | ||
Latest Commit: | http://commits.kde.org/parley/f382c4f9334e2beeabe25b35f3ea329f34b81072 | Version Fixed In: | |
Sentry Crash Report: |
Description
Ansa
2014-03-25 17:56:36 UTC
From looking at the backtrace, the custom style sheet causes the crash. I forgot to mention it. It only happens with the stylesheet, so yes, it is the fact that I am using a stylesheet causing the crash. However, I do not see how the stylesheet itself could cause a crash - I have not been able to identify any error in the stylesheet (it is actually a qss stylesheet, the documentation may be found here http://qt-project.org/doc/qt-4.8/stylesheet-syntax.html ), so I still think this is a bug. I am beginning to suspect that this is not a parley bug though, but a Qt bug, as the option to use stylesheets is listed among "Qt specific options" (parley --help-qt). Hi Ansa, I haven't used stylesheets before so I have a couple of question: - What do you call the file that contains the stylesheet? - Where do you put it? - Do you perform some action to turn it on/off or is the file enough? Let's see if we can fix this crash. You have to start parley with the stylesheet option, e.g. I start mine through /usr/local/bin/parley --stylesheet /media/ansa/1D9D-9B1D/Jazyky_a_Parley/Parley/parley.qss (i.e. I have the stylesheet on a flashdrive in the same directory as the kvtml files; I don't think the name or the location should matter) When I start parley from the console, I get lots of output. It mentions some problem on the first few lines: parley(5670) KEduVocDocument::KEduVocDocument: constructor done parley(5670)/libkdegames KGameTheme::load: Attempting to load .desktop at "/usr/share/kde4/apps/parley/themes/theme_reference.desktop" Could not add child element to parent element because the types are incorrect. parley(5670) Practice::ImageCache::openCache: opened cache: "/home/ansa/.kde/share/apps/parley/startpagethemecache.bin" However, the "Could not add child element" does not happen with the bees theme, and the crash happens with it, so it probably is not related. In both cases the "Last Opened Collections" list which appears right after starting parley does not have its usual colourful background when I start parley with the stylesheet, instead the background is white - definitely not an intended consequence of the stylesheet. a minimum non-working example is an empty file used as a stylesheet just create an empty file called parley.qss and run /usr/bin/parley --stylesheet parley.qss The welcome screen has white background as described above. Parley crashed when practice is exited prematurely. With the original stylesheet, I noticed one more relevant thing: as the stylesheet highlights a button that is "in focus", and the crash only happens when no button is highlighted, i.e., only in written or mixed letter practice mode, and only when focus is on the input field. Thank you Ansa, that was a well written and easy to replicate test case. I have proposed a bugfix and posted it at: https://git.reviewboard.kde.org/r/119119/ Git commit bea0ac4e413a4709e5e42c1ce5cc5baf79c1b3c7 by Andreas Xavier. Committed on 06/07/2014 at 20:04. Pushed by axavier into branch 'KDE/4.14'. Fix crash when exiting unfinished written mode practice with style sheet The bug was as follows. When a WrittenPracticeWidget using a KLineEdit styled with a qStyleSheet that has focus is deleted this triggers a focus changing event, but the QStyleSheet returns a style that has already been deleted and causes a crash when the invalid style is applied. The obvious solution of responding to the destroyed() event doesn't work, because the destroyed() event happens after the crash. In order to fix this bug, I transistion focus away from the KLineEdit before the focus change preceding deletion. The virtual function, WrittenPracticeWidget::objectDestroyed, avoids having a practice mode switch statement as large as this comment at each delete event. REVIEW: 119119 M +4 -0 src/practice/abstractwidget.cpp M +7 -0 src/practice/abstractwidget.h M +8 -0 src/practice/guifrontend.cpp M +7 -0 src/practice/guifrontend.h M +1 -1 src/practice/practicemainwindow.cpp M +29 -0 src/practice/writtenpracticewidget.cpp M +11 -0 src/practice/writtenpracticewidget.h http://commits.kde.org/parley/bea0ac4e413a4709e5e42c1ce5cc5baf79c1b3c7 Git commit f382c4f9334e2beeabe25b35f3ea329f34b81072 by Andreas Xavier. Committed on 06/07/2014 at 20:04. Pushed by axavier into branch 'master'. Fix crash when exiting unfinished written mode practice with style sheet The bug was as follows. When a WrittenPracticeWidget using a KLineEdit styled with a qStyleSheet that has focus is deleted this triggers a focus changing event, but the QStyleSheet returns a style that has already been deleted and causes a crash when the invalid style is applied. The obvious solution of responding to the destroyed() event doesn't work, because the destroyed() event happens after the crash. In order to fix this bug, I transistion focus away from the KLineEdit before the focus change preceding deletion. The virtual function, WrittenPracticeWidget::objectDestroyed, avoids having a practice mode switch statement as large as this comment at each delete event. REVIEW: 119119 M +4 -0 src/practice/abstractwidget.cpp M +7 -0 src/practice/abstractwidget.h M +8 -0 src/practice/guifrontend.cpp M +7 -0 src/practice/guifrontend.h M +1 -1 src/practice/practicemainwindow.cpp M +29 -0 src/practice/writtenpracticewidget.cpp M +11 -0 src/practice/writtenpracticewidget.h http://commits.kde.org/parley/f382c4f9334e2beeabe25b35f3ea329f34b81072 |