Date: 19 Nov 2007 01:04:32 -0000 From: Andrew Reilly <areilly@bigpond.net.au> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/118117: qmail broken on amd64 -- fixed Message-ID: <20071119010432.79318.qmail@areilly.bpa.nu> Resent-Message-ID: <200711190840.lAJ8erH5034448@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 118117 >Category: ports >Synopsis: qmail broken on amd64 -- fixed >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 19 08:40:00 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Andrew Reilly >Release: FreeBSD 7.0-BETA3 amd64 >Organization: >Environment: System: FreeBSD duncan.reilly.home 7.0-BETA3 FreeBSD 7.0-BETA3 #1: Sun Nov 18 04:20:31 EST 2007 root@duncan:/usr/obj/usr/src/sys/DUNCAN amd64 machine is an Athlon64-X2 running SMP >Description: qmail built from ports (both plain qmail and qmail-tls) died on startup with log message: alert: oh no! lost spawn connection! dying... Investigation showed that qmail-lspawn was dumping core in /var/qmail/queue/mess. Tweaked conf-cc and conf-load to not over-optimize or strip, and got a core with debug symbols intact. Found that first access to d[0] was segfaulting. d was not zero, but didn't look like a pointer either. Found that alloc() defn not in scope, and on amd64 the assumed int is *not* a useful substitute for a char*. >How-To-Repeat: Build qmail from ports on a 64-bit system. >Fix: Applied the following changes after make configure. Mostly just brings alloc() defn in scope in spawn.c, but also does the non-strip compile and avoids some complaints about malloc() not matching system def. There are clearly other compile warnings that could be bugs, but it seems to be working again, at least... diff -c work/qmail-1.03/alloc.c fixed-work/qmail-1.03/alloc.c *** work/qmail-1.03/alloc.c Mon Jun 15 20:53:16 1998 --- fixed-work/qmail-1.03/alloc.c Mon Nov 19 11:44:15 2007 *************** *** 1,7 **** #include "alloc.h" #include "error.h" ! extern char *malloc(); ! extern void free(); #define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */ #define SPACE 4096 /* must be multiple of ALIGNMENT */ --- 1,8 ---- + #include <stdlib.h> #include "alloc.h" #include "error.h" ! /*extern char *malloc(); */ ! /*extern void free(); */ #define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */ #define SPACE 4096 /* must be multiple of ALIGNMENT */ diff -c work/qmail-1.03/conf-cc fixed-work/qmail-1.03/conf-cc *** work/qmail-1.03/conf-cc Mon Nov 19 11:50:42 2007 --- fixed-work/qmail-1.03/conf-cc Mon Nov 19 11:43:17 2007 *************** *** 1 **** ! cc -O2 -fno-strict-aliasing -pipe -g --- 1 ---- ! cc -O -fno-strict-aliasing -pipe -g diff -c work/qmail-1.03/conf-ld fixed-work/qmail-1.03/conf-ld *** work/qmail-1.03/conf-ld Mon Jun 15 20:53:16 1998 --- fixed-work/qmail-1.03/conf-ld Mon Nov 19 11:43:09 2007 *************** *** 1,3 **** ! cc -s This will be used to link .o files into an executable. --- 1,3 ---- ! cc This will be used to link .o files into an executable. diff -c work/qmail-1.03/spawn.c fixed-work/qmail-1.03/spawn.c *** work/qmail-1.03/spawn.c Mon Jun 15 20:53:16 1998 --- fixed-work/qmail-1.03/spawn.c Mon Nov 19 11:43:29 2007 *************** *** 1,5 **** --- 1,6 ---- #include <sys/types.h> #include <sys/stat.h> + #include "alloc.h" #include "sig.h" #include "wait.h" #include "substdio.h" >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071119010432.79318.qmail>