Hello! It is maybe a miscompilation, but i can force a mutool compiled on CRUX-Linux 3.6 (not yet released but nonetheless) to hang endlessly via # mutool clean -g -s -l -d -z protokoll-januar1942_barrierefrei.pdf xxx.pdf I interrupted after five minutes. (The PDF is ~2.5 MB.) The PDF file is freely available at https://www.ghwk.de/fileadmin/Redaktion/PDF/Konferenz/protokoll-januar1942_barrierefrei.pdf Ciao!
More infos. #?0|kent:src$ pkginfo -o /usr/bin/mutool Package File mupdf usr/bin/mutool #?0|kent:src$ prt-get info mupdf Name: mupdf Path: /usr/ports/opt Version: 1.18.0 Release: 1 Description: Lightweight PDF and XPS viewer URL: https://www.mupdf.com/ Maintainer: Juergen Daubert, jue at crux dot nu Dependencies: glu,libglvnd,harfbuzz,libjpeg-turbo,xorg-libxi #?0|kent:src$ cat /usr/ports/opt/mupdf/Pkgfile # Description: Lightweight PDF and XPS viewer # URL: https://www.mupdf.com/ # Maintainer: Juergen Daubert, jue at crux dot nu # Depends on: glu libglvnd harfbuzz libjpeg-turbo xorg-libxi name=mupdf version=1.18.0 release=1 source=(https://mupdf.com/downloads/archive/$name-$version-source.tar.xz) build() { cd $name-$version-source export USE_SYSTEM_LIBS='yes' make install \ prefix=$PKG/usr \ mandir=$PKG/usr/share/man \ XCFLAGS="-fpic -fcommon" \ USE_SYSTEM_JBIG2DEC='no' \ USE_SYSTEM_OPENJPEG='no' \ USE_SYSTEM_GLUT='no' \ USE_SYSTEM_GUMBO='no' ln -s mupdf-gl $PKG/usr/bin/mupdf rm -r $PKG/usr/share/doc } My CFLAGS in /etc/pkgmk.conf are "-O2 -march=x86-64 -pipe", shall that make system use them. Happy hacking and a nice weekend i wish.
The hang only happens with the -s (sanitize content streams) flag. Using the -c (clean content streams) flag finishes processing.
It only happens when I don't specify any page ranges. Subsetting (even specifying all pages) allows it to finish processing. This command hangs: mutool clean -s protokoll-januar1942_barrierefrei.pdf out.pdf This command finishes instantly: mutool clean -s protokoll-januar1942_barrierefrei.pdf out.pdf 1-N
Thanks for looking into this! I can confirm everything you say. (I did not know about -c from reading the manual.) Ciao from Germany,
Fixed by: commit 723cf4d9e9ac0bace91a077d853dd8d9a6a49ebb Author: Tor Andersson <tor.andersson@artifex.com> Date: Wed Nov 25 16:24:28 2020 +0100 Bug 703092: Fix logic error in structured text scanning. When scanning the MCID string for a matching character when running the process filter, in the case where we do not remove the character we could get stuck at a space character in the input since we'd not progress. When we match a character we should either remove or skip it, so make that decision more explicit. This also fixes another potential bug where when we were removing a matching character, str->pos would also be advanced so we would miss scanning the next character after it. Thanks for the report.