http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52230

             Bug #: 52230
           Summary: OpenMP: Simple C program triggers SIGSEGV at execution
    Classification: Unclassified
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: fanuser...@yahoo.com


bash-3.2$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure
--disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2
--mandir=/share/man --enable-languages=c,objc,c++,obj-c++
--program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-slibdir=/usr/lib --build=i686-apple-darwin11
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local
--program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11
--target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)


The following program is compiled with -fopenmp. (gcc -fopenmp -Wall a.c)
There are no warnings, no compilation errors.
OS: OSX Lion 10.7.3

int main(void)
{
int i;
#pragma omp parallel for
for(i=0;i<4;i++) {
    while(1);
}
return 0;
}


If I run the program several times, sometimes I get a SIGSEGV. If you don't
receive the SIGSEGV in the first 5-7 seconds, just intrerupt it (via Ctrl-C)
and run it again.

bash-3.2$ ./a.out
Segmentation fault: 11 (core dumped)

Reply via email to