Bug 292996 - Crash in Nepomuk::Resource::~Resource
Summary: Crash in Nepomuk::Resource::~Resource
Status: RESOLVED FIXED
Alias: None
Product: nepomuk
Classification: Miscellaneous
Component: libnepomukcore (show other bugs)
Version: 4.9
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Sebastian Trueg
URL:
Keywords:
: 284696 294000 301538 305282 305401 305828 307551 308187 308631 309671 315753 318490 318632 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-31 20:03 UTC by Ivan D Vasin
Modified: 2013-04-20 22:48 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10


Attachments
New crash information added by DrKonqi (3.90 KB, text/plain)
2012-02-07 15:41 UTC, Beat Wolf
Details
New crash information added by DrKonqi (4.00 KB, text/plain)
2013-02-20 22:20 UTC, Unknown
Details
New crash information added by DrKonqi (3.35 KB, text/plain)
2013-03-21 14:48 UTC, xa.kasprzyk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan D Vasin 2012-01-31 20:03:44 UTC
Application: kontact (4.8.0)
KDE Platform Version: 4.8.00 (4.8.0
Qt Version: 4.7.4
Operating System: Linux 3.0.0-16-generic x86_64
Distribution: Ubuntu 11.10

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

i encountered this after wiping my Akonadi settings and starting with a clean Akonadi/PostgreSQL setup.  here's what i did (roughly--i might be forgetting something) after starting Akonadi and verifying that it worked.

1. i set up one IMAP account connected to a rather large Gmail account.
2. i clicked on the inbox to see the progress of loading its message list.
3. i right-clicked the inbox and chose the option to open its properties.
4. i configured some of KMail's layout, fonts, and colors via its settings window.
5. the inbox's properties finally loaded.  i selected and applied the option to always download entire messages.
6. i clicked on my sent mail folder to see if it was populated yet.  it was empty.  i poked a few others that were similarly empty.  i might have tried to open another's folder properties.
7. i switched back to the inbox to see how it was progressing.  it seemed to be stuck on 11 days before the present.
8. i closed KMail.

KMail crashed a few seconds after i exited it.


- Unusual behavior I noticed:

the inbox was stuck loading the message list.  the progress bar showed 100%.  all other folders were empty (judging by the few that i poked) and apparently not loading.

The crash does not seem to be reproducible.

-- Backtrace:
Application: Kontact (kontact), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f9bb5e5f7a0 (LWP 394))]

Thread 2 (Thread 0x7f9b9c255700 (LWP 411)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f9bb26bdc2c in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#2  0x00007f9bb26bdd59 in ?? () from /usr/lib/x86_64-linux-gnu/libQtWebKit.so.4
#3  0x00007f9badea0efc in start_thread (arg=0x7f9b9c255700) at pthread_create.c:304
#4  0x00007f9bb33cb89d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f9bb5e5f7a0 (LWP 394)):
[KCrash Handler]
#6  0x00007f9bb3a1123c in QMutex::lock (this=0xe80980) at thread/qmutex.cpp:151
#7  0x00007f9babd83a23 in QMutexLocker (m=0xe80980, this=<synthetic pointer>) at /usr/include/qt4/QtCore/qmutex.h:102
#8  Nepomuk::Resource::~Resource (this=0x7f9b4cca08e0, __in_chrg=<optimized out>) at ../../nepomuk/core/resource.cpp:140
#9  0x00007f9babd841f9 in Nepomuk::Resource::~Resource (this=0x7f9b4cca08e0, __in_chrg=<optimized out>) at ../../nepomuk/core/resource.cpp:145
#10 0x00007f9bb3b0cd21 in QMetaCallEvent::~QMetaCallEvent (this=0x7f9b4c9f5240, __in_chrg=<optimized out>) at kernel/qobject.cpp:521
#11 0x00007f9bb3b0cd89 in QMetaCallEvent::~QMetaCallEvent (this=0x7f9b4c9f5240, __in_chrg=<optimized out>) at kernel/qobject.cpp:529
#12 0x00007f9bb3affd6e in QCoreApplicationPrivate::~QCoreApplicationPrivate (this=0x7ab5b0, __in_chrg=<optimized out>) at kernel/qcoreapplication.cpp:357
#13 0x00007f9bb44fd479 in QApplicationPrivate::~QApplicationPrivate (this=0x7ab5b0, __in_chrg=<optimized out>) at kernel/qapplication.cpp:221
#14 0x00007f9bb3b1439b in cleanup (pointer=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:62
#15 ~QScopedPointer (this=0x7fff885009a8, __in_chrg=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:100
#16 QObject::~QObject (this=0x7fff885009a0, __in_chrg=<optimized out>) at kernel/qobject.cpp:818
#17 0x00007f9bb4507fd7 in QApplication::~QApplication (this=0x7fff885009a0, __in_chrg=<optimized out>) at kernel/qapplication.cpp:1093
#18 0x00000000004036bb in ~KontactApp (this=0x7fff885009a0, __in_chrg=<optimized out>) at ../../../kontact/src/main.cpp:65
#19 main (argc=3, argv=0x7fff88500fc8) at ../../../kontact/src/main.cpp:198

Reported using DrKonqi
Comment 1 Beat Wolf 2012-02-07 15:41:17 UTC
Created attachment 68591 [details]
New crash information added by DrKonqi

kontact (4.8.0) on KDE Platform 4.8.00 (4.8.0 using Qt 4.7.4

- What I was doing when the application crashed:

I closed kontact and then kontact crashed.

-- Backtrace (Reduced):
#6  0x00007f71762cb23c in QMutex::lock (this=0x2424f90) at thread/qmutex.cpp:151
#7  0x00007f716e63da23 in QMutexLocker (m=0x2424f90, this=<synthetic pointer>) at /usr/include/qt4/QtCore/qmutex.h:102
#8  Nepomuk::Resource::~Resource (this=0x3587530, __in_chrg=<optimized out>) at ../../nepomuk/core/resource.cpp:140
#9  0x00007f716e63e1f9 in Nepomuk::Resource::~Resource (this=0x3587530, __in_chrg=<optimized out>) at ../../nepomuk/core/resource.cpp:145
[...]
#12 0x00007f71763b9d6e in QCoreApplicationPrivate::~QCoreApplicationPrivate (this=0x1d959e0, __in_chrg=<optimized out>) at kernel/qcoreapplication.cpp:357
Comment 2 Christophe Marin 2012-02-29 11:12:10 UTC
*** Bug 294000 has been marked as a duplicate of this bug. ***
Comment 3 Vishesh Handa 2012-07-31 17:36:21 UTC
*** Bug 301538 has been marked as a duplicate of this bug. ***
Comment 4 Vishesh Handa 2012-07-31 17:40:34 UTC
*** Bug 284696 has been marked as a duplicate of this bug. ***
Comment 5 Myriam Schweingruber 2012-09-30 10:40:51 UTC
*** Bug 307551 has been marked as a duplicate of this bug. ***
Comment 6 Myriam Schweingruber 2012-09-30 10:41:27 UTC
*** Bug 305282 has been marked as a duplicate of this bug. ***
Comment 7 Myriam Schweingruber 2012-09-30 10:42:21 UTC
*** Bug 305828 has been marked as a duplicate of this bug. ***
Comment 8 Myriam Schweingruber 2012-09-30 10:43:53 UTC
Confirmed by several duplicates.
Comment 9 Myriam Schweingruber 2012-09-30 10:44:12 UTC
*** Bug 305401 has been marked as a duplicate of this bug. ***
Comment 10 David Faure 2012-10-01 08:19:55 UTC
Looks like m_data is dangling, in Resource, or ResourceManager is already deleted.
Comment 11 Jekyll Wu 2012-11-06 23:15:59 UTC
*** Bug 309671 has been marked as a duplicate of this bug. ***
Comment 12 Simeon Bird 2012-11-30 06:01:56 UTC
*** Bug 308631 has been marked as a duplicate of this bug. ***
Comment 13 Vishesh Handa 2012-11-30 23:43:35 UTC
*** Bug 308187 has been marked as a duplicate of this bug. ***
Comment 14 Vishesh Handa 2012-12-10 09:17:43 UTC
Git commit 712879840c661b1246e1c69cf338fb6c36aee51e by Vishesh Handa.
Committed on 04/12/2012 at 12:20.
Pushed by vhanda into branch 'master'.

ResourceManager: Cleanup out all the existing Resources before exit

Ideally, there should be no ResourceData* in the cache when the
ResourceManager is being destroyed. However, they can be cases when a
Resource has been allocated statically and it is destroyed after the
ResourceManager. In that case, when the Resource is eventually
destroyed, it will crash as it will try to access the deleted
ResourceManager.

In order to fix this, we connect to QCoreApplication::aboutToQuit signal
and set all the Resource::m_data = 0. This results in the Resource class
not doing anything during its destruction and therefore not crashing. We
also delete all the ResourceData pointers.

This cleanUpResource() cannot be done in the ResourceManager destructor
cause ResourceData::resetAll accesses NIE::url() and NAO::identifier(),
both of which are also static variables and could have been destroyed
before.
FIXED-IN: 4.10
REVIEW: 107575

M  +2    -0    libnepomukcore/resource/resource.h
M  +20   -0    libnepomukcore/resource/resourcemanager.cpp
M  +7    -0    libnepomukcore/resource/resourcemanager.h

http://commits.kde.org/nepomuk-core/712879840c661b1246e1c69cf338fb6c36aee51e
Comment 15 Unknown 2013-02-20 22:20:56 UTC
Created attachment 77478 [details]
New crash information added by DrKonqi

gwenview (4.10.0) on KDE Platform 4.10.00 "release 546" using Qt 4.8.4

- What I was doing when the application crashed:

I removed the mass storage device while a picture was open in Gwenview and after it crashed.

Interestingly, it happened in KDE 4.10. Please, examine this backtrace and reopen the bug if necessary.

-- Backtrace (Reduced):
#6  0x00007febb7421cd7 in lockInline (this=0x11804f8) at /usr/include/QtCore/qmutex.h:187
#7  QMutexLocker (m=0x11804f8, this=<synthetic pointer>) at /usr/include/QtCore/qmutex.h:109
#8  Nepomuk::Resource::~Resource (this=0x7feb88013850, __in_chrg=<optimized out>) at /usr/src/debug/kdelibs-4.10.0/nepomuk/core/resource.cpp:142
#9  0x00007febb7421f89 in Nepomuk::Resource::~Resource (this=0x7feb88013850, __in_chrg=<optimized out>) at /usr/src/debug/kdelibs-4.10.0/nepomuk/core/resource.cpp:147
[...]
#12 0x00007febb7c61c38 in QCoreApplicationPrivate::~QCoreApplicationPrivate (this=0x10298f0, __in_chrg=<optimized out>) at kernel/qcoreapplication.cpp:480
Comment 16 Vishesh Handa 2013-02-21 07:44:19 UTC
(In reply to comment #15)
> 
> Interestingly, it happened in KDE 4.10. Please, examine this backtrace and
> reopen the bug if necessary.

Gwenview (4.10) is still using kdelibs/nepomuk, instead of nepomuk-core. They have now migrated (4.11), and this crash shouldn't be a problem.

This crash cannot be fixed in kdelibs/nepomuk cause the code has diverged a lot.
Comment 17 Jekyll Wu 2013-02-25 18:03:54 UTC
*** Bug 315753 has been marked as a duplicate of this bug. ***
Comment 18 xa.kasprzyk 2013-03-21 14:48:01 UTC
Created attachment 78266 [details]
New crash information added by DrKonqi

gwenview (4.10.1) on KDE Platform 4.10.1 "release 545" using Qt 4.8.4

- What I was doing when the application crashed:

I opened Gwenview to see some images.
Then I closed it and Gwenview crashed.
Thats all.

-- Backtrace (Reduced):
#6  0x00007f1e873c7d67 in lockInline (this=0x1827798) at /usr/include/QtCore/qmutex.h:187
#7  QMutexLocker (m=0x1827798, this=<synthetic pointer>) at /usr/include/QtCore/qmutex.h:109
#8  Nepomuk::Resource::~Resource (this=0x7f1e6403bea0, __in_chrg=<optimized out>) at /usr/src/debug/kdelibs-4.10.1/nepomuk/core/resource.cpp:142
#9  0x00007f1e873c8019 in Nepomuk::Resource::~Resource (this=0x7f1e6403bea0, __in_chrg=<optimized out>) at /usr/src/debug/kdelibs-4.10.1/nepomuk/core/resource.cpp:147
[...]
#12 0x00007f1e87c07cd8 in QCoreApplicationPrivate::~QCoreApplicationPrivate (this=0x1686f80, __in_chrg=<optimized out>) at kernel/qcoreapplication.cpp:480
Comment 19 Jekyll Wu 2013-04-17 09:23:29 UTC
*** Bug 318490 has been marked as a duplicate of this bug. ***
Comment 20 Christoph Feck 2013-04-20 22:48:58 UTC
*** Bug 318632 has been marked as a duplicate of this bug. ***