Package: netpbm
Version: 2:10.0-8sarge1
Severity: normal

pnmnorm segfaults under certain circumstances, because of a mis-compilation
by gcc -O3 on ppc. Recompiling the package with -O2 results in a working
pnmnorm.

Reproducing the segfault is difficult because whether it occurs depends on
a very obscure detail of its invocation. The buggy compiler inlines some
stuff into main(), and generates code which uses the register r18 without
initializing it. The value of r18 isn't predictable at that point because
(here comes the fun part) nothing in the entire process has touched it, and
it still holds whatever value was in it before the execve!

The contents of r18 immediately before execve depend on what program is doing
the exec. I have found that ash and bash are both more likely to lead to a
segfault than zsh and tcsh. And if you try to chase this bug down with
strace, its interception of execve() changes the registers enough to prevent
(or perhaps, depending on how your strace was compiled, cause) the segfault.
Best. Heisenbug. Ever.!

It may also be kernel dependent (I doubt you can expect every kernel to 
leave r18 untouched all the way through execve.)

This script causes the segfault reliably for me.

#!/bin/ash
pnmnorm <<EOF >/dev/null
P2
4 2
255
56 118 168 182
0 0 0 0
EOF

It also segfaults with bash, but ash is better for the demo because it makes
the segfault glaringly obvious by printing "Segmentation fault", whereas bash
makes you check $? to find out what happened.

-- System Information:
Debian Release: 3.1
Architecture: powerpc (ppc)
Kernel: Linux 2.6.11-powerpc
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages netpbm depends on:
ii  bc                     1.06-15           The GNU bc arbitrary precision cal
ii  libc6                  2.3.2.ds1-22      GNU C Library: Shared libraries an
ii  libjpeg62              6b-10             The Independent JPEG Group's JPEG 
ii  libnetpbm10            2:10.0-8sarge1    Shared libraries for netpbm
ii  libpng12-0             1.2.8rel-1        PNG library - runtime
ii  libtiff4               3.7.2-3           Tag Image File Format (TIFF) libra
ii  zlib1g                 1:1.2.2-4.sarge.2 compression library - runtime

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to