Summary: | Feeds list gets corrupted when akregator is restored on log in | ||
---|---|---|---|
Product: | [Applications] akregator | Reporter: | Christian Boltz <kde-bugs> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | grave | CC: | andrius, arthur, asturm, bitlord0xff, cruzki123, Der_L, edwardb_kde, flateric, frederic.coiffier, jaak, jjm, jsardid, kdebugs, keplicz, linux, linux, mark, montel, pauli.prokki, schwarzer, someuniquename, stoffepojken, stupor_scurvy343, swesemeyer, tomas.nackaerts, xrigou |
Priority: | NOR | ||
Version: | 5.5.2 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/akregator/6678efb711e2cc6ee852e7331ff5185ddeba872d | Version Fixed In: | 5.7.3 |
Sentry Crash Report: | |||
Attachments: | Exit slotSaveFeedList() if feed is empty without writing anyfiles |
Description
Christian Boltz
2017-07-02 18:16:29 UTC
I can confirm this behaviour on Arch Linux, same version. Though it does not occur regulary. It does crash on start, like in the other bug reports. And sometimes the complete feed list is lost. Possibly a duplicate of bug 381822. Anyway, I started to see this problem as well and it started exactly after I upgraded Qt from 5.8.0 to 5.9.1. I did rebuild Akregator and it's dependencies (up from Qt, obviously), but that didn't help either. Just wanted to add that I observed this bug as well when I close Akregator manually. (In reply to Bernd Steinhauser from comment #3) > Just wanted to add that I observed this bug as well when I close Akregator > manually. Please define "close manually" ;-) a) click the "x" icon to close the window b) press Alt+F4 c) press Ctrl+q d) using the menu File - Quit a) and b) only close the main window, Akregator will still run and display its tray icon. c) and d) will really quit Akregator - and after closed this way, I've never seen the trashed feed list IIRC. (In reply to Christian Boltz from comment #4) > (In reply to Bernd Steinhauser from comment #3) > d) using the menu File - Quit I chose e) right-click on the tray icon and choose Quit, which should be the same thing. Next start of Akregator (without rebooting) -> list trashed Maybe I should add that I've seen the corruption after quitting Akregator only once (out of 10-20 times), it seems much more unlikely. When you don't specifically close Akregator before reboot, it seems much more likely that the list gets corrupted (maybe 2 out of 3 times). To me this smells like some sort of race condition. (In reply to Bernd Steinhauser from comment #2) > Possibly a duplicate of bug 381822. > unrelated to this report. Akregator doesn't crash. Just tried again and it's definitely not only on log in. Took me maybe 10 restarts of Akregator until I got the message that the feed list is corrupted. In that case it also told me that Akregator didn't close properly, although there was no indication of a crash (no coredump, no bug message etc.). did it start refreshing a feed when you closed it ? (In reply to Christophe Giboudeaux from comment #9) > did it start refreshing a feed when you closed it ? Sorry, did not pay attention to that, so can't really tell. Afterwards, I did try to enforce that by hitting the fetch all feeds button and then closing Akregator, but it didn't trigger this. I can confirm this with Akregator 5.6.1 on openSUSE Tumbleweed. KDE Frameworks 5.38.0 Qt 5.9.1 (built against 5.9.1) The xcb windowing system WORKAROUND to restore feeds: Despite window said that the backup was saved - it was empty file. I managed to resore my feeds from file:///home/u1/.local/share/akregator/Archive/feedlistbackup.mk4 - that file holds history. I opened it with kate and noticed that it is a binary file, but parts of it has exact same xml structure as my lost feeds.opml. So i found part that looked like my most recent feeds list (<outline >...</outline>) and copied it into file:///home/u1/.local/share/akregator/data/feeds.opml *** Bug 386000 has been marked as a duplicate of this bug. *** *** Bug 384223 has been marked as a duplicate of this bug. *** I have been trying to debug this and have now reached a point where I can reproduce it every time under the debugger (kdevelop). This is what happens: 1. akregator starts with a healthy feeds.opml and creates a similar feeds.opml~ 2. I do some stuff and then close the window and terminate the program from the system tray icon. 3. In MainWidget::slotOnShutdown(), setFeedList is called with an empty list. 4. Upon setFeedList() exit a QSharedPointer<FeedList> oldList which holds the feedlist is deleted. 5. In ~FeedList() destructor, setRootNode(0) is called. 6. In setRootNode(0), delete d->rootNode truncates feeds.opml to length of 1 byte. 7. The program exits NORMALLY. At this point feeds.opml~ contains a good backup. 8. On next program start, feeds.opml is "saved" to feeds.opml~ effectively destroying it. The program complains for an invalid feed list and saves an equally useless feeds.opml-backup.* Does that help at all? Is there anything I can do? Thanks Christos for the analysis. Do you think you are able to suggest a patch to fix this issue? Just wanted to add that this also happens on Fedora 26 and 27 (with all updates applied). The procedure in Comment 14 also works for me, ie it reproducible destroys the feeds every time. Otherwise, the feed corruption is more hit and miss, ie it doesn't happen every time I start Akregator but often enough to be annoying. Unfortunately, with the updated 17.12.0 sources I cannot reproduce it in the debugger, no matter what. On the bright side, the corruption has not occured once since the update. We'll see. Did anyone else see feedlist corruption with the 17.12.x release (Akregator version 5.7.x)? (In reply to Christoph Feck from comment #18) > Did anyone else see feedlist corruption with the 17.12.x release (Akregator > version 5.7.x)? Yes, I have it too on 17.12.1 with Qt 5.9.3. (In reply to Christoph Feck from comment #18) > Did anyone else see feedlist corruption with the 17.12.x release (Akregator > version 5.7.x)? still happens with version 5.7.1 When I shutdown akregator (from gentoo's 17.12.1 package) I experience this problem and get the following output at the terminal: [1:1:0205/180714.662998:ERROR:broker_posix.cc(41)] Invalid node channel message [1:1:0205/180714.674483:ERROR:broker_posix.cc(41)] Invalid node channel message [1:1:0205/180714.686681:ERROR:broker_posix.cc(41)] Invalid node channel message [1:1:0205/180714.697479:ERROR:broker_posix.cc(41)] Invalid node channel message kf5.kxmlgui: 0x563be92f3b10 deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes. [1:1:0205/180714.727815:ERROR:broker_posix.cc(41)] Invalid node channel message [1:1:0205/180714.727927:ERROR:broker_posix.cc(41)] Invalid node channel message [1:1:0205/180714.728664:ERROR:broker_posix.cc(41)] Invalid node channel message [1:1:0205/180714.728952:ERROR:broker_posix.cc(41)] Invalid node channel message Perhaps its a different issue, but it does happen when I exit akregator (and when I start the feed has to be reimported). Created attachment 110511 [details]
Exit slotSaveFeedList() if feed is empty without writing anyfiles
The last time slotSaveFeedList() was being called with an empty feed list. The attached patch checks to see if the feed is null, and if so, returns without writing any files.
Thanks for the proposed patch. I was hit by that problem today and am still panicking a bit while restoring my feeds. :D I am not that familiar with the Qt pointers but might a QScopedPointer be enough here? Sorry. Its been a long time since I did any c++. I tried changing to: + QScopedPointer<FeedList> f_list = m_mainWidget->allFeedsList(); + if (f_list.isNull()) { + return; + } + And got the following error: /var/tmp/portage/kde-apps/akregator-17.12.1/work/akregator-17.12.1/src/akregator_part.cpp: In member function ‘void Akregator::Part::slotSaveFeedList()’: /var/tmp/portage/kde-apps/akregator-17.12.1/work/akregator-17.12.1/src/akregator_part.cpp:529:65: error: conversion from ‘QSharedPointer<Akregator::FeedList>’ to non-scalar type ‘QScopedPointer<Akregator::FeedList>’ requested QScopedPointer<FeedList> f_list = m_mainWidget->allFeedsList(); ~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Perhaps I'm using it wrong? Thanks Mark, please submit your patch on https://phabricator.kde.org/ to get a proper review. I try to reproduce this problem but I can't. Do you launch akregator in console ? Do you launch kontact ? I can't reproduce fro the moment after 15 try I didn't have this bug... It happens in my setup: * up-to-date Neon User edition, * kontact is started using the session on login, * kontact sometimes crashes on logout (I'm unable to get the trace since DrKonqi quits when the session ends a couple of seconds after the crash), * on next login, kontact starts and akregator's feeds list is empty. @Mark: Nah, it's more likely that my comment was stupid. :D I did not look at the API so a shared pointer will likely be the way to go. But as Andreas said, going through proper code review will be better anyway. @Laurent: for me it is just plain Akregator being started and stopped by KDE session management. The problem only hit me once so far, though. This happens to me with Akregator embedded in Kontact. It doesn't happen 100% of the times, but it does quite frequently. Cannot tell for sure, but I have the feeling that this happens more frequently when I set Kontact to autostart at login (perhaps because the system under larger load ? or perhaps its just my false impression). We have been testing attached patch on Gentoo. So far feeds did not get corrupted when this patch was applied. Without it we saw some reports fairly quickly. Mark, your action is required for the phabricator revision to proceed, did you receive a notification? Git commit 6678efb711e2cc6ee852e7331ff5185ddeba872d by Laurent Montel. Committed on 26/02/2018 at 05:47. Pushed by mlaurent into branch 'Applications/17.12'. Apply patch from mgannon Prevent Akregator from overwriting feeds.opml with an emtpy feed list FIXED-IN: 5.7.3 Quitting akregator causes ~/.local/share/akregator/data/feeds.opml to be overwritten using an empty feed list with the result that upon relaunching an error message appears and only the standard built in feeds are available. In troubleshooting the issue, I noticed that slotSaveFeedList() is called five times between quitting the program and the program is finally shutdown. It is only the last time that the function is called with an empty list. This implies that there might be an error in the slot logic, since the function should only need to be called once. The attached patch seemed the easiest way to deal with the issue. Test Plan i. Start a clean installation of akregator. ii. Import a list of feeds from an opml file. iii. Logout from the kde desktop iv. Login into the kde desktop. Without the patch, an error message appears saying it is unable to open the file. Differential Revision: https://phabricator.kde.org/D10466 M +4 -0 src/akregator_part.cpp https://commits.kde.org/akregator/6678efb711e2cc6ee852e7331ff5185ddeba872d |