kiwix / kiwix-desktop

Kiwix for Windows and GNU/Linux desktops
https://download.kiwix.org/release/kiwix-desktop/
GNU General Public License v3.0
744 stars 97 forks source link

App should not crash at start if one of the ZIM file is corrupted #1128

Closed kelson42 closed 3 weeks ago

kelson42 commented 3 months ago

I have achieved to get a corrupted ZIM file, see https://github.com/kiwix/kiwix-desktop/issues/1127 for the details.

Trying to open the file, Kiwix just crashes. Here the details: https://tmp.kiwix.org/corrupted_zim_crash/

When I restart Kiwix, it crash at start and I can not use Kiwix at all anymore

What I expect: If there is crash by reading a ZIM file, I expect Kiwix to detect it and stop (somehow) crashing when I restart it.

veloman-yunkan commented 1 month ago

@kelson42 Can you check if the kiwix-desktop crash was fixed by openzim/libzim#895?

kelson42 commented 1 month ago

@veloman-yunkan Indeed, I have retested again.

$ ./kiwix-desktop
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
add widget
terminate called after throwing an instance of 'zim::ZimFileFormatError'
  what():  Error parsing cluster. Offsets are not ordered.
Aborted (core dumped)

But it seems that this time this is because the exception is not catched (properly).

Maybe you can fix this at the same time?