Closed kelson42 closed 6 years ago
Here is my gdb backtrace full using my compiled kiwix 32bit files:
guest@debian:~/Downloads$ gdb --args kiwix-serve 3dprinting.stackexchange.com_en_all_2018-03.zim --port=8000 -v
GNU gdb (Debian 7.12-6+b1) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from kiwix-serve...done.
(gdb) run
Starting program: /usr/local/bin/kiwix-serve 3dprinting.stackexchange.com_en_all_2018-03.zim --port=8000 -v
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[New Thread 0xb52afb40 (LWP 6772)]
[New Thread 0xb48ffb40 (LWP 6773)]
[New Thread 0xb3efeb40 (LWP 6774)]
[New Thread 0xb36fdb40 (LWP 6775)]
======================
Requesting :
full_url : /suggest
method : GET (0)
version : HTTP/1.1
headers :
- Accept : 'application/json, text/javascript, */*; q=0.01'
- Accept-Encoding : 'gzip, deflate'
- Accept-Language : 'en-US,en;q=0.5'
- Connection : 'keep-alive'
- Cookie : 'pc2_see_more_module_2018_02=exposed'
- Host : 'localhost:8000'
- Referer : 'http://localhost:8000/3dprinting.stackexchange.com_en_all_2018-03/'
- User-Agent : 'Mozilla/5.0 (X11; Linux i686; rv:59.0) Gecko/20100101 Firefox/59.0'
- X-Requested-With : 'XMLHttpRequest'
arguments :
- content : '3dprinting.stackexchange.com_en_all_2018-03'
- term : 'd'
Parsed :
url : /suggest
acceptEncodingDeflate : 1
has_range : 0
.............
** running handle_suggest
Searching suggestions for: "d"
Thread 5 "MHD-worker" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb36fdb40 (LWP 6775)]
0xb7eab928 in zim::Fileheader::getArticleCount (this=0x34)
at ../include/zim/fileheader.h:91
91 article_index_type getArticleCount() const { return articleCount; }
(gdb) backtrace full
#0 0xb7eab928 in zim::Fileheader::getArticleCount (this=0x34)
at ../include/zim/fileheader.h:91
No locals.
#1 0xb7eab97b in zim::FileImpl::getCountArticles (this=0x0)
at ../src/fileimpl.h:86
No locals.
#2 0xb7eb09c8 in zim::FileImpl::getDirent (this=0x0, idx=...)
at ../src/fileimpl.cpp:257
v = {first = true,
second = std::shared_ptr<const zim::Dirent> (use count 1720739523, weak count 1720739471) = {get() = 0xb36fcc98}}
indexOffset = {<REAL_TYPEDEF<unsigned long long>> = {
v = 13254480734529150976}, <No data fields>}
bufferSize = {<REAL_TYPEDEF<unsigned long long>> = {
v = 13235095632777052160}, <No data fields>}
dirent = std::shared_ptr<const zim::Dirent> (use count -1, weak count -1209392370) = {get() = 0x3f91ce00}
#3 0xb7ea234c in zim::Article::getDirent (this=0xb2b65734)
at ../src/article.cpp:108
No locals.
#4 0xb7ea2419 in zim::Article::getTitle[abi:cxx11]() const (this=0xb2b65734)
at ../src/article.cpp:118
No locals.
---Type <return> to continue, or q <return> to quit---
#5 0xb7f71095 in kiwix::Reader::searchSuggestionsSmart (this=0x4f5a10,
prefix="d", suggestionsCount=10) at ../src/reader.cpp:697
suggestion = std::vector of length 0, capacity 0
current = {<std::iterator<std::bidirectional_iterator_tag, zim::Article, int, zim::Article*, zim::Article&>> = {<No data fields>},
internal = std::unique_ptr<zim::search_iterator::InternalData> = {
get() = 0xb2b65720}}
variants = std::vector of length 4, capacity 4 = {"d", "D", "d", "D"}
retVal = false
suggestionSearch = 0xb2b09500
#6 0x0040f706 in handle_suggest (request=0xb36fd02c)
at ../src/server/kiwix-serve.cpp:419
content = "["
mimeType = ""
maxSuggestionCount = 10
suggestionCount = 0
suggestion = ""
humanReadableBookId = "3dprinting.stackexchange.com_en_all_2018-03"
term = "d"
reader_searcher = {first = 0x4f5a10, second = 0x5cde20}
reader = 0x4f5a10
searcher = 0x5cde20
deflated = false
---Type <return> to continue, or q <return> to quit---
#7 0x00412f7d in accessHandlerCallback (cls=0x0, connection=0xb2b005f0,
url=0xb2b00714 "/suggest", method=0xb2b00710 "GET",
version=0xb2b00758 "HTTP/1.1", upload_data=0x0,
upload_data_size=0xb36fd1fc, ptr=0xb2b0061c)
at ../src/server/kiwix-serve.cpp:756
request = {httpResponseCode = 200, connection = 0xb2b005f0,
full_url = "/suggest", url = "/suggest", valid_url = true,
method = RequestMethod::GET, version = "HTTP/1.1",
acceptEncodingDeflate = true, accept_range = false, range_pair = {
first = 0, second = -1}, headers = std::map with 9 elements = {
["Accept"] = "application/json, text/javascript, */*; q=0.01",
["Accept-Encoding"] = "gzip, deflate",
["Accept-Language"] = "en-US,en;q=0.5",
["Connection"] = "keep-alive",
["Cookie"] = "pc2_see_more_module_2018_02=exposed",
["Host"] = "localhost:8000",
["Referer"] = "http://localhost:8000/3dprinting.stackexchange.com_en_all_2018-03/",
["User-Agent"] = "Mozilla/5.0 (X11; Linux i686; rv:59.0) Gecko/20100101 Firefox/59.0", ["X-Requested-With"] = "XMLHttpRequest"},
arguments = std::map with 2 elements = {
["content"] = "3dprinting.stackexchange.com_en_all_2018-03",
["term"] = "d"}}
---Type <return> to continue, or q <return> to quit---
response = 0xb7def5a9 <connection_add_header+41>
ret = 1
#8 0xb7dee1a5 in call_connection_handler (
connection=connection@entry=0xb2b005f0) at connection.c:2284
processed = 0
#9 0xb7defd40 in MHD_connection_handle_idle (connection=<optimized out>)
at connection.c:3361
daemon = <optimized out>
line = <optimized out>
line_len = 80
ret = <optimized out>
#10 0xb7df1e8d in call_handlers (con=0xb2b005f0, read_ready=<optimized out>,
read_ready@entry=true, write_ready=<optimized out>, force_close=false)
at daemon.c:1113
ret = <optimized out>
states_info_processed = false
on_fasttrack = true
#11 0xb7df67dc in MHD_poll_all (may_block=<optimized out>, daemon=0x5ed958)
at daemon.c:3689
i = 0
timeout = <optimized out>
poll_server = 1
poll_listen = 0
---Type <return> to continue, or q <return> to quit---
poll_itc_idx = <optimized out>
ltimeout = 13249748436479934811
p = 0xb2b08740
ls = <optimized out>
urh = <optimized out>
num_connections = 1
pos = <optimized out>
prev = 0x0
urhn = <optimized out>
#12 MHD_poll (daemon=daemon@entry=0x5ed958, may_block=may_block@entry=1)
at daemon.c:3837
No locals.
#13 0xb7df6fcc in MHD_poll (may_block=1, daemon=0x5ed958) at daemon.c:4440
No locals.
#14 MHD_polling_thread (cls=0x5ed958) at daemon.c:4424
daemon = 0x5ed958
#15 0xb7c303a6 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
No symbol table info available.
#16 0xb7b484c6 in clone () from /lib/i386-linux-gnu/libc.so.6
No symbol table info available.
(gdb)
Also here is the kiwix-32bit files you want: https://drive.google.com/drive/folders/1l5-lAdbByVe1oac3C7WJVX_W07Y63ih5
@godane Can you please try to not mix things? You obviously have a specific problem with your arch/system which is (until the contrary is proven) unrelated to that issue. Stick to your ticket.
@kelson42 Sorry. I only mixed things with this cause its the same error and the same way. I type q in search of either one of these zims and it will crash very much the same way. I really don't know if its x86/32-bit bug. Thats really just a best guess cause you guys run x86_64 only and don't have this problem. Maybe i need a copy of your OS you guys are using? Like a full dpkg package list or something. I'm really have no idea way this bug on my system happens in least i have a copy of your OS. I'm just guess its x86 related. I may very will be a configurion on your system that i don't know about.
@godane Without further information it is better to keep things separated. If they are related we will mark them as related and close all of them in the same time. If they are not, we will already have different issues. If we mix every thing, it will be very difficult to fix and close issue separately.
@kelson42 I can confirm the issue. It is due to the commit https://github.com/openzim/zimwriterfs/commit/12b8b4e1c70409854471fb7b323fc7578212775a I've added related to this issue https://github.com/kiwix/kiwix-lib/issues/110 Now, the url of the indexed article starts with a '/' and zimlib awaits url starting directly with the namespace.
@mgautierfr Ok but we can not break bacward compatibility that way.
@kelson42 Yes, it is a description of the problem. Not a WONTFIX explanation :) I already have a fix.
@mgautierfr the problem is that it seems that "older" kiwix-serve versions do not work properly (Kiwix android, Kiwix iOS). I do not really understand how you could bring back the compatibility without rollbacking that specific commit.
I've just made libzim handle url starting with a /
.
@mgautierfr OK, but now we have a ZIM file which seems to bring all existing kiwix-serve binaries to crash. What is the solution?
Wait for next kiwix-serve binary.
With kiwix-serve from kiwix-tools_linux64-2018-03-15.tar.gz