Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 115489 - netpbm-10.30-r1: pnmtopng segfaults
Summary: netpbm-10.30-r1: pnmtopng segfaults
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords:
: 125915 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-13 18:13 UTC by Michael Mauch
Modified: 2006-03-12 04:21 UTC (History)
2 users (show)

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


Attachments
Fix for a problem. (netpbm-10.31-pnmtopng.patch,498 bytes, patch)
2005-12-29 06:03 UTC, rgo
Details | Diff
pnm file that causes pnmtopng to segfault (pcxstd.ppm,204 bytes, image/x-portable-pixmap)
2006-01-07 02:38 UTC, Michael Mauch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Mauch 2005-12-13 18:13:36 UTC
netpbm-10.30-r1 still segfaults here. I just re-emerged it, because bug #114812
says this segfault is fixed, and I suspected that prelink messed this up.

Reproducible: Always
Steps to Reproduce:
Call pnmtopng without args or with any args (only --help does not segfault
here). E.g. I tried "pnmtopng -transparent '#ffffff' action-background.ppm".
Actual Results:  
# pnmtopng
zsh: segmentation fault (core dumped)  pnmtopng
# gdb =pnmtopng core
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

(no debugging symbols found)
Core was generated by `pnmtopng'.
Program terminated with signal 11, Segmentation fault.

warning: Can't read pathname for load map: Eingabe-/Ausgabefehler.
Reading symbols from /usr/lib/libnetpbm.so.10...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libnetpbm.so.10
Reading symbols from /usr/lib/libpng.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpng.so.3
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /lib/tls/libm.so.6...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/tls/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x44077067 in rawmemchr ()
   from /lib/tls/libc.so.6
(gdb) bt
#0  0x44077067 in rawmemchr () from /lib/tls/libc.so.6
#1  0x4406e0a1 in _IO_list_resetlock () from /lib/tls/libc.so.6
#2  0x44063787 in vsscanf () from /lib/tls/libc.so.6
#3  0x4405ef9d in sscanf () from /lib/tls/libc.so.6
#4  0x08049656 in ?? ()
#5  0x00000001 in ?? ()
#6  0x0804e329 in _IO_stdin_used ()
#7  0xbfe60f28 in ?? ()
#8  0xbfe60f2c in ?? ()
#9  0xbfe60f3c in ?? ()
#10 0xbfe60f38 in ?? ()
#11 0xbfe60f34 in ?? ()
#12 0xbfe60f30 in ?? ()
#13 0x08051008 in ?? ()
#14 0x00000001 in ?? ()
#15 0x00000001 in ?? ()
#16 0x00000000 in ?? ()
(gdb) q




Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r2,
2.6.13-suspend2-r4 i686)
=================================================================
System uname: 2.6.13-suspend2-r4 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.6.13
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r10, 2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="no"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-mcpu=athlon -O2 -pipe -g"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=athlon -O2 -pipe -g"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks fixpackages sandbox sfperms strict"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror
ftp://ftp.tu-clausthal.de/pub/linux/gentoo/
http://ftp.snt.utwente.nl/pub/os/linux/gentoo/
ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo/
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="de_DE@euro"
LINGUAS="en_GB de fa"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/g-cpan /usr/local/overlays/gentoo-de
/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="x86 3dnow X a52 aac aalib ac3 acl alsa apache2 apm arts audiofile avi
bash-completion berkdb bitmap-fonts bluetooth bmp bonobo bzip2 cdb cdr crypt
cups curl dbus dga doc dts dvb dvd dvdread edl eds emboss encode esd exif
exiscan-acl expat fam fame ffmpeg flac foomaticdb freetype gcj gd gdbm ggi gif
gimpprint glut gmp gnokii gnome gphoto2 gstreamer gtk gtk2 gtkhtml guile hal idn
imagemagick imap imlib innodb ipv6 irmc jack java joystick jpeg junit kde kdepim
kdexdeltas lcms ldap libg++ libwww lirc live lzo mad mailwrapper matroska matrox
mbox mcal memlimit mhash mikmod mjpeg mmx mng mono mozdevelop mozilla mozsvg mp3
mpeg mplayer mpm-prefork mule mysql nas ncurses network nls nptl nsplugin nvram
objc oci8 odbc ogg oggvorbis opengl oracle oss pam pcre pda pdflib perl php pic
plotutils png postgres python qt quicktime rdesktop readline real recode rtc
ruby samba scanner sdl slang speex spell sqlite ssl subtitles svg tcltk tcpd
tetex theora tiff truetype truetype-fonts type1-fonts udev usb v4l v4l2 vcd
vorbis wifi wmf xemacs xine xinetd xml xml2 xmms xosd xprint xv xvid zlib
video_cards_matrox linguas_en_GB linguas_de linguas_fa userland_GNU kernel_linux
elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS
Comment 1 rgo 2005-12-29 06:01:28 UTC
netpbm-10.31 pnmtopng also segfaults. This patch fix a problem:

--- netpbm-10.31/converter/other/pnmtopng-orig.c        2005-12-29 16:35:13.000000000 +0000
+++ netpbm-10.31/converter/other/pnmtopng.c     2005-12-29 16:34:05.000000000 +0000
@@ -417,9 +417,9 @@
 
     if (cmdlineP->rgbSpec)
         parseRgbOpt(rgb, &cmdlineP->rgb);
     
-    if (cmdlineP->modtimeSpec)
+    if (cmdlineP->modtimeSpec && modtime != NULL)
         parseModtimeOpt(modtime, &cmdlineP->modtime);
 
     if (cmdlineP->zlibCompression.levelSpec &&
         cmdlineP->zlibCompression.level > 9)
Comment 2 rgo 2005-12-29 06:03:51 UTC
Created attachment 75718 [details, diff]
Fix for a problem.

This patch fix a problem for netpmb-10.31. I think for 10.30 it should work also.
Comment 3 SpanKY gentoo-dev 2005-12-29 20:00:02 UTC
Comment on attachment 75718 [details, diff]
Fix for a problem.

different issue, file a new bug report
Comment 4 SpanKY gentoo-dev 2005-12-29 20:00:29 UTC
post the actual files that are causing pnmtopng to segfault and the commands you used to make it segfault
Comment 5 Michael Mauch 2006-01-07 02:36:33 UTC
# pnmtopng /usr/share/netpbm/pcxstd.ppm
Segmentation fault
Comment 6 Michael Mauch 2006-01-07 02:38:32 UTC
Created attachment 76436 [details]
pnm file that causes pnmtopng to segfault
Comment 7 SpanKY gentoo-dev 2006-01-07 19:10:09 UTC
works fine for me on x86 and amd64 ... your current gdb bt is useless though, so we'll need to generate a proper one ...

do this:
# CFLAGS='-g -O -pipe' FEATURES='nostrip' emerge netpbm
# gdb --args pnmtopng /usr/share/netpbm/pcxstd.ppm
Comment 8 Michael Mauch 2006-01-07 20:11:06 UTC
Oh - it works fine if I use CFLAGS='-g -O -pipe'!

Only with -O2 I get the segfault:

# CFLAGS='-g -O2 -pipe' FEATURES='nostrip' emerge netpbm

# gdb --args pnmtopng /usr/share/netpbm/pcxstd.ppm
GNU gdb 6.4
[...]
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /usr/bin/pnmtopng /usr/share/netpbm/pcxstd.ppm

Program received signal SIGSEGV, Segmentation fault.
0x44077090 in rawmemchr () from /lib/tls/libc.so.6
(gdb) bt
#0  0x44077090 in rawmemchr () from /lib/tls/libc.so.6
#1  0x4406e0a1 in _IO_list_resetlock () from /lib/tls/libc.so.6
#2  0x44063787 in vsscanf () from /lib/tls/libc.so.6
#3  0x4405ef9d in sscanf () from /lib/tls/libc.so.6
#4  0x0804d54d in main (argc=2, argv=0xbf820474) at pnmtopng.c:226
(gdb)  
Comment 9 SpanKY gentoo-dev 2006-01-26 19:07:32 UTC
can you try upgrading to 10.31 and see if that fixes things for you ?
Comment 10 Michael Mauch 2006-01-27 07:39:36 UTC
Yes, 10.31-r1 works fine with the -O2 flag.

# locate .ppm | xargs -n 1 pnmtopng >/dev/null

also worked fine, not a single segfault anymore.
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2006-03-12 04:21:09 UTC
*** Bug 125915 has been marked as a duplicate of this bug. ***