Description of problem: Segfault if open pdf with OCR Version-Release number of selected component (if applicable): mupdf-1.5-5.fc22.x86_64 openjpeg2-2.1.0-3.fc22.x86_64 How reproducible: Unknown. On some pdf files 100% Steps to Reproduce: 1. Open pdf file Actual results: Segmentation fault (core dumped) Additional info: #0 0x00007ffff66cbb7c in _IO_new_fclose (fp=0x7fffffffb2c0) at iofclose.c:63 #1 0x00007ffff718e857 in opj_stream_destroy (p_stream=p_stream@entry=0xf6d200) at /usr/src/debug/openjpeg-2.1.0/src/lib/openjp2/cio.c:199 #2 0x0000000000a5df9e in fz_load_jpx (ctx=ctx@entry=0xebb010, data=0xf584f0 "", size=79038, defcs=0xe808c0 <k_default_rgb>, indexed=indexed@entry=0) at source/fitz/load-jpx.c:138 #3 0x0000000000a50fd3 in pdf_load_jpx (doc=doc@entry=0xee5260, dict=dict@entry=0xf12ca0, forcemask=forcemask@entry=0) at source/pdf/pdf-image.c:233 .... (gdb) up #2 0x0000000000a5df9e in fz_load_jpx (ctx=ctx@entry=0xebb010, data=0xf584f0 "", size=79038, defcs=0xe808c0 <k_default_rgb>, indexed=indexed@entry=0) at source/fitz/load-jpx.c:138 138 opj_stream_destroy(stream); (gdb) print stream $4 = (opj_stream_t *) 0xf6d200
Could you please describe in more detail how this is reproducible? I.e. open the PDF with what application? Or with some custom code? If the latter, can you share some minimal code to reproduce?
Sorry, Open pdf woth mupdf.
Any chance you could attach a pdf with which the issue is reproducible? Thanks.
Created attachment 1006352 [details] Fixed patch mupdf-1.5-openjpeg.patch is incorrect, you are are passing fclose as the destructor function to free the user data which is a stack allocated variable. You ought to just pass NULL as the destructor, see fixed patch attached. With that patch, the output is now error: cannot open test.pdf error: cannot load document 'test.pdf' mupdf: error: cannot open document but it does not crash. Why it fails to open the document needs to be investigated I guess.
(In reply to Sandro Mani from comment #3) > Any chance you could attach a pdf with which the issue is reproducible? > Thanks. https://archive.org/download/carminagraecamed00wagnuoft/carminagraecamed00wagnuoft_bw.pdf crashes with the old patch applied to compile mupdf-1.7. And if I apply your corrected version to compile mupdf-1.7, PDF file is displayed fine. Many thanks for your patch, Sandro. So the bug is solved in latest released version. I think it may be closed.
Uhm, the maintainer would need to apply the patch in comment #4 first though before closing this.
mupdf-1.7-2.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/mupdf-1.7-2.fc22
*** This bug has been marked as a duplicate of bug 1215752 ***
mupdf-1.7-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.