Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51253 - xpdf segfaults on empty bookmarks
Summary: xpdf segfaults on empty bookmarks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-16 23:52 UTC by James Kyte
Modified: 2004-10-07 08:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
catchsegv results (segv.txt,4.59 KB, text/plain)
2004-05-16 23:54 UTC, James Kyte
Details
patch that checks for a null-action (xpdf-segfault.patch,373 bytes, patch)
2004-05-18 03:53 UTC, Kristiaan Lenaerts
Details | Diff
modified ebuild for version 3.00 (xpdf-3.00-r2.ebuild,1017 bytes, text/plain)
2004-05-18 03:59 UTC, Kristiaan Lenaerts
Details
modified ebuild for version 2.03 (xpdf-2.03-r1.ebuild,1.21 KB, text/plain)
2004-05-18 04:25 UTC, Kristiaan Lenaerts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Kyte 2004-05-16 23:52:59 UTC
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"
Comment 1 James Kyte 2004-05-16 23:54:56 UTC
Created attachment 31562 [details]
catchsegv results
Comment 2 Kristiaan Lenaerts 2004-05-18 03:43:17 UTC
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.
Comment 3 Kristiaan Lenaerts 2004-05-18 03:53:15 UTC
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)
Comment 4 Kristiaan Lenaerts 2004-05-18 03:59:45 UTC
Created attachment 31644 [details]
modified ebuild for version 3.00

modified ebuild that applies the patch.
Comment 5 Kristiaan Lenaerts 2004-05-18 04:03:00 UTC
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.
Comment 6 Kristiaan Lenaerts 2004-05-18 04:25:31 UTC
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.
Comment 7 James Kyte 2004-05-18 10:58:49 UTC
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.
Comment 8 Kristiaan Lenaerts 2004-05-20 10:15:06 UTC
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...)
Comment 9 James Kyte 2004-05-20 16:02:05 UTC
OK, thanks again. Bug fixed, as per #8.
Comment 10 James Kyte 2004-09-30 10:48:08 UTC
Reopening, in the hope this patch can be applied to a future revision.
Comment 11 Heinrich Wendel (RETIRED) gentoo-dev 2004-10-07 08:18:30 UTC
added to xpdf-3.00-r2