[Bug libfortran/31604] Segfault at runtime on I/O with OpenMP and static linking
--- Comment #8 from fxcoudert at gcc dot gnu dot org 2007-04-18 18:47 --- *** This bug has been marked as a duplicate of 30471 *** -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|WAITING |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31604
[Bug libfortran/31604] Segfault at runtime on I/O with OpenMP and static linking
--- Comment #7 from dfranke at gcc dot gnu dot org 2007-04-18 11:14 --- See also: PR30471, PR30613 and PR31400 :) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31604
[Bug libfortran/31604] Segfault at runtime on I/O with OpenMP and static linking
--- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-04-17 15:56 --- (In reply to comment #2) > Can you check that the pthread functions are being resolved? > Also do you have a libc which crashes for static linked TLS? How do I know the answer to those two questions? I have a glibc-2.4 from redhat (the Fedora Core 4 one). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31604
[Bug libfortran/31604] Segfault at runtime on I/O with OpenMP and static linking
--- Comment #6 from pinskia at gcc dot gnu dot org 2007-04-17 16:23 --- So pthreads is not linking in correctly. This was a known issue I thought and maybe in a way a non issue. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31604
[Bug libfortran/31604] Segfault at runtime on I/O with OpenMP and static linking
--- Comment #5 from fxcoudert at gcc dot gnu dot org 2007-04-17 16:05 --- Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 140130416 (LWP 25328)] 0x in ?? () (gdb) where #0 0x in ?? () #1 0x0804cdbb in get_external_unit (n=6, do_create=1) at /home/fxcoudert/gfortran_nightbuild/trunk/libgfortran/../gcc/gthr-posix.h:613 #2 0x0804b987 in data_transfer_init (dtp=0xbfe9b024, read_flag=0) at /home/fxcoudert/gfortran_nightbuild/trunk/libgfortran/io/transfer.c:1702 #3 0x0804827f in MAIN__.omp_fn.0 (.omp_data_i=0x0) at hello.f90:2 #4 0x08048235 in MAIN__ () at hello.f90:2 #5 0x080482dd in main (argc=Cannot access memory at address 0x1 The line 613 in gcc/gthr-posix.h is the call to pthread_mutex_trylock() in: static inline int __gthread_mutex_trylock (__gthread_mutex_t *mutex) { if (__gthread_active_p ()) return __gthrw_(pthread_mutex_trylock) (mutex); else return 0; } -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Last reconfirmed|2007-04-17 15:56:53 |2007-04-17 16:05:21 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31604
[Bug libfortran/31604] Segfault at runtime on I/O with OpenMP and static linking
--- Comment #4 from pinskia at gcc dot gnu dot org 2007-04-17 15:59 --- You check where the segfault is happening. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31604
[Bug libfortran/31604] Segfault at runtime on I/O with OpenMP and static linking
--- Comment #2 from pinskia at gcc dot gnu dot org 2007-04-17 15:43 --- > (iii) having a statically linked binary Can you check that the pthread functions are being resolved? Also do you have a libc which crashes for static linked TLS? -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |WAITING http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31604
[Bug libfortran/31604] Segfault at runtime on I/O with OpenMP and static linking
--- Comment #1 from fxcoudert at gcc dot gnu dot org 2007-04-17 14:03 --- It also fails with non-preconnected unit, if the unit is opened outside the parallel region: $ cat hello.f90 integer :: tid open (10, file="foo") !$omp parallel private(tid) tid = 0 if (tid .eq. 0) write(10,*) 'hello' !$omp end parallel end $ gfortran -fopenmp hello.f90 -g -static && ./a.out zsh: segmentation fault ./a.out -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-04-17 14:03:13 date|| Summary|Segfault at runtime on I/O |Segfault at runtime on I/O |to preconnected unit with |with OpenMP and static |OpenMP |linking http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31604