From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27731 invoked by alias); 13 Feb 2009 11:40:33 -0000 Received: (qmail 27710 invoked by uid 48); 13 Feb 2009 11:40:22 -0000 Date: Fri, 13 Feb 2009 11:40:00 -0000 Subject: [Bug libfortran/39176] New: [4.4 Regression] -static and -fopenmp and io causes segfault X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jv244 at cam dot ac dot uk" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-02/txt/msg01183.txt.bz2 I noticed this running mixed mpi/openmp on a system that required an executable without dynamics libraries. Don't know if the Fortran IO is supposed to be thread safe (i.e. serialized thread safe), but this seems to work without -static. It also appears to work with 4.3.1 but not 4.4 (trunk) > cat test.f90 !$OMP PARALLEL !$OMP CRITICAL write(6,*) "Hello world" !$OMP END CRITICAL !$OMP END PARALLEL write(6,*) "Done!" END > gfortran -static -fopenmp test.f90 > ./a.out Segmentation fault > gdb ./a.out GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-suse-linux"...Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run Starting program: /data/vondele/omptest/a.out Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x000000000040642f in get_external_unit (n=6, do_create=1) at /data/vondele/gcc_trunk/gcc/libgfortran/../gcc/gthr-posix.h:704 #2 0x0000000000404c01 in data_transfer_init (dtp=0x7fff047208c0, read_flag=0) at /data/vondele/gcc_trunk/gcc/libgfortran/io/transfer.c:1828 #3 0x00000000004003d6 in MAIN__.omp_fn.0 () #4 0x000000000040032c in MAIN__ () #5 0x000000000040042c in main (argc=1, argv=0x7fff04720fa8) at /data/vondele/gcc_trunk/gcc/libgfortran/fmain.c:21 (gdb) -- Summary: [4.4 Regression] -static and -fopenmp and io causes segfault Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jv244 at cam dot ac dot uk GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39176