Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32774 - qmail-remote segfaults on ppc (qmail-1.03-r13, -r14, -r15)
Summary: qmail-remote segfaults on ppc (qmail-1.03-r13, -r14, -r15)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: PPC Linux
: High major (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-04 23:32 UTC by Rajiv Aaron Manglani (RETIRED)
Modified: 2005-01-07 10:20 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rajiv Aaron Manglani (RETIRED) gentoo-dev 2003-11-04 23:32:45 UTC
with USE=ssl, qmail-remote segfaults on ppc:

$ echo "hi" | strace ./qmail-remote host.com 'rajiv@host.com' 'rajiv@host.com'

... a bunch of stuff (HOST replaced the real host below)...
getpid()                                = 19828
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("66.92.64.2")}, 28) = 0
send(3, "8\264\1\0\0\1\0\0\0\0\0\0\vHOST\3com\0\0\17\0"..., 33, 0) = 33
gettimeofday({1068000175, 24493}, NULL) = 0
poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
recvfrom(3, "8\264\201\200\0\1\0\2\0\0\0\0\vHOST\3com\0\0\17"..., 513, 0, {sa_family=AF_INET,
 sin_port=htons(53), sin_addr=inet_addr("66.92.64.2")}, [16]) = 83
close(3)                                = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


qmail-1.03-r10 is fine (even with ssl). also USE=-ssl with qmail-1.03-r13 is fine.




Portage 2.0.49-r15 (default-ppc-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.21-ppc-r2)
=================================================================
System uname: 2.4.21-ppc-r2 ppc 
Gentoo Base System version 1.4.3.10
ccache version 2.2 [enabled]
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CFLAGS="-O3 -pipe -mcpu=750"
CHOST="powerpc-unknown-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /var/qmail/control /var/qmail/alias"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -pipe -mcpu=750"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache buildpkg"
GENTOO_MIRRORS="http://ftp.ucsb.edu/pub/mirrors/linux/gentoo http://www.gtlib.cc.gatech.edu/pub/gentoo http://gentoo.seren.com/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="oss dvd xv jpeg mitshm gif imlib sdl oggvorbis mozilla png truetype ppc cups foomaticdb gdbm berkdb slang readline tcltk mysql X tcpd pam libwww perl python gtk qt motif opengl crypt curl emacs gd gtk2 imap innodb javascript maildir md5sum mpeg ncurses quicktime rage128 spell tiff usb xml xml2 -gpm -nls -esd -gnome -kde"
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-28 20:14:24 UTC
could you please compile it with CFLAGS="-g -pipe" and enable coredumps on segfault, apply gdb against the coredump and post the results ?
Comment 2 Khayyam 2003-11-30 14:13:02 UTC
This package should be masked until this issue is resolved. Additionally the
package net-mail/queue-fix-1.4-r1, required for net-mail/qmail-1.03-r13,
is masked ~ppc which suggests that this package has no Q&A before release.
 
Comment 3 Khayyam 2003-11-30 14:15:14 UTC
This package should be masked until this issue is resolved. Additionally the
package net-mail/queue-fix-1.4-r1, required for net-mail/qmail-1.03-r13,
is masked ~ppc which suggests that this package has no Q&A before release.
 
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 14:53:10 UTC
Calum: -r13 was marked stable after 30 days in unstable on input from users, including a statement that it works on ppc. Nobody filed any bugs that it didn't work, so thusly after 30 days in the unstable tree I moved it to stable.

Since you should logically have a PPC box, could you please please post up the gdb results I've requested so I can write a fix and have it in -r14 ?
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-11-30 14:57:06 UTC
PPC people:
could somebody please see about the gdb trace output asap so I can fix this bug?

easiest route:
(set CFLAGS="-g -pipe" in make.conf)
ebuild qmail-1.03-r13.ebuild package
cd /var/tmp/portage/qmail-1.03-r13/work/qmail-1.03
ulimit -c 100000000
echo "hi" | ./qmail-remote \
localhostname 'username@localhostname' 'username@localhostname'
(where username and localhostname are valid for your machine)
gdb ./qmail-remote core >gdb.out

and then post gdb.out
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-12-02 23:35:32 UTC
I can't reproduce the bug on the one ppc box I have access to now.

g4 qmail # R=/var/tmp/portage/qmail-1.03-r13/image
g4 qmail # echo Hi |  $R/var/qmail/bin/qmail-remote orbis-terrarum.net robbat2@g4.gentoo.org robbat2@orbis-terrarum.net
r(robbat2@orbis-terrarum.net) K24.84.51.71 accepted message.
Remote host said: 250 ok 1070438035 qp 1767
g4 qmail # emerge info
Portage 2.0.49-r18 (default-ppc-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.6.0-test10-benh1)
=================================================================
System uname: 2.6.0-test10-benh1 ppc 0
Gentoo Base System version 1.4.3.10
ccache version 2.2 [enabled]
ACCEPT_KEYWORDS="ppc ~ppc"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe -mcpu=7450 -maltivec -mabi=altivec"
CHOST="powerpc-unknown-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe -mcpu=7450 -maltivec -mabi=altivec"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="berkdb cups directfb dvd esd foomaticdb gdbm gif gnome gpm gtk imlib jpeg kde libwww mitshm motif mozilla nls oggvorbis opengl oss pam perl png ppc python qt readline sdl slang ssl tcpd truetype xv"
Comment 7 Khayyam 2003-12-03 15:35:59 UTC
The ppc machines I use that run qmail are production machines, I only discoverd
this bug as I'd checked bugzilla after having queue-fix masked and blocking
qmail-1.03-r13's install. Sorry, but I can't risk having qmail break and so
I am unable to give you a gdb trace (i choose not to upgrade on reading
of this bug).  
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-12-03 16:10:23 UTC
callum: here is what to do so as not to break your existing setup while testing (since you don't seem to have a pre-production testing box).

1. put these two lines in your /etc/portage/package.mask:
=net-mail/qmail-1.03-r13
=net-mail/qmail-1.03-r14
This will tell portage to NOT consider those versions as upgrades.

now do:
ebuild /usr/portage/net-mail/qmail/qmail-1.03-r14.ebuild compile
(or -r13 if you want).
this will only compile qmail and do nothing about installing it.
next, insure that you have /var/qmail/control/ and that the 'me' and 'rsa512.pem' files exist in there. 'me' should just have your hostname, and you can see files/qmail-genrsacert.sh for details on rsa512.pem.

now go to somewhere like ~/testqmail
and do
ulimit -c 800000000
echo -e "\n\nhi" | /var/tmp/portage/qmail-1.03-r14/work/qmail-1.03/qmail-remote desthost 'sender@srchost' 'reciver@desthost'

where 'sender', 'desthost', 'sender', 'reciever' are all valid for your setup.

eg, i could use this on the g4 testbox where I can't reproduce the problem:
echo -e "\n\nhi" | /var/tmp/portage/qmail-1.03-r14/work/qmail-1.03/qmail-remote orbis-terrarum.net robbat2@g4.gentoo.org robbat2@orbis-terrarum.net
Comment 9 Luca Barbato gentoo-dev 2003-12-03 16:45:26 UTC
here the backtrace:


#0  0x0fdbf1f8 in poll () from /lib/libc.so.6
#1  0x0ffd6e68 in send_dg () from /lib/libresolv.so.2
#2  0x0ffd62e4 in __libc_res_nsend () from /lib/libresolv.so.2
#3  0x0ffd53e0 in __libc_res_nquery () from /lib/libresolv.so.2
#4  0x0ffd556c in __res_nquery () from /lib/libresolv.so.2
#5  0x0ffd4c84 in res_query () from /lib/libresolv.so.2
#6  0x10005e38 in resolve (domain=0x10020000, type=255) at dns.c:53
#7  0x10006598 in dns_cname (sa=0x10019df8) at dns.c:214
#8  0x10004238 in addrmangle (saout=0x1001b378,
    s=0x7ffff5f7 "lu_zero@sig11.org", flagalias=0x7ffff378, flagcname=1)
    at qmail-remote.c:706
#9  0x100047ac in main (argc=268541336, argv=0x10020000)
    at qmail-remote.c:803
Comment 10 Rajiv Aaron Manglani (RETIRED) gentoo-dev 2003-12-03 20:17:28 UTC
imac qmail-1.03 # gdb ./qmail-remote 12323
GNU gdb 5.3
Copyright 2002 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 "powerpc-unknown-linux-gnu"...
Attaching to program: /var/tmp/portage/qmail-1.03-r14/work/qmail-1.03/qmail-remote, process 12323
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /usr/lib/libssl.so.0.9.6...done.
Loaded symbols for /usr/lib/libssl.so.0.9.6
Reading symbols from /usr/lib/libcrypto.so.0.9.6...done.
Loaded symbols for /usr/lib/libcrypto.so.0.9.6
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/ld.so.1...done.
Loaded symbols for /lib/ld.so.1
0x0fe017f8 in poll () from /lib/libc.so.6
(gdb) bt
#0  0x0fe017f8 in poll () from /lib/libc.so.6
#1  0x0ffd6e50 in send_dg () from /lib/libresolv.so.2
#2  0x0ffd62d4 in __libc_res_nsend () from /lib/libresolv.so.2
#3  0x0ffd53d8 in __libc_res_nquery () from /lib/libresolv.so.2
#4  0x0ffd5564 in __res_nquery () from /lib/libresolv.so.2
#5  0x0ffd4c7c in res_query () from /lib/libresolv.so.2
#6  0x100077e0 in resolve (domain=0x1001dad0, type=255) at dns.c:53
#7  0x100082a8 in dns_cname (sa=0x1001dad0) at dns.c:214
#8  0x10004c50 in addrmangle (saout=0x1001f010, s=0x7ffffc4c "rajiv@isomehost.com", 
    flagalias=0x7ffffa68, flagcname=1) at qmail-remote.c:706
#9  0x100053cc in main (argc=4, argv=0x7ffffae4) at qmail-remote.c:803
#10 0x0fd46d44 in __libc_start_main () from /lib/libc.so.6
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x0fda8200 in _int_free () from /lib/libc.so.6
(gdb) bt
#0  0x0fda8200 in _int_free () from /lib/libc.so.6
#1  0x0fe6d6a0 in __DTOR_END__ () from /lib/libc.so.6
#2  0x1000b2c8 in alloc_free (x=0x0) at alloc.c:31
#3  0x100088f8 in dns_ipplus (ia=0x1001dae8, sa=0x1001da40, pref=0) at dns.c:294
#4  0x10008bcc in dns_ip (ia=0x1001dae8, sa=0x1001da40) at dns.c:331
#5  0x10008e0c in dns_mxip (ia=0x1001dae8, sa=0x1001da40, random=1878111481) at dns.c:368
#6  0x10005470 in main (argc=4, argv=0x7ffffae4) at qmail-remote.c:811
#7  0x0fd46d44 in __libc_start_main () from /lib/libc.so.6
(gdb) c
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) 
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-12-03 20:48:07 UTC
rajiv: are those two traces with the full -r14 or what?
Comment 12 Rajiv Aaron Manglani (RETIRED) gentoo-dev 2003-12-03 20:55:35 UTC
re comment #10, that is on a imac G3. 'emerge info' output below. except note that i ran:

'CFLAGS="-g -pipe" ebuild /usr/portage/net-mail/qmail/qmail-1.03-r14.ebuild compile'

to build the qmail used for testing.


Portage 2.0.49-r15 (default-ppc-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.21-ppc-r2)
=================================================================
System uname: 2.4.21-ppc-r2 ppc 
Gentoo Base System version 1.4.3.10
ccache version 2.2 [enabled]
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CFLAGS="-O3 -pipe -mcpu=750"
CHOST="powerpc-unknown-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/c 
onfig /usr/X11R6/lib/X11/xkb"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -pipe -mcpu=750"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache buildpkg"
GENTOO_MIRRORS="http://ftp.ucsb.edu/pub/mirrors/linux/gentoo http://www.gtlib.cc.gatech.edu/pub/gent 
oo http://gentoo.seren.com/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/dis 
tributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="oss dvd xv jpeg mitshm gif imlib sdl oggvorbis mozilla png truetype ppc foomaticdb gdbm berkdb  
slang readline tcltk mysql X tcpd pam libwww ssl perl python gtk qt motif opengl crypt curl emacs gd 
 gtk2 imap innodb javascript maildir md5sum mpeg ncurses quicktime rage128 spell tiff usb xml xml2 - 
gpm -nls -esd -gnome -kde -cups"

Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-01-04 19:20:31 UTC
rajiv: testcase for you:

#include <malloc.h>
#include <errno.h>
int main(int argc, char** argv) {
    int olderrno = errno;
    int tmperrno;
    free(0);
    tmperrno = errno;
    if(tmperrno != olderrno)
        return tmperrno;
    return 0;
}

compile it, run it, and check the return value, or see if it segfaults.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-01-20 01:30:01 UTC
rajiv: i still need you to run that testcase...

i'm relasing -r15 tonight, so it'll have to go in r16
Comment 15 Rajiv Aaron Manglani (RETIRED) gentoo-dev 2004-03-28 20:13:54 UTC
finally had access to the machine to test this.

re comment #13:

$ ./a.out && echo $?
0

so no segfault.

tried:
# CFLAGS="-g -pipe" ebuild /usr/portage/net-mail/qmail/qmail-1.03-r15.ebuild compile
...
# cd /var/tmp/portage/qmail-1.03-r15/work/qmail-1.03/
# echo 'hi' | ./qmail-remote example.com 'rajiv@example.com' 'rajiv@example.com'   
Segmentation fault

(real hostnames and email addresses were used above.)

robbat2: i can arrange for you to get non-root access to the box if that would help.

Comment 16 Luca Barbato gentoo-dev 2004-03-28 20:20:23 UTC
rajiv could you check it with the latest gcc(-3.3.3_pre20040322) I put in? 
Comment 17 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-04-24 03:45:39 UTC
any update on this?
Comment 18 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-05-12 20:17:49 UTC
if there aren't any updates in this in two weeks, i'm going to close this.
Comment 19 Jason 2004-06-25 20:43:35 UTC
I just noticed this on my PPC installation.

Relevent packages:
mail-mta/qmail-1.03-r15 *
sys-devel/gcc-3.3.3_pre20040408-r1 *

I caught it after installing
net-mail/qmail-scanner-1.20 *
Unmerging that package didn't help

Here is output from gdb, 

CFLAGS="-g -pipe" ebuild /usr/portage/mail-mta/qmail/qmail-1.03-r15.ebuild  compile
...
delicious qmail-1.03 # gdb ./qmail-remote
GNU gdb 5.3
Copyright 2002 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 "powerpc-unknown-linux-gnu"...
(gdb) run jjayr.com 'devnull@jjayr.com' 'devnull@jjayr.com'
Starting program: /home/src/portage/portage/qmail-1.03-r15/work/qmail-1.03/qmail-remote jjayr.com 'devnull@jjayr.com' 'devnull@jjayr.com'
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

Program received signal SIGSEGV, Segmentation fault.
0x0fd759f8 in malloc_set_state () from /lib/libc.so.6
(gdb) bt
#0  0x0fd759f8 in malloc_set_state () from /lib/libc.so.6
#1  0x0fe39f6c in _IO_stdin_ () from /lib/libc.so.6
#2  0x1000b290 in alloc_free (x=0x12 <Address 0x12 out of bounds>) at alloc.c:31
#3  0x100088c0 in dns_ipplus (ia=0x1001e640, sa=0x1001e5d4, pref=0) at dns.c:294
#4  0x10008b94 in dns_ip (ia=0x1001e640, sa=0x1001e5d4) at dns.c:331
#5  0x10005418 in main (argc=4, argv=0x7ffff544) at qmail-remote.c:811
#6  0x0fd239c8 in __libc_start_main () from /lib/libc.so.6

Let me know if more tests are needed.  This is on a non-critical system, so (short of rebuilding the box) i don't mind breaking a few things...
Comment 20 Jason 2004-06-25 20:49:05 UTC
Forgot to mention, but I'm also using SSL
Comment 21 Jason 2004-06-27 08:03:20 UTC
delicious root # emerge info
Portage 2.0.50-r8 (default-ppc-2004.1, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.6)
=================================================================
System uname: 2.6.6 ppc 740/750
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5
ACCEPT_KEYWORDS="ppc ~ppc"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe "
CHOST="powerpc-unknown-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/tex/generic/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config /usr/share/texmf/tex/platex/config/ /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe "
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/src/portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa arts berkdb bonobo cdr crypt cups dga encode esd ethereal foomaticdb gdbm gif gnome gpm gtk gtk2 gtkhtml guile imlib jikes jpeg kde libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pda perl png postgres ppc python qt readline samba scanner sdl slang ssl tcltk tcpd tetex tiff truetype usb xml2 xmms xv zlib"


delicious root # cat /proc/cpuinfo
processor       : 0
cpu             : 740/750
temperature     : 40-43 C (uncalibrated)
clock           : 300MHz
revision        : 2.2 (pvr 0008 0202)
bogomips        : 600.06
machine         : Power Macintosh
motherboard     : AAPL,PowerMac G3 MacRISC
detected as     : 49 (PowerMac G3 (Silk))
pmac flags      : 00000000
L2 cache        : 1024K unified pipelined-syncro-burst
memory          : 160MB
pmac-generation : OldWorld

It's one of the older G3 macs, in a beige box.
For what it's worth, the machine has a PCI USB card, that wasn't part of the original mac.
Comment 22 Kris Kelley 2004-06-28 08:40:48 UTC
I am also seeing this problem on a ppc machine, a PowerMac 7300 with G3 upgrade.  I'm using qmail 1.03-r13 on top of ppc kernel 2.4.26-r1 and gcc 3.3.3_pre20040408-r1.  I had qmail running on this machine for a long time without any trouble, but now switching kernels and recompiling qmail doesn't help (I also saw this problem on top of ppc kernel 2.4.24-r4).

emerge info:
---
Portage 2.0.50-r8 (default-ppc-2004.1, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.4.26-ppc-r1)
=================================================================
System uname: 2.4.26-ppc-r1 ppc 740/750
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CFLAGS="-O3 -pipe -mcpu=750"
CHOST="powerpc-unknown-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/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -pipe -mcpu=750"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X apache2 berkdb cups esd foomaticdb gdbm gif gpm gtk gtk2 imlib jpeg libwww mitshm motif mozilla mysql nls oggvorbis oss pam png ppc python readline sdl slang ssl tcltk tcpd truetype usb xv"
---

/proc/cpuinfo:
---
processor       : 0
cpu             : 740/750
temperature     : 27-29 C (uncalibrated)
clock           : 400MHz
revision        : 131.0 (pvr 0008 8300)
bogomips        : 799.53
machine         : Power Macintosh
motherboard     : AAPL,7500 MacRISC
detected as     : 16 (PowerMac 7500)
pmac flags      : 00000000
memory          : 352MB
pmac-generation : OldWorld
---

Please tell me if you need any further info or tests.
Comment 23 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-07-05 20:52:33 UTC
lu_zero: as you may note from the submitters, there your fixes don't resolve it.
Comment 24 Luca Barbato gentoo-dev 2004-07-06 08:30:34 UTC
last chance: gcc-3.4.0
Then probably would be necessary a workaround
Comment 25 Pieter Van den Abeele (RETIRED) gentoo-dev 2004-09-22 14:27:45 UTC
I can reproduce the segfault  with gcc-3.4.1-r1 on my G5

Ping me for root access to this machine.  

To reproduce the segfault on the machine: 

cd /var/qmail/bin/
./qmail-remote localhost 'pvdabeel@localhost' 'pvdabeel@localhost' 
Comment 26 Pieter Van den Abeele (RETIRED) gentoo-dev 2004-09-24 14:16:55 UTC
robbat2: I've made an account, let me know if any help is needed. 
Comment 27 Pieter Van den Abeele (RETIRED) gentoo-dev 2004-10-21 13:31:29 UTC
Does anyone else in net-mail want to take care of helping me debug?
Comment 28 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-10-21 14:39:54 UTC
i've been short on time, and this just slipped away.
i'm taking a look at it now (just waiting for gdb to emerge on your box).

Comment 29 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-10-21 18:27:50 UTC
gdb trace
#0  0x0fd6a0ac in malloc_set_state () from /lib/libc.so.6
#1  0x0fd6cb48 in free () from /lib/libc.so.6
#2  0x1000b50c in alloc_free (x=0x7ffff5b0 "\020\001
Comment 30 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-10-21 18:27:50 UTC
gdb trace
#0  0x0fd6a0ac in malloc_set_state () from /lib/libc.so.6
#1  0x0fd6cb48 in free () from /lib/libc.so.6
#2  0x1000b50c in alloc_free (x=0x7ffff5b0 "\020\001ó¨") at alloc.c:31
#3  0x10008b74 in dns_ipplus (ia=0x1001e640, sa=0x1001e5d4, pref=0) at dns.c:294
#4  0x10008e40 in dns_ip (ia=0x1001e640, sa=0x1001e5d4) at dns.c:331
#5  0x10009080 in dns_mxip (ia=0x1001e640, sa=0x1001e5d4, random=1566060354) at dns.c:368
#6  0x10005744 in main (argc=4, argv=0x7ffff924) at qmail-remote.c:811

Right up until the call to alloc_free everything is perfectly fine.
it's a stupid pointer error in dns.c but I'm surprised free didn't catch it like it did for another item

Digging more, I get:
#0  0x0fd6a0ac in malloc_set_state () from /lib/libc.so.6
#1  0x0fd6cb48 in free () from /lib/libc.so.6
#2  0x1000b5f0 in alloc_free (x=0x7ffff550 "\177ÿõ\200\020") at alloc.c:32
#3  0x1000b67c in alloc_re (x=0x1001e668, m=0, n=42) at alloc_re.c:14
#4  0x1000b058 in stralloc_readyplus (x=0x1001e668, n=11) at stralloc_eady.c:6
#5  0x1000b41c in stralloc_catb (sa=0x1001e668, s=0x1001e6aa "localhost\n", 
    n=10) at stralloc_catb.c:10
#6  0x1000ac80 in getln (ss=0xffffea98, sa=0x1001e668, match=0x7ffff5e4, 
    sep=10) at getln.c:17
#7  0x10005f40 in control_readline (sa=0x1001e668, fn=0x1000dcc4 "control/me")
    at control.c:65
#8  0x10005d24 in control_init () at control.c:33
#9  0x10005018 in getcontrols () at qmail-remote.c:718
#10 0x10005264 in main (argc=4, argv=0x7ffff8f4) at qmail-remote.c:758

I'm close to a solution now...
Comment 31 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-11-25 02:19:54 UTC
I thought I was close to a solution, but it doesn't seem to work...
Comment 32 Zeno Davatz 2004-12-14 06:52:15 UTC
I'm running qmail-1.03r15 and my qmail-remote tells me:

@4000000041befc581a1caf4c starting delivery 104: msg 16822 to remote root@localhost.zrr.local
@4000000041befc581a1eaf04 status: local 0/10 remote 1/20
@4000000041befc581b9009b4 delivery 104: deferral: qmail-remote_crashed./
@4000000041befc581b924fbc status: local 0/10 remote 0/20
@4000000041befc5f1fda84a4 new msg 16828
@4000000041befc5f1fddd064 info msg 16828: bytes 1942 from <> qp 25212 uid 0
@4000000041befc5f21aa7a14 starting delivery 105: msg 16828 to remote root@localhost.zrr.local
@4000000041befc5f21ac913c status: local 0/10 remote 1/20
@4000000041befc5f2285de24 delivery 105: deferral: qmail-remote_crashed./
@4000000041befc5f22860534 status: local 0/10 remote 0/20

I compiled accodring to Robin's instructions with:
FEATURES="nostrip keepwork" USE="debug" CFLAGS="-g" emerge qmail dot-forward

But I get not .dump file in /var/qmail.

Any hints?

Thanks
Zeno
Comment 33 Zeno Davatz 2004-12-14 07:22:41 UTC
After runnging my test_qmailscanner.pl -doit my qmail-remote gives me:

@4000000041bf02991853ab34 delivery 135: deferral: qmail-remote_crashed./
@4000000041bf02991853ce5c status: local 0/10 remote 0/20
@4000000041bf02a017c5f9c4 starting delivery 136: msg 16828 to remote root@localhost.zrr.local
@4000000041bf02a017c624bc status: local 0/10 remote 1/20
@4000000041bf02a01868c1a4 delivery 136: deferral: qmail-remote_crashed./
@4000000041bf02a01868e8b4 status: local 0/10 remote 0/20
@4000000041bf03c301fe6234 starting delivery 137: msg 16813 to remote zdavatz@ywesee.com
@4000000041bf03c301fe8944 status: local 0/10 remote 1/20
@4000000041bf03c3029d26bc delivery 137: deferral: qmail-remote_crashed./
@4000000041bf03c3029d4dcc status: local 0/10 remote 0/20

Sorry, I forgot to attache my emerge --info:
Portage 2.0.51-r8 (default-ppc-2004.1, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.9 ppc)
=================================================================
System uname: 2.6.9 ppc 7450, altivec supported
Gentoo Base System version 1.6.6
Python:              dev-lang/python-2.3.4,dev-lang/python-2.2.3-r5 [2.3.4 (#1, Jun  9 2004, 14:18:49)]
dev-lang/python:     2.3.4, 2.2.3-r5
sys-devel/autoconf:  2.59-r5
sys-devel/automake:  1.8.5-r1
sys-devel/binutils:  2.15.90.0.3-r3
sys-devel/libtool:   1.5.2-r7
virtual/os-headers:  2.4.19-r1, 2.4.22
ACCEPT_KEYWORDS="ppc ~ppc"
AUTOCLEAN="yes"
CFLAGS="-O2 -pipe -mcpu=7450 -maltivec -mabi=altivec"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe -mcpu=7450 -maltivec -mabi=altivec"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/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="aalib alsa apache2 apm berkdb bonobo cdr clamav crypt cups dba dillo dvd encode esd f77 fax faxonly ffmpeg fortran gd gdbm gif gnome-libs gphoto2 gpm gtk gtkhtml imlib java jpeg ldap libwww maildir motif mozilla mpeg4 mplayer ncurses nls oggvorbis opengl opens pam pcmcia pda perl png pnp ppc python qmail quicktime readline ruby samba sdl session slang spell ssl tcpd truetype usb v4l vhosts vpopmail xine xinerama zlib video_cards_radeon video_cards_rage128"

Please advise how to supply you with gdb --core=file. I can not find the core-dump file in /var/qmail/

I run the program /var/qmail/bin/qmail-remote directly and get:
DI (qmail-remote) was invoked improperly. (#5.3.5)

I do not find a core-dump-file.

Thanks for your help.
Zeno
Comment 34 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-01-07 03:57:49 UTC
could you please try the new -r16? (it's hardmasked)
Comment 35 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-01-07 04:28:57 UTC
As my main platform now is PowerPC, I will try this special case.
Comment 36 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-01-07 10:20:49 UTC
Fixed with the new starttls-patch from bug 56512 in -r16. Marking this bug as fixed.