Closed ghost closed 4 years ago
I can reproduce with just the combination of the following two config lines (either line on their works fine):
auto-reload yes
feed-sort-order lastupdated
in combination with the following urls file (old file used for testing previous issues):
https://export.arxiv.org/rss/cs.PL
http://antirez.com/rss test abc
https://eklitzke.org/index.rss test
http://www.aerialmantis.co.uk/feed.xml
http://rss.slashdot.org/Slashdot/slashdot
file:///home/dennis/projects/newsboat/test-feed.xml abc
https://newsboat.org/news.atom abc def
https://dennisschagt.nl/invalid def
"query:Unread Articles:unread = \"yes\""
"query:Unread Articles:unread # \"yes\""
https://daten.berlin.de/datensaetze/rss.xml
https://blog.debiania.in.ua/feeds/english.atom
"query:Blogroll for Take on Rules:tags # \"abc\""
"query:Contains the (with include oper):content # \"the\""
"query:Contains the (with regexp):content =~ \"the\""
# Youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UCYO_jab_esuFRV4b17AJtAw youtube
https://www.youtube.com/feeds/videos.xml?channel_id=UC7kIy8fZavEni8Gzl8NLjOQ youtube
# issue 38
http://feed.williamlong.info/
# issue 335
https://www.reddit.com/r/C_Programming/.rss
https://www.reddit.com/r/C_Programming/comments/9vz2y2/tricks_for_avoiding_void_when_implementing/.rss
# issue 1016
https://tbgforums.com/forums/extern.php?action=feed&tid=5416&type=atom
https://bbs.archlinux.org/extern.php?action=feed&tid=239217&type=atom
The first time starting (without a cache file) works fine. After quitting, Newsboat does not start successfully anymore (Segmentation fault every time).
The configured URLs does seem to make a difference, the issue did not reproduce when I only kept a few URLs.
It looks like this issue requires some specific timing to reproduce (I can reproduce when building with -O0 but not with optimization -O2).
Git bisect points to commit https://github.com/newsboat/newsboat/commit/95c1b5dae4a842247f31b6ed90310cab7620575a, which makes sense as that commit has some changes related to the feed-sort-order
configuration (I'm not completely certain as this apparent race condition might have interfered (false negative) with any of the bisection steps).
I bisected debug builds (make PROFILE=1 newsboat
) which I ran three times in a row to soften the effect of false positives; I ended up on the same commit as @dennisschagt.
Not clear while this would segfault, though. Investigating...
Ah, turns out FeedContainer::unread_feed_count()
doesn't acquire a mutex on FeedContainer
's core data structure, a vector of feeds. It iterates over it, while FeedListFormAction
is busy sorting that same vector.
The fix is trivial: just acquire the mutex. I'll submit a PR once I looked through other methods to check if they have the same problem.
Only happens half of the time.
I tried running with an empty config, but it didn't solve it.
On the other hand deleting cache.db always works. So I think it is cache related.
newsboat -v
output: newsboat 2.20.0 System: Linux 5.7.4-arch1-1 (x86_64) Compiler: g++ 10.1.0 ncurses: ncurses 6.2.20200212 (compiled with 6.2) libcurl: libcurl/7.70.0 OpenSSL/1.1.1g zlib/1.2.11 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh2/1.9.0 nghttp2/1.41.0 (compiled with 7.70.0) SQLite: 3.32.3 (compiled with 3.32.3) libxml2: compiled with 2.9.10Config file (copy from ~/.newsboat/config or ~/.config/newsboat/config):
Steps to reproduce the issue:
newsboat
Other info:
Only happens with 2.20, I tried reverting to 2.19 and it works as expected.
I installed it from the Arch official repo.
I have ~50 youtube channels in the urls file and ~20 other rss.