kiwix / kiwix-tools

Command line Kiwix tools: kiwix-serve, kiwix-manage, ...
https://download.kiwix.org/release/kiwix-tools/
GNU General Public License v3.0
428 stars 83 forks source link

kiwix-serve was SIGSEGV-ed while performing search after running for a while #573

Closed DarkmatterUAE closed 1 year ago

DarkmatterUAE commented 1 year ago

kiwix-serve running on armhf platform failed with segmentation fault after running for some time (at least for a few days), while I was searching something. Running kiwix-serve with --verbose captured some logs but it seems not very helpful.

Logs: https://www.verybin.com/?343fca9b5395a26b#fyMr9ZfziGmWSbhfN8Ob9UerV3K+5JvsynUrSj9iSbA=

Platform architecture: armhf OS Version: Armbian (5.88) armv7l based on Debian 11 Bullseye Linux kernel version: 5.1.0 Kiwix-tools version: 3.3.0 (downloaded from download.kiwix.org)

kelson42 commented 1 year ago

@DarkmatterUAE You confirm you have compiled the binary yourself? Could you please post here the result of kiwix-serve --version?

DarkmatterUAE commented 1 year ago

I downloaded it from download.kiwix.org , sorry for my bad memory. https://download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-armhf-3.3.0.tar.gz

kiwix@darkmatter-sbc:~# kiwix-serve --version kiwix-tools 3.3.0

libkiwix 11.0.0

libzim 7.2.2

kelson42 commented 1 year ago

@DarkmatterUAE OK, so I guess, if you redo the same the kiwix-serve does not crash? Do you have other ZIM files served in addition to wikipedia_en_all_nopic_2022-01? What is the md5sum of your wikipedia_en_all_nopic_2022-01.zim?

DarkmatterUAE commented 1 year ago

This bug is kind of strange, it almost never reproduce, but all the time it crashes kiwix-serve crash during my visit (it always crashes when I have one or two pages opened, or is searching something. It have not crashed once while it's just running in the background and no one is reading), and it has not crashed in the first few days of starting up.

I don't have any other ZIM files served from this platform, though I do start it with command kiwix-serve --port=8888 -b -d ./download/*.zim

md5sum is: 2d53685c97764164e5ff51d1dbeff923 wikipedia_en_all_nopic_2022-01.zim The same md5sum as shown in the magnet link.

DarkmatterUAE commented 1 year ago

I managed to let strace traced the process and reproduced the bug just by repeatedly searching random strings. Will the logs be helpful?

kelson42 commented 1 year ago

@DarkmatterUAE Thx for all the information. The trace might be useful yes. It seems you have no obvious problem so it might be a bug in the software indeed. You could maybe try with a nighlty from http://download.kiwix.org/nightly/2022-09-04/ considering that we will do a new release soon.

@veloman-yunkan Could you please take the lead on this bug report?

DarkmatterUAE commented 1 year ago

The last few hundred lines of trace is posted here: https://www.verybin.com/?a25797f616f33e0b#8DwfkmPufvbgrhAPkuI53S4otfNm/myE8kTuA0/pJA0=

Please comment if you need the full log.

kelson42 commented 1 year ago

@DarkmatterUAE Thx, out of curiosity, you run on wich hardware? Would you be able to generate a core dump?

DarkmatterUAE commented 1 year ago

@kelson42 I can try, how can I generate the core dump file? I'm using a single-board computer, sorry that I can't disclose what specific hardware I am using.

kelson42 commented 1 year ago

@DarkmatterUAE Here is a tutorial https://jvns.ca/blog/2018/04/28/debugging-a-segfault-on-linux/

DarkmatterUAE commented 1 year ago

Got it. Core dump file link: https://send.tresorit.com/a#-KzVhn3ZZHw3BRInnO71ew

DarkmatterUAE commented 1 year ago

Oh, sorry. Forgot to mention that, before trying to create core dump I updated kiwix-serve to 3.3.0-1, link below: https://download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-armhf-3.3.0-1.tar.gz

kiwix-serve --version:

kiwix-tools 3.3.0

libkiwix 11.0.0

  • libzim 8.0.0
  • libxapian 1.4.18
  • libcurl 7.67.0
  • libmicrohttpd 0.9.72
  • libz 1.2.12
  • libicu 58.2.0
  • libpugixml 0.12.0

libzim 8.0.0

  • libzstd 1.5.2
  • liblzma 5.2.4
  • libxapian 1.4.18
  • libicu 58.2.0
kelson42 commented 1 year ago

Hopefuly this is a duplicate of #579, so there will be a fix in 3.3.1

kelson42 commented 1 year ago

Closing, please reopen if not fixed in next kiwix-tools release

DarkmatterUAE commented 1 year ago

Confirm, fixed in 3.4.0. Thx :)