openzim / python-libzim

Libzim binding for Python: read/write ZIM files in Python
https://pypi.org/project/libzim/
GNU General Public License v3.0
62 stars 20 forks source link

python-libzim 0.0.3 segfaults when used with an updated libzim 6.3.0 #84

Closed legoktm closed 3 years ago

legoktm commented 3 years ago

In Debian, python-libzim was initially built against libzim 6.2.2. Yesterday I updated libzim to 6.3.0, with no rebuild for python-libzim, and now the python-libzim test suite segfaults:

root@16589ef33bfe:/srv/python-libzim/tests# python3 -m pytest
=============================================== test session starts ===============================================
platform linux -- Python 3.8.6, pytest-4.6.11, py-1.9.0, pluggy-0.13.0
rootdir: /srv/python-libzim
collected 20 items                                                                                                

test_libzim.py Segmentation fault (core dumped)

https://gist.github.com/legoktm/ef86b76242e853d53826d4e885391c03 is the beginning of the backtrace. I can provide full reproduction steps for a docker container if that's needed.

If I rebuild python-libzim against libzim 6.3.0, then it's all fine. But I expect that because there was no ABI bump in libzim, that updating it shouldn't cause any problems for python-libzim. Is that assumption wrong?

mgautierfr commented 3 years ago

This is probably due to the remove of zlib support (https://github.com/openzim/libzim/commit/8db2816fcf3341e8fe1c6811d6c77e8d52c69759)

While it doesn't change the libzim ABI, it now raise an exception if we try to create a zim file with zip compression. The bug is in the wrapper code that doesn't catch this exception correctly.

legoktm commented 3 years ago

Thanks for the explanation. I rebuilt the Debian package for now, so it's no longer an issue for me. I'll leave it up to you whether to close this or leave it open for "..the wrapper code that doesn't catch this exception correctly."

mgautierfr commented 3 years ago

With the work of adaptation on libzim_next I will rework this. I will close the issue then.

kelson42 commented 3 years ago

@mgautierfr Is this fixed with #82?

kelson42 commented 3 years ago

@rgaudin @legoktm @mgautierfr I propose to close this ticket as the new python-libzim 1.0.0 to be published will work only and is tested against libzim7+. Does that sounds good to you?

legoktm commented 3 years ago

This isn't an issue for me from the Debian side, it was fixed when I rebuilt the package.

mgautierfr commented 3 years ago

Yes, we can close it. We will change a lot of things soon and this issue will be somehow obsolete. As it is not a issue for @legoktm, let's close it.