Bug 259262 - Krita crashed when closing the application
Summary: Krita crashed when closing the application
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Adam C
URL:
Keywords:
: 259559 273739 276685 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-08 23:55 UTC by Antti Poikela
Modified: 2011-10-16 12:43 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (5.05 KB, text/plain)
2011-03-11 13:06 UTC, Šarūnas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Poikela 2010-12-08 23:55:30 UTC
Application: krita (2.3 Beta 3)
KDE Platform Version: 4.5.85 (4.6 Beta2)
Qt Version: 4.7.1
Operating System: Linux 2.6.34.7-0.5-desktop x86_64
Distribution: "openSUSE 11.3 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:

I had two instances of Krita open. I had been playing with a Wacom tablet (works great!) and different brush settings. After a while, I closed both instances of Krita one after another, and the second instance crashed while closing.

-- Backtrace:
Application: Krita (kdeinit4), signal: Segmentation fault
[KCrash Handler]
#6  QWidget::releaseShortcut (this=0xc22ae0, id=-727) at kernel/qwidget.cpp:11056
#7  0x00007fe9126e93e3 in QLabelPrivate::clearContents (this=0xc20360) at widgets/qlabel.cpp:1365
#8  0x00007fe9126e96d9 in QLabel::~QLabel (this=<value optimized out>, __in_chrg=<value optimized out>) at widgets/qlabel.cpp:262
#9  0x00007fe9126e9719 in QLabel::~QLabel (this=0xc22ae0, __in_chrg=<value optimized out>) at widgets/qlabel.cpp:263
#10 0x00007fe9131593c4 in QObjectPrivate::deleteChildren (this=0xc2efa0) at kernel/qobject.cpp:1949
#11 0x00007fe912334720 in QWidget::~QWidget (this=0xb7b800, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1600
#12 0x00007fe8f9430a59 in KisColorSpaceSelector::~KisColorSpaceSelector() () from /usr/lib64/libkritaui.so.8
#13 0x00007fe9131593c4 in QObjectPrivate::deleteChildren (this=0xb249b0) at kernel/qobject.cpp:1949
#14 0x00007fe912334720 in QWidget::~QWidget (this=0xb8fa90, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1600
#15 0x00007fe9126e6379 in QGroupBox::~QGroupBox (this=0xb8fa90, __in_chrg=<value optimized out>) at widgets/qgroupbox.cpp:216
#16 0x00007fe9131593c4 in QObjectPrivate::deleteChildren (this=0xb03ca0) at kernel/qobject.cpp:1949
#17 0x00007fe912334720 in QWidget::~QWidget (this=0xb03190, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1600
#18 0x00007fe9123349d9 in QWidget::~QWidget (this=0xb03190, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1620
#19 0x00007fe9131593c4 in QObjectPrivate::deleteChildren (this=0xb029e0) at kernel/qobject.cpp:1949
#20 0x00007fe912334720 in QWidget::~QWidget (this=0x92c620, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1600
#21 0x00007fe912740309 in QStackedWidget::~QStackedWidget (this=0x92c620, __in_chrg=<value optimized out>) at widgets/qstackedwidget.cpp:151
#22 0x00007fe9131593c4 in QObjectPrivate::deleteChildren (this=0xb02790) at kernel/qobject.cpp:1949
#23 0x00007fe912334720 in QWidget::~QWidget (this=0x8f3580, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1600
#24 0x00007fe913e5c259 in KTabWidget::~KTabWidget (this=0x8f3580, __in_chrg=<value optimized out>) at /usr/src/debug/kdelibs-4.5.85/kdeui/widgets/ktabwidget.cpp:244
#25 0x00007fe9131593c4 in QObjectPrivate::deleteChildren (this=0x92c260) at kernel/qobject.cpp:1949
#26 0x00007fe912334720 in QWidget::~QWidget (this=0xb00f10, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1600
#27 0x00007fe8ebc74139 in ?? () from /usr/lib64/kde4/kritacolorselectorng.so
#28 0x00007fe8f939fedd in KisPreferenceSetRegistry::~KisPreferenceSetRegistry() () from /usr/lib64/libkritaui.so.8
#29 0x00007fe8f939ffe9 in KisPreferenceSetRegistry::~KisPreferenceSetRegistry() () from /usr/lib64/libkritaui.so.8
#30 0x00007fe911ae94e1 in __run_exit_handlers () from /lib64/libc.so.6
#31 0x00007fe911ae9535 in exit () from /lib64/libc.so.6
#32 0x0000000000407610 in launch (argc=1, _name=0x6bd3b8 "/usr/bin/krita", args=<value optimized out>, cwd=0x0, envc=<value optimized out>, envs=<value optimized out>, reset_env=false, tty=0x0, 
    avoid_loops=false, startup_id_str=0x6bd3e4 "myrmecoleon;1291847577;879787;16521_TIME259524320") at /usr/src/debug/kdelibs-4.5.85/kinit/kinit.cpp:730
#33 0x0000000000408125 in handle_launcher_request (sock=8, who=<value optimized out>) at /usr/src/debug/kdelibs-4.5.85/kinit/kinit.cpp:1222
#34 0x000000000040889a in handle_requests (waitForPid=<value optimized out>) at /usr/src/debug/kdelibs-4.5.85/kinit/kinit.cpp:1415
#35 0x00000000004094f0 in main (argc=4, argv=0x7fff22b8e7d8, envp=0x7fff22b8e800) at /usr/src/debug/kdelibs-4.5.85/kinit/kinit.cpp:1901

Reported using DrKonqi
Comment 1 Sven Langkamp 2010-12-09 02:35:41 UTC
Thanks for your report. Can you reproduce the crash? What did you do before it crashed?
Comment 2 Antti Poikela 2010-12-09 09:06:31 UTC
I have been unable to reproduce the crash. The crash happened when I was closing the application, but I can't give any exact information about what I was doing before that. Probably just using the pixel brush.
Comment 3 Halla Rempt 2010-12-11 13:07:41 UTC
I got the same crash in 2.3 today.
Comment 4 Adam C 2010-12-11 13:57:38 UTC
irc log:
adamce_>boud: do you have any exact informations?
adamce_>maybe you opened the settingswindow of krita or of the colour selector?
boud   >adamce_: yes, I had opened the settings window and gone through all the settings pages

i suppose, that the bug is in KisColorSpaceSelector::~KisColorSpaceSelector(), but unfortunately i don't have time right now..
Comment 5 Antti Poikela 2010-12-11 16:41:31 UTC
I tested again with Adam C's suggestion about the settings window, and now I'm able to reproduce the crash every time. The stack trace is identical to the one I reported in the first post.

1. Open Krita
2. Select new document, "Transparent 1600x1200"
3. Open Setting > Configure Krita...
4. Select "Color Selector Settings" pane
5. Close settings dialog selecting "Ok"
6. Close Krita
7. Crash
Comment 6 Cyrille Berger 2010-12-11 23:33:42 UTC
*** Bug 259559 has been marked as a duplicate of this bug. ***
Comment 7 Cyrille Berger 2010-12-12 00:38:05 UTC
I shall note that storing widgets in a registry is calling for problems. Deleting Widgets in a static deleter is a big no-no.
And if you wonder why, here is the code where the crash happen:

void QWidget::releaseShortcut(int id)
{
    Q_ASSERT(qApp);
    if (id)
        qApp->d_func()->shortcutMap.removeShortcut(id, this, 0);
}

And when the main function exit (ie before the static deleter are called), the QApplication is deleted, meaning qApp is now... invalid. Hence the crash.

So for 2.3, we should leak the KisPreferenceSet in KisPreferenceSetRegistry ::~KisPreferenceSetRegistry (it is an exit leak anyway). And for 2.4, use a factory instead of storing widgets.
Comment 8 Cyrille Berger 2010-12-14 18:36:28 UTC
SVN commit 1206503 by berger:

Temporary fix for an exit crash, that happen after opening the settings dialog.

Reviewed by Adam and Boudewijn.

CCBUG: 259262


 M  +3 -3      kis_preference_set_registry.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1206503
Comment 9 Šarūnas 2011-03-11 13:06:06 UTC
Created attachment 57865 [details]
New crash information added by DrKonqi

krita (2.3 RC 1) on KDE Platform 4.5.95 (4.6 RC2) using Qt 4.7.0

- What I was doing when the application crashed:

closing krita after playing with wacom tablet and trasparent brushes. All subdialogs have been closed prior the closing the main app.

-- Backtrace (Reduced):
#6  0x00007ffed4f5f963 in QWidget::releaseShortcut (this=0x45d8910, id=-277) at kernel/qwidget.cpp:11043
#7  0x00007ffed533d7f8 in QLabelPrivate::clearContents (this=0x4774960) at widgets/qlabel.cpp:1363
#8  0x00007ffed533e409 in QLabel::~QLabel (this=0x45d8910, __in_chrg=<value optimized out>) at widgets/qlabel.cpp:262
#9  0x00007ffed4545d5f in QObjectPrivate::deleteChildren (this=0x4624470) at kernel/qobject.cpp:1957
#10 0x00007ffed4f71168 in QWidget::~QWidget (this=0x4773e80, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1589
Comment 10 Adam C 2011-05-20 17:45:08 UTC
*** Bug 273739 has been marked as a duplicate of this bug. ***
Comment 11 Halla Rempt 2011-10-16 12:43:52 UTC
*** Bug 276685 has been marked as a duplicate of this bug. ***