newsboat / newsboat

An RSS/Atom feed reader for text terminals
https://newsboat.org/
MIT License
2.98k stars 215 forks source link

Deadlock when filtering on `unread_count` in itemlist #2145

Open dennisschagt opened 2 years ago

dennisschagt commented 2 years ago

Newsboat version: commit cc4a932251b68a3d45922e876b0a32c44dc6a333 (local master)

Config file:

define-filter "unread filter" "unread_count > 0"

Steps to reproduce the issue:

  1. Enter a feed

  2. Press f to switch to the filter selection screen

  3. Press ENTER to select the pre-defined filter

The screen keeps showing the filter selection dialog and newsboat no longer responds to key presses.

Other info you think is relevant: image

juntuu commented 2 years ago

The lock in question is the feed's item_lock. This is first taken by do_update_visible_items(), and then later in the call stack by unread_item_count().

https://github.com/newsboat/newsboat/blob/cc4a932251b68a3d45922e876b0a32c44dc6a333/src/itemlistformaction.cpp#L924-L930

https://github.com/newsboat/newsboat/blob/cc4a932251b68a3d45922e876b0a32c44dc6a333/src/rssfeed.cpp#L82-L84