When I select an "empty" bookmark, program segfaults. I was using xpdf-2.03, tried xpdf-3.00-r1 with the same results. acroread handles the same bookmark by displaying the next page, as it should. It's hard to explain, better to try and see. I've replicated the problem with a couple different pdf's. Reproducible: Always Steps to Reproduce: 1. download http://airy.phy.ulaval.ca/~pldro/ansi-iso_cpp_pro_handbook.pdf 2. open with xpdf 3. click top bookmark, "ANSI/ISO C++ Professional blah blah..." Actual Results: Segmentation fault Expected Results: err, not crashed. Displayed the first page. Portage 2.0.50-r6 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.6.5-gentoo-r1) ================================================================= System uname: 2.6.5-gentoo-r1 i686 AMD Athlon(tm) XP 2000+ Gentoo Base System version 1.4.10 Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="ftp://ftp.ndlug.nd.edu/pub/gentoo/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://gentoo.mirrors.pair.com/ ftp://mirrors.tds.net/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow X acpi alsa avi berkdb cdr crypt cups encode foomaticdb gdbm gif gpm gtk gtk2 imlib jpeg libg++ libwww mad mikmod mmx motif mpeg ncurses nls nptl oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell sse ssl svga tcltk tcpd tiff truetype x86 xinerama xml2 xmms xv zlib"
Created attachment 31562 [details] catchsegv results
The segfault happens when doAction is called from XPDFViewer.cc, at line 1685. When selecting an empty bookmark, that action will be null, and segfault in doAction. A quick fix would be to add a check for null actions (works already, but nothing happens when clicking on an empty bookmark), it would be better (I think) to add the check in doAction, so it acts correctly.
Created attachment 31642 [details, diff] patch that checks for a null-action This is the patch that checks for the null-action, just apply it in the build-dir from xpdf (modified ebuild on the way)
Created attachment 31644 [details] modified ebuild for version 3.00 modified ebuild that applies the patch.
I checked against acrobat reader (windows version, with wine), and it ignores empty bookmarks completely, somewhat like it is now in xpdf (after the fix). Other handling of the empty bookmarks should be asked to the developers of xpdf. I'll mail them this bug-report/fix, so they know this problem exists.
Created attachment 31648 [details] modified ebuild for version 2.03 the patch works with version 2.03, so I added an ebuild for that version too.
Brilliant. I tested both ebuilds, the patch does the job. I'm sure it will be incorporated into later versions, as it's so minor. Thanks alot for the quick response! I'm not sure what to mark the bug as, though. It seems fixed to me, but I don't know the proper procedure.
Reply from the developer of xpdf: From: "Derek B. Noonburg" <derekn@foolabs.com> Subject: Re: Bug in xpdf: segmentation fault To: klen@pandora.be > There is a segmantation fault when selecting an empty bookmark. > > This bug is discribed here: (with possible bugfix) > > http://bugs.gentoo.org/show_bug.cgi?id=51253 Yup, I've already fixed that one - the fix will be in the next release. Thanks for the bug report. - Derek James Kyte, could you change the Summary to "xpdf segfaults on empty bookmarks (FIXED)" (or something like that) that'll hopefully result in the addition to portage (I'm not a developer, so I have no cvs acces...)
OK, thanks again. Bug fixed, as per #8.
Reopening, in the hope this patch can be applied to a future revision.
added to xpdf-3.00-r2