Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 132893

Summary: gcc/glibc sincosf() segmentation fault...
Product: Gentoo Linux Reporter: Yo. E <yorzan>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Other   
Whiteboard:
Package list:
Runtime testing required: ---

Description Yo. E 2006-05-10 06:16:28 UTC
This simple code

#include <math.h>

int main () {
    float   A[2];
    float   pH = 0.1;

    sincosf(pH, &A[0], &A[1]);

    return 0;
}

cause segmentation fault on several linux distro & glibc versions, at lest:
SuSE Linux, gcc-3.3.3 & glibc-2.3.3, with -fno-builtind;
Gentoo Linux, gcc-3.4.4 & glibc-2.3.4, with -O3 -fno-builtind options;

The bug resides on the glibc library since there is no segfault without -fno-builtind option on some distro.
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2006-05-10 06:59:10 UTC
Kindly read the manpage and/or turn up your warning level. That it happens to work with gcc's own sincosf() is pure luck, you're missing #define _GNU_SOURCE.
Comment 2 Yo. E 2006-05-10 23:39:09 UTC
(In reply to comment #1)
> Kindly read the manpage and/or turn up your warning level. That it happens to
> work with gcc's own sincosf() is pure luck, you're missing #define _GNU_SOURCE.
> 

Oh.. Thank you. This feature was not mentioned in mans that i have read.