lwindolf / liferea

Liferea (Linux Feed Reader), a news reader for GTK/GNOME
https://lzone.de/liferea
GNU General Public License v2.0
825 stars 128 forks source link

[1.14.4] corrupted double-linked list #1227

Closed paulgevers closed 1 year ago

paulgevers commented 1 year ago

I think the 1.14 branch is cursed :(.

I have added a dogtail based regression test to my Debian package [1]. I took 1.14.4, build it in the usual Debian way, installed the packages and ran the test on my system. It hang the system around the time it tried to open the About window. When I started liferea from the command line, I got this when I tried to do it manually. I think timing wise the killed part is probably my manually sending sigkill.

paul@mulciber ~ $ liferea

(liferea:302405): Gtk-WARNING **: 21:17:58.096: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(liferea:302405): Gtk-WARNING **: 21:17:58.096: Theme parsing error: <data>:3:36: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(liferea:302405): Gtk-WARNING **: 21:17:58.096: Theme parsing error: <data>:4:25: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(liferea:302405): Gtk-WARNING **: 21:17:58.096: Theme parsing error: <data>:5:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(liferea:302405): Gtk-WARNING **: 21:17:58.096: Theme parsing error: <data>:6:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version
corrupted double-linked list
Killed

I tried to run with --debug-all but that's a bit much (can send out-of-band). It ended with:

HTML   : Error running javascript: undefined:1:8: ReferenceError: Can't find variable: setBase
GUI    : Enabling reader mode for 'liferea://'
HTML   : loadContent() reader mode fail -> reloading without reader
CONF   : Setting last-window-state to 0
CONF   : Setting last-window-state to 0
CONF   : Setting last-window-state to 0
CONF   : Setting last-vpane-pos to 261
CONF   : Setting last-hpane-pos to 199
CONF   : Setting last-wpane-pos to 428
CONF   : Forced feed list save
CACHE  : adding vfolder: title=Important
CACHE  : adding vfolder: title=Unread
CACHE  : adding feed: source=https://xkcd.com/atom.xml interval=-1 cacheLimit=
CACHE  : adding feed: source=http://planet.debian.org/rss20.xml interval=-1 cacheLimit=
CACHE  : adding feed: source=http://feeds.feedburner.com/LifereaBlog interval=-1 cacheLimit=
CACHE  : adding feed: source=https://ponga.ch/feed/ interval=-1 cacheLimit=
CACHE  : adding feed: source=https://udd.debian.org/dmd/?email1=elbrus%40debian.org&nosponsor1=on&email2=&email3=&packages=&ignpackages=&format=rss#todo interval=-1 cacheLimit=
CACHE  : adding feed: source=https://salsa.debian.org/debian/chrony.atom?rss_token=gsiAyYBqF1yxg2hGmQBe interval=-1 cacheLimit=
CACHE  : adding feed: source=https://salsa.debian.org/ci-team.atom?rss_token=gsiAyYBqF1yxg2hGmQBe interval=-1 cacheLimit=
CACHE  : adding feed: source=https://salsa.debian.org/pascal-team.atom?rss_token=gsiAyYBqF1yxg2hGmQBe interval=-1 cacheLimit=
CACHE  : adding feed: source=https://ci.debian.net/data/feeds/a/autopkgtest.xml interval=-1 cacheLimit=
CACHE  : adding feed: source=https://ci.debian.net/data/feeds/c/cacti.xml interval=-1 cacheLimit=
CACHE  : adding feed: source=https://ci.debian.net/data/feeds/d/dbconfig-common.xml interval=-1 cacheLimit=
CACHE  : adding feed: source=https://ci.debian.net/data/feeds/f/fpc.xml interval=-1 cacheLimit=
CACHE  : adding feed: source=https://ci.debian.net/data/feeds/l/lazarus.xml interval=-1 cacheLimit=
CACHE  : adding feed: source=https://ci.debian.net/data/feeds/w/winff.xml interval=-1 cacheLimit=
PERF   : = export_OPML_feedlist took 0,001s
PERF   : = default_source_source_export took 0,001s
CONF   : Setting last-zoomlevel to 120
malloc_consolidate(): unaligned fastbin chunk detected

Killed

[1] https://salsa.debian.org/debian/liferea/-/commit/083edf85a44eb8145296026d057f541e3035e723

lwindolf commented 1 year ago

@paulgevers Thanks for reporting this. I guess I just need to fight through this.

Thanks to you I learned about dogtail today. I really like how easy one can script GTK applications with it. Would you mind copying the script for upstream?

I can reproduce the

  malloc_consolidate(): unaligned fastbin chunk detected

and at least one double free

searching for descendent of [menu | Help]: child with name="Quick Reference" (attempt 0)
Clicking on [menu item | Quick Reference]
raw click on Quick Reference [menu item | Quick Reference] at (461.0,62.5)
Mouse button 1 click at (461.0,62.5)
sleeping for 1.000000
free(): double free detected in tcache 2
Translation not found for "Help"

The double free is already present in 1.12 though, so no new problem. The unaligned fastbin chunk though seems to be 1.14 specific.

lwindolf commented 1 year ago

Have to correct myself: the double free doesn't happen in 1.12. Didn't properly make install before testing

paulgevers commented 1 year ago

Thanks to you I learned about dogtail today. I really like how easy one can script GTK applications with it. Would you mind copying the script for upstream?

No, I'm fine if you take everything. As noted in the script, I got most of it from josch. I'll ask him too.

lwindolf commented 1 year ago

@paulgevers With 58ca297 I cannot reproduce the problem anymore. This should fix it.

josch commented 1 year ago

As far as i'm concerned, feel free to take the code from https://salsa.debian.org/ci-team/autopkgtest-help/-/issues/6 and use it with whatever license most convenient to you. Since liferea is GPL2, that's probably the one you'd like to use because it makes the whole copyright mess easier. :)

If you want to add a copyright header, you can (but don't have to) use this:

Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>

Thanks!

lwindolf commented 1 year ago

@josch I've added the script as src/tests/ui-test.py with GPLv2+later as this will make it easier to update to GPLv3 one day in a far future. I hope you don't mind.

paulgevers commented 1 year ago

@paulgevers With 58ca297 I cannot reproduce the problem anymore. This should fix it.

In a quick check, things seem to be fine now indeed.

josch commented 1 year ago

@lwindolf thank you! I'm fine with GPL2+. I also see that you added my name. Don't forget though, that I only authored the version of the script that @paulgevers then modified, so paul also has copyright on it. :)

lwindolf commented 1 year ago

True, will update this!