Subject: pkg/34027: CURRENT -- gcc4 -O2 causes nmh to segfault
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <rockear@hive-mind.net>
List: pkgsrc-bugs
Date: 07/18/2006 03:45:00
>Number:         34027
>Category:       pkg
>Synopsis:       nmh segfaults in strcasecmp() when built with gcc4 -O2.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 18 03:45:00 +0000 2006
>Originator:     Casey Carter
>Release:        NetBSD 3.99.22
>Organization:
	
>Environment:
	
	
System: NetBSD iocaine.hive-mind.net 3.99.22 NetBSD 3.99.22 (GENERIC.MPACPI) #0: Sun Jul 16 16:21:32 PDT 2006 rockear@iocaine.hive-mind.net:/usr/obj/sys/arch/i386/compile/GENERIC.MPACPI i386
Architecture: i386
Machine: i386
>Description:
	
Something in nmh doesn't optimize properly with current's gcc. Running show,
if it was built with gcc4 and optimized with -O2 (the default), segfaults and
dumps core. This happens with any other nmh program that uses its custom
strcasecmp().
>How-To-Repeat:
	
Install and boot into current. I've seen this happen on 3.99.21 and 3.99.22.
Build and install mail/nmh.
Have some MH-format messages in $HOME/Mail/
show
>Fix:
	
Add 
CFLAGS+=-O1
to /etc/mk.conf. Rebuild nmh.

>Unformatted: