misc/109210: gcc 3.4.6 is broken wrt -O2

Erwin Hoffmann feh at fehcom.de
Thu Feb 15 22:00:14 UTC 2007


>Number:         109210
>Category:       misc
>Synopsis:       gcc 3.4.6 is broken wrt -O2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 15 22:00:13 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Erwin Hoffmann
>Release:        6.2
>Organization:
FEHCom
>Environment:
>Description:
Hi, 

it has been reported, that "gcc -O2" is broken for gcc 3.4.6.

The report has been forwarded to me, using my base64.c implemention on CentOS 4.4: 

John Simpson (John Simpson <jms1 at jms1.net>):

>How-To-Repeat:
Compile and use qmail-1.03 + http://www.fehcom.de/qmail/auth/qmail-authentication-066_tgz.bin 

and 

http://www.fehcom.de/qmail/auth/qmail-authentication-065_tgz.bin

and compare results. Version 0.66 includes fixes for gcc 3.4.6 incapabilities.


>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 >in your base64.c, in the b64decode() function, we find these lines:
 >
 >36   out->len = (n * 3) - p;
 >37   if (!stralloc_ready(out,out->len)) return -1;
 >38   s - out->s;
 >
 >the gcc compiler's "-O2" option does some strange things to this  
 >code, and line 37 ends up setting out->len back to zero for some  
 >reason, which ends up causing auth_plain() to return "malformed auth  
 >input" in response to an AUTH PLAIN command. (it doesn't help that  
 >stralloc_ready() is written as a macro and is therefore impossible to  
 >debug directly.)
 
 >it's "gcc 3.4.6 20060404 (Red Hat 3.4.6-3)", which is the current  
 >version for CentOS 4.4.
 
 This bug inhibits some former FreeBSD ports to be used on FreeBSD 6.2 (eg. mlwm). In addition it is claimed falsly (for this port), that the SW is broken for all FreeBSD 6.x releases, whereas mlwm works fine with FreeBSD 6.2.
 
 In fact, it is the gcc which generate the problem with those ports.
 
 Form my point of view, due the the gcc bug, FreeBSD is unusable.
 
 regards.
 --eh.
 
 
 
 
 


More information about the freebsd-bugs mailing list