public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution
@ 2012-02-13 11:18 fanusergiu at yahoo dot com
  2012-02-13 11:25 ` [Bug libgomp/52230] " jakub at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: fanusergiu at yahoo dot com @ 2012-02-13 11:18 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: fanusergiu@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)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgomp/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
@ 2012-02-13 11:25 ` jakub at gcc dot gnu.org
  2012-02-13 11:32 ` fanusergiu at yahoo dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-13 11:25 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|                            |INVALID

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-13 11:24:22 UTC ---
GCC 4.2 is not supported for several years already, and furthermore if I read
this well, this isn't gcc at all, but LLVM.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libgomp/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
  2012-02-13 11:25 ` [Bug libgomp/52230] " jakub at gcc dot gnu.org
@ 2012-02-13 11:32 ` fanusergiu at yahoo dot com
  2012-02-13 12:01 ` [Bug middle-end/52230] " jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fanusergiu at yahoo dot com @ 2012-02-13 11:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from fanusergiu at yahoo dot com 2012-02-13 11:31:56 UTC ---
(In reply to comment #1)
> GCC 4.2 is not supported for several years already, and furthermore if I read
> this well, this isn't gcc at all, but LLVM.

Thanks for the fast reply, I tried it also on Linux Mint 64bit, gcc version
4.6.1. Same result.. (SIGSEGV) but faster (I get it in under 1 sec). I also
tried it on a CentOS 6.2 with gcc 4.4.6. gomp_loop_static_start() gets called,
with parameters like => chunk_size=140737488347560, istart=0x7fffffffe1b0,
iend=0xca. The last one is a pointer which gets dereferenced.. hence getting
the SIGSEGV.

I think it's not a LLVM bug.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug middle-end/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
  2012-02-13 11:25 ` [Bug libgomp/52230] " jakub at gcc dot gnu.org
  2012-02-13 11:32 ` fanusergiu at yahoo dot com
@ 2012-02-13 12:01 ` jakub at gcc dot gnu.org
  2012-02-13 12:05 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-13 12:01 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2012-02-13
          Component|libgomp                     |middle-end
         Resolution|INVALID                     |
     Ever Confirmed|0                           |1

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-13 12:00:38 UTC ---
You're right, but please report bugs for supported compilers only next time.
The problem only happens if the omp for body doesn't fall through, i.e. only on
very questionable sources like this one.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug middle-end/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
                   ` (2 preceding siblings ...)
  2012-02-13 12:01 ` [Bug middle-end/52230] " jakub at gcc dot gnu.org
@ 2012-02-13 12:05 ` jakub at gcc dot gnu.org
  2012-02-13 12:05 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-13 12:05 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |openmp
             Status|REOPENED                    |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.7.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug middle-end/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
                   ` (3 preceding siblings ...)
  2012-02-13 12:05 ` jakub at gcc dot gnu.org
@ 2012-02-13 12:05 ` jakub at gcc dot gnu.org
  2012-02-13 19:58 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-13 12:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-13 12:05:12 UTC ---
Created attachment 26649
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26649
gcc47-pr52230.patch

Untested fix.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug middle-end/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
                   ` (4 preceding siblings ...)
  2012-02-13 12:05 ` jakub at gcc dot gnu.org
@ 2012-02-13 19:58 ` jakub at gcc dot gnu.org
  2012-02-13 20:05 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-13 19:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-13 19:57:28 UTC ---
Author: jakub
Date: Mon Feb 13 19:57:24 2012
New Revision: 184165

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184165
Log:
    PR middle-end/52230
    * omp-low.c (expand_omp_for): If a static schedule without
    chunk size has NULL region->cont, force fd.chunk_size to be
    integer_zero_node.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/omp-low.c


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug middle-end/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
                   ` (5 preceding siblings ...)
  2012-02-13 19:58 ` jakub at gcc dot gnu.org
@ 2012-02-13 20:05 ` jakub at gcc dot gnu.org
  2012-02-14 23:33 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-13 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-13 20:04:12 UTC ---
Fixed for trunk, might backport it to 4.[654] eventually, but it isn't high
priority, given that it doesn't make any sense to have non-fallthru omp for
body, using omp for then isn't really appropriate.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug middle-end/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
                   ` (6 preceding siblings ...)
  2012-02-13 20:05 ` jakub at gcc dot gnu.org
@ 2012-02-14 23:33 ` jakub at gcc dot gnu.org
  2012-03-22  9:30 ` rguenth at gcc dot gnu.org
  2012-07-02 14:11 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-14 23:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-14 23:32:44 UTC ---
Author: jakub
Date: Tue Feb 14 23:32:39 2012
New Revision: 184240

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184240
Log:
    Backported from mainline
    2012-02-13  Jakub Jelinek  <jakub@redhat.com>

    PR middle-end/52230
    * omp-low.c (expand_omp_for): If a static schedule without
    chunk size has NULL region->cont, force fd.chunk_size to be
    integer_zero_node.

Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/omp-low.c


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug middle-end/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
                   ` (7 preceding siblings ...)
  2012-02-14 23:33 ` jakub at gcc dot gnu.org
@ 2012-03-22  9:30 ` rguenth at gcc dot gnu.org
  2012-07-02 14:11 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-22  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.7.0                       |4.7.1

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-22 08:27:35 UTC ---
GCC 4.7.0 is being released, adjusting target milestone.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug middle-end/52230] OpenMP: Simple C program triggers SIGSEGV at execution
  2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
                   ` (8 preceding siblings ...)
  2012-03-22  9:30 ` rguenth at gcc dot gnu.org
@ 2012-07-02 14:11 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.7.1                       |4.6.3

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 14:11:37 UTC ---
Fixed for 4.6.3.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-02 14:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-13 11:18 [Bug libgomp/52230] New: OpenMP: Simple C program triggers SIGSEGV at execution fanusergiu at yahoo dot com
2012-02-13 11:25 ` [Bug libgomp/52230] " jakub at gcc dot gnu.org
2012-02-13 11:32 ` fanusergiu at yahoo dot com
2012-02-13 12:01 ` [Bug middle-end/52230] " jakub at gcc dot gnu.org
2012-02-13 12:05 ` jakub at gcc dot gnu.org
2012-02-13 12:05 ` jakub at gcc dot gnu.org
2012-02-13 19:58 ` jakub at gcc dot gnu.org
2012-02-13 20:05 ` jakub at gcc dot gnu.org
2012-02-14 23:33 ` jakub at gcc dot gnu.org
2012-03-22  9:30 ` rguenth at gcc dot gnu.org
2012-07-02 14:11 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).