Summary: | Dolphin crashes during shutdown, when stopping activity | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Simon Persson <simon.persson> |
Component: | general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | david, elvis.angelaccio, jodr666, nate, philipp.verpoort, piotr.mierzwinski, web, xrigou |
Priority: | NOR | Keywords: | drkonqi |
Version First Reported In: | 18.12.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/dolphin/b1ccec70f28fefca8fcd464ec21dd13070c72e5c | Version Fixed In: | 18.12.3 |
Sentry Crash Report: | |||
Attachments: |
New crash information added by DrKonqi
New crash information added by DrKonqi New crash information added by DrKonqi |
Description
Simon Persson
2019-01-02 12:55:20 UTC
The problem is that when we stop the activity, the KItemListViewAccessible destructor is called *after* QApplication::exec() from the main() returns (no idea why). At that point, m_cells contains only dangling pointers and everything falls apart. *** Bug 403216 has been marked as a duplicate of this bug. *** *** Bug 403773 has been marked as a duplicate of this bug. *** (In reply to Elvis Angelaccio from comment #1) > The problem is that when we stop the activity, the KItemListViewAccessible > destructor is called *after* QApplication::exec() from the main() returns > (no idea why). At that point, m_cells contains only dangling pointers and > everything falls apart. Hi Elvis, I was looking at the code for this and I was thinking if a solution could be to change the m_cells type to store QAccessible::Id instead of a pointer to QAccessibleInterface, since Qt provides easy access to the QAccessibleInterface* given the Id. Then in the destructor we could simply lookup the QAccessibleInterface* pointer with the Id and delete it if it was found? Created attachment 118117 [details]
New crash information added by DrKonqi
dolphin (18.12.2) using Qt 5.12.0
- What I was doing when the application crashed:
Can report the same problem: dolphin crashes on system shutdown and activity closure.
-- Backtrace (Reduced):
#7 0x00007f2799590d5a in QAccessible::registerAccessibleInterface (iface=0x55644e583b50) at accessible/qaccessible.cpp:746
#8 0x00007f279e8c5f9d in KItemListViewAccessible::~KItemListViewAccessible() () from /usr/lib/x86_64-linux-gnu/libdolphinprivate.so.5
#9 0x00007f279e8c6079 in KItemListViewAccessible::~KItemListViewAccessible() () from /usr/lib/x86_64-linux-gnu/libdolphinprivate.so.5
#10 0x00007f2799596d7a in QAccessibleCache::deleteInterface (this=this@entry=0x55644db37d00, id=<optimized out>, obj=<optimized out>, obj@entry=0x0) at accessible/qaccessiblecache.cpp:153
#11 0x00007f2799597350 in QAccessibleCache::~QAccessibleCache (this=0x55644db37d00, __in_chrg=<optimized out>) at accessible/qaccessiblecache.cpp:67
(In reply to David Hallas from comment #4) > (In reply to Elvis Angelaccio from comment #1) > > The problem is that when we stop the activity, the KItemListViewAccessible > > destructor is called *after* QApplication::exec() from the main() returns > > (no idea why). At that point, m_cells contains only dangling pointers and > > everything falls apart. > > Hi Elvis, > > I was looking at the code for this and I was thinking if a solution could be > to change the m_cells type to store QAccessible::Id instead of a pointer to > QAccessibleInterface, since Qt provides easy access to the > QAccessibleInterface* given the Id. Then in the destructor we could simply > lookup the QAccessibleInterface* pointer with the Id and delete it if it was > found? This sounds interesting. Feel free to try and submit a patch if it works :) I have created a patch here: https://phabricator.kde.org/D19083 Please take a look at it and see what you think :) Also, I haven't been able to reproduce the crash myself, so I would really like someone who can reproduce it to check if this fixes it. Git commit c72fdaa77380ef811dfef626a4edadbb824ed252 by David Hallas. Committed on 18/02/2019 at 07:58. Pushed by hallas into branch 'master'. Fix crash during shutdown Summary: Fix crash during shutdown. The root cause is that when Dolphin in stopped as part of an activity, the KItemListViewAccessible destructor is called after QApplication::exec has returned causing Qt to already having cleaned up the QAccessibleInterface instances kept in KItemListViewAccessible. Instead of storing the pointers to QAccessibleInterface we store the QAccessible::Id so that we can use the QAccessible::deleteAccessibleInterface function for deleting the instances. Test Plan: I wasn't able to reproduce the crash in the first place, but I have just opened and closed Dolphin a few times and verified the the QAccessibleInterface instances are correctly cleaned up. Reviewers: #dolphin, elvisangelaccio, ngraham Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19083 M +15 -10 src/kitemviews/kitemlistviewaccessible.cpp M +7 -1 src/kitemviews/kitemlistviewaccessible.h https://commits.kde.org/dolphin/c72fdaa77380ef811dfef626a4edadbb824ed252 The fixed would need to be committed to 18.12 branch if the fix should appear in 18.12.3. Yes, that's in progress. :) Git commit b1ccec70f28fefca8fcd464ec21dd13070c72e5c by David Hallas. Committed on 18/02/2019 at 19:21. Pushed by hallas into branch 'Applications/18.12'. Fix crash during shutdown Summary: Fix crash during shutdown. The root cause is that when Dolphin in stopped as part of an activity, the KItemListViewAccessible destructor is called after QApplication::exec has returned causing Qt to already having cleaned up the QAccessibleInterface instances kept in KItemListViewAccessible. Instead of storing the pointers to QAccessibleInterface we store the QAccessible::Id so that we can use the QAccessible::deleteAccessibleInterface function for deleting the instances. Test Plan: I wasn't able to reproduce the crash in the first place, but I have just opened and closed Dolphin a few times and verified the the QAccessibleInterface instances are correctly cleaned up. Reviewers: #dolphin, elvisangelaccio, ngraham Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19083 M +15 -10 src/kitemviews/kitemlistviewaccessible.cpp M +7 -1 src/kitemviews/kitemlistviewaccessible.h https://commits.kde.org/dolphin/b1ccec70f28fefca8fcd464ec21dd13070c72e5c Should be there now :) Created attachment 118487 [details]
New crash information added by DrKonqi
dolphin (18.12.2) using Qt 5.12.0
- What I was doing when the application crashed:
Just a Dolphin instance open with an open terminal then loging out is needed to trigger.
-- Backtrace (Reduced):
#7 0x00007fa28d1547ca in QAccessible::registerAccessibleInterface (iface=0x5584fc9ea7d0) at accessible/qaccessible.cpp:746
#8 0x00007fa28eb89a4d in KItemListViewAccessible::~KItemListViewAccessible() () from /usr/lib64/libdolphinprivate.so.5
#9 0x00007fa28eb89b19 in KItemListViewAccessible::~KItemListViewAccessible() () from /usr/lib64/libdolphinprivate.so.5
#10 0x00007fa28d15a743 in QAccessibleCache::deleteInterface (this=this@entry=0x5584fc28e5f0, id=<optimized out>, obj=<optimized out>, obj@entry=0x0) at accessible/qaccessiblecache.cpp:153
#11 0x00007fa28d15ad70 in QAccessibleCache::~QAccessibleCache (this=0x5584fc28e5f0, __in_chrg=<optimized out>) at accessible/qaccessiblecache.cpp:67
Created attachment 118488 [details]
New crash information added by DrKonqi
dolphin (18.12.2) using Qt 5.12.0
- What I was doing when the application crashed:
Just a Dolphin instance open with an open terminal then loging out is needed to trigger.
-- Backtrace (Reduced):
#7 0x00007fa28d1547ca in QAccessible::registerAccessibleInterface (iface=0x5584fc9ea7d0) at accessible/qaccessible.cpp:746
#8 0x00007fa28eb89a4d in KItemListViewAccessible::~KItemListViewAccessible() () from /usr/lib64/libdolphinprivate.so.5
#9 0x00007fa28eb89b19 in KItemListViewAccessible::~KItemListViewAccessible() () from /usr/lib64/libdolphinprivate.so.5
#10 0x00007fa28d15a743 in QAccessibleCache::deleteInterface (this=this@entry=0x5584fc28e5f0, id=<optimized out>, obj=<optimized out>, obj@entry=0x0) at accessible/qaccessiblecache.cpp:153
#11 0x00007fa28d15ad70 in QAccessibleCache::~QAccessibleCache (this=0x5584fc28e5f0, __in_chrg=<optimized out>) at accessible/qaccessiblecache.cpp:67
This bug is marked as being fixed in 18.12.3; there is no need to post additional crash reports from 18.12.2 or earlier. We'll be interested to know if you still see it in 18.12.3 once that's released though! OS: Arch x86_64 DE: KDE 5.55.0 / Plasma 5.15.2 dolphin 18.12.3-1 The patch has fixed the issue for me (I have and use only one "KDE Plasma activity") Initial bug (now marked RESOLVED DUPLICATE) : https://bugs.kde.org/show_bug.cgi?id=403216 Thank you for the work ! |