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

Periodic crash when navigating between items #1182

Closed mhoran closed 1 year ago

mhoran commented 1 year ago

I haven't had the chance to debug much yet, but I have been getting some periodic crashes navigating between items in a feedlist via TheOldReader subscription. Backtrace:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f05970ce83a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
[Current thread is 1 (Thread 0x7f0592a12ac0 (LWP 159501))]
(gdb) bt
#0  0x00007f05970ce83a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f05972f23b9 in g_str_equal ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x000055d0142f991c in google_reader_api_edit_action_complete (
    result=0x55d0154ebdc0, userdata=0x55d0156950c0, flags=<optimized out>)
    at google_reader_api_edit.c:164
#3  0x000055d0142e896a in update_process_result_idle_cb (
    user_data=0x55d014f837a0) at ../update.c:773
#4  0x00007f0597303d6f in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f0597304118 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f05973041cf in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f059756e545 in g_application_run ()
   from /lib/x86_64-linux-gnu/libgio-2.0.so.0
#8  0x000055d0142df4e9 in liferea_application_new (argc=1, argv=0x7ffce589b1b8)
    at ../liferea_application.c:351
#9  0x00007f0596f98d0a in __libc_start_main ()
   from /lib/x86_64-linux-gnu/libc.so.6
#10 0x000055d0142ce83a in _start ()
mhoran commented 1 year ago
163         // FIXME: suboptimal check as some results are text, some XML, some JSON...
164         if (!g_str_equal (result->data, "OK")) {
165                 if (result->data == NULL) {
166                         failed = TRUE;

This seems to be the issue here, where a NULL is passed into g_str_equal, which is undefined. Oddly there is a NULL check below the g_str_equal check, but the undefined behavior happens before this.

lwindolf commented 1 year ago

@mhoran Thanks for reporting this. I think above commit should fix this (reordering the checks). Would be great if you could retest.

mhoran commented 1 year ago

Awesome, thanks! I think this was due to poor hotel Wi-Fi. I applied the patch and tried to simulate a bad connection to theoldreader.com by adding a hosts entry and this seems to work.