Description
Describe the bug (mandatory)
When iterating over fitz.Document(), a segfault occurs:
Fatal Python error: Segmentation fault
Current thread 0x00007ff9fbecd040 (most recent call first):
File "/usr/lib/python3/dist-packages/fitz/fitz.py", line 4241 in page_count
File "/usr/lib/python3/dist-packages/fitz/fitz.py", line 5418 in contains
File "/usr/lib/python3/dist-packages/fitz/fitz.py", line 5440 in getitem
File "/home/faith/git/lustro/lustro/epub.py", line 51 in _extract_text
File "/home/faith/git/lustro/lustro/epub.py", line 167 in read
File "/home/faith/git/lustro/lustro/identify.py", line 161 in identify
File "/home/faith/git/lustro/lustro/main.py", line 135 in main
File "/home/faith/git/lustro/bin/lustro", line 11 in
Extension modules: fitz._fitz, unrardll.unrar, PIL._imaging, tesserocr, psutil._psutil_linux, psutil._psutil_posix (total: 6)
To Reproduce (mandatory)
Try to read an epub that causes https://bugs.ghostscript.com/show_bug.cgi?id=706093
Sorry, I cannot provide the epub.
Expected behavior (optional)
No segfault.
Screenshots (optional)
None.
Your configuration (mandatory)
python 3.11.0+ (main, Nov 4 2022, 09:23:33) [GCC 12.2.0]
PyMuPDF 1.21.0 (20221108000001), from debian package "python3-fitz"
Linux Linux-5.19.0-2-amd64-x86_64-with-glibc2.36
Debian GNU/Linux bookworm/sid
For example, the output of print(sys.version, "\n", sys.platform, "\n", fitz.__doc__)
would be sufficient (for the first two bullets).
3.10.8 (main, Nov 4 2022, 09:21:25) [GCC 12.2.0]
linux
PyMuPDF 1.21.0: Python bindings for the MuPDF 1.21.0 library.
Version date: 2022-11-08 00:00:01.
Built for Python 3.10 on linux (64-bit).
Additional context (optional)
Mostly I wanted to call your attention to https://bugs.ghostscript.com/show_bug.cgi?id=706093
When PyMuPDF builds, does it depend on a fully built mupdf tree to access the libmupdf.a static library? I.e., vs. using a dynamic linkage that I could patch around until upstream fixes the problem.