mvf / qolibri

Continuation of the qolibri EPWING dictionary/book reader
GNU General Public License v2.0
168 stars 13 forks source link

qolibri is freezing when I do a search #48

Closed ltsdw closed 2 years ago

ltsdw commented 2 years ago

os: arch linxu qolibri version: 2.1.4-3

like, the last time I used it was at 09 of may (it was working normally), and since then I made two updates of my system, so I can't pin point what break it.

also, it freezes when I search for books. tried removing the books and tried adding them again, but it freezes. It also freezes when pressing ctrl+o, ctrl+d and probably freezes when doing other stuffs that I didn't tested.

here is a list with 190 packages that were updated since the last time it was working (maybe you see something that I didn't):

upgraded-package-list.txt

I tried downgrading the qt5 related stuff, but didn't worked. also tried looking for a way to see if it outputs something to the terminal, but I think the binary wasn't compiled with debug mode so it doesn't outputs nothing (or maybe I don't know how to activate the debug mode).

edit:

tried creating a new user and isn't freezing there. I think it may be the books, tried deleting the cache and config, and when trying to add the books again it freezes. But as I said it was working the last time I used it, didn't changed nothing related to the books.

ltsdw commented 2 years ago

discovered how to get logs, here a log with *QT_LOGGING_RULES="=true; qt.qpa.events=false; qt.qpa.input.events=false; qt.widgets.gestures=false"**: qtlogs.txt

I disabled the input.events and widgets.gestures because it was outputting too much but if you need them let me know.

after it freezes it keeps outputting lines like qt.qpa.events.reader: [heap] 209 when I click, move the mouse etc.

mvf commented 2 years ago

TL;DR: Rebuilding qolibri against your upgraded system should fix it. Happy to help debug if it doesn't of course. :wink:


Thanks for the detailed report. My suspicion is that you're deadlocking due to ABI mismatch. From the update log:

[2022-05-14T03:16:07-0300] [ALPM] upgraded libeb (4.4.3-4 -> 4.4.3-7)

With 4.4.3-7, the AUR libeb maintainer enabled the pthread flag. This adds mutexes to many libeb structures and litters the library code with pthread_mutex_lock calls. The structs allocated by the qolibri binary (which is built against the old libeb headers) don't have those mutexes yet, so the library will try to pthread_mutex_lock whatever else is at those offsets → deadlock.

ltsdw commented 2 years ago

Thank you, I recompiled (I was using the binary package) and it doesn't freeze anymore.

But now when adding certain books and searching for any term it crashes with this message log:

qolibri: tpp.c:83: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio >= fifo_min_prio && new_prio <= fifo_max_prio)' failed.
zsh: IOT instruction  qolibri

edit:

now it's a different one:

qolibri: pthread_mutex_lock.c:438: __pthread_mutex_lock_full: Assertion `e != ESRCH || !robust' failed.

didn't do anything (no updates neither), it just start crashing.

but as you said, I think it's due to libeb, so I decided to keep it downgraded, downgrading it doesn't freeze it and doesn't crash it anymore.

ltsdw commented 2 years ago

actually I decided to recompile libeb without --enable-pthread flag. it's working like always :)

so, as I don't think this is a issue related to qolibri itself, I don't know where should I close this or not. please feel free to close it.

again, thank you so much for your help.

mvf commented 2 years ago

Thanks again for reporting this, it is indeed a libeb bug. Same as before, it pthread_mutex_locks something that's not a mutex. But this time, the memory looks like a mutex of a different kind, so there's a crash instead of a deadlock. I have proposed a fix on the libeb AUR page.