ahrm / sioyek

Sioyek is a PDF viewer with a focus on textbooks and research papers
https://sioyek.info/
GNU General Public License v3.0
7.19k stars 236 forks source link

Core dump when opening some pdfs #1214

Closed dunhill52 closed 2 weeks ago

dunhill52 commented 2 weeks ago

On the development branch [84030b7], I'm unable to open some documents. It seems there is a problem retrieving information from the database. Launched from the command line I get the following error :

ggterminate called after throwing an instance of 'std::logic_error' what(): basic_string: construction from null is not valid Aborted (core dumped)

I know nothing about gdb and here what I managed to extract from the core dump:

0 0x00007ffff22a53f4 n/a (libc.so.6 + 0x963f4)

1 0x00007ffff224c120 raise (libc.so.6 + 0x3d120)

2 0x00007ffff22334c3 abort (libc.so.6 + 0x244c3)

3 0x00007ffff2497b2c _ZN9__gnu_cxx27__verbose_terminate_handlerEv (libstdc++.so.6 + 0x97b2c)

4 0x00007ffff24adf3a _ZN10cxxabiv111terminateEPFvvE (libstdc++.so.6 + 0xadf3a)

5 0x00007ffff249752a _ZSt9terminatev (libstdc++.so.6 + 0x9752a)

6 0x00007ffff24ae1f6 __cxa_throw (libstdc++.so.6 + 0xae1f6)

7 0x00007ffff249b124 _ZSt19__throw_logic_errorPKc (libstdc++.so.6 + 0x9b124)

8 0x000055555558ba5a _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3EEPKcRKS3.lto_priv.0.cold (sioyek + 0x37a5a)

9 0x00005555555ed270 bookmark_select_callback (sioyek + 0x99270)

10 0x00005555557bc459 sqlite3_exec (sioyek + 0x268459)

11 0x000055555587b913 _ZN15DatabaseManager15select_bookmarkERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorI8BookMarkSaIS9_EE.isra.0 (sioyek + 0x327913)

12 0x000055555563dceb _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN8Document30load_document_metadata_from_dbEvEUlvE_EEEEE6_M_runEv.lto_priv.0 (sioyek + 0xe9ceb)

13 0x00007ffff24e1c34 execute_native_thread_routine (libstdc++.so.6 + 0xe1c34)

14 0x00007ffff22a339d n/a (libc.so.6 + 0x9439d)

15 0x00007ffff232849c n/a (libc.so.6 + 0x11949c)

I tried to delete some tables and even the databases but it keeps coming back. Strangely enough, the shared database doesn't seems to affect another computer where the documents do open fine.

I hope it helps. Feel free to ask for more information if needed.

PS: I absolutely loves the features of sioyek, many are very innovative and so useful.

ahrm commented 2 weeks ago

Did you use a previous sioyek version prior to using the development branch? If so, you need to move the previous database files into a different location and migrate them using this script: https://github.com/ahrm/sioyek/discussions/1156#discussioncomment-10614340.

dunhill52 commented 2 weeks ago

You are totally right and I apologize for not checking thoroughly on my side.

Here was the problem : two computers with a shared database, my main computer is on the dev branch (git version of the AUR package), but my laptop is on the stable branch.

I guess I started using the stable branch for a few days and, along my journey to learn more about sioyek and curious about the new features, I updated one of the computers and cleaned its databases. But I forgot the other computer was on the main branch and probably, I then shared the one database with the previous format. Something on that line. Doh!

Keep the good work, really appreciated.