tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: gcc -O2 produces invalid object code (x86_64, netbsd-5 branch)

On Mon, Mar 08, 2010 at 12:57:51AM -0500, Richard Hansen wrote:
> I've been debugging a strange libpam segfault on the netbsd-5 branch  
> (amd64) and I've concluded that gcc -O2 is incorrectly compiling the  
> pam_end() function in src/dist/openpam/lib/pam_end.c.  gcc -O0 works 
> fine.

Check <security/pam_appl.h>. The pamh argument is declared
__attribute__((__nonnull__())), so the compiler is merely optimizing
according to things it's been told. The caller is wrong and should not
be passing NULL.

David A. Holland

Home | Main Index | Thread Index | Old Index