------- Comment #9 from dominiq at lps dot ens dot fr 2008-07-11 22:10 ------- The executable for the following code
open(unit=11,form='unformatted') ! print *, 'open' end also hangs. Stepping with gdb gives: Breakpoint 1, main (argc=1, argv=0xbfffdb98) at ../../../gcc-4.4-work/libgfortran/fmain.c:11 11 { (gdb) s 13 store_exe_path (argv[0]); (gdb) s *__gfortran_store_exe_path (argv0=0xbfffdd04 "/Volumes/MacBook/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out") at ../../../gcc-4.4-work/libgfortran/runtime/main.c:114 114 if (argv0[0] == '/') (gdb) s 103 { (gdb) s 114 if (argv0[0] == '/') (gdb) s 116 exe_path = argv0; (gdb) s 117 please_free_exe_path_when_done = 0; (gdb) s 133 } (gdb) s main (argc=1, argv=0xbfffdb98) at ../../../gcc-4.4-work/libgfortran/fmain.c:16 16 set_args (argc, argv); (gdb) s *__gfortran_set_args (argc=1, argv=0xbfffdb98) at ../../../gcc-4.4-work/libgfortran/runtime/main.c:82 82 argc_save = argc; (gdb) s 83 argv_save = argv; (gdb) s 84 } (gdb) s main (argc=1, argv=0xbfffdb98) at ../../../gcc-4.4-work/libgfortran/fmain.c:21 21 MAIN__ (); (gdb) s 25 } (gdb) s 0x00001ee6 in start () (gdb) s Single stepping until exit from function start, which has no line number information. 0x00003014 in dyld_stub_exit () (gdb) s Single stepping until exit from function dyld_stub_exit, which has no line number information. 0x8fe18b20 in __dyld_fast_stub_binding_helper_interface () (gdb) s Single stepping until exit from function __dyld_fast_stub_binding_helper_interface, which has no line number information. 0x8fe18b22 in __dyld_stub_binding_helper_interface () (gdb) s Single stepping until exit from function __dyld_stub_binding_helper_interface, which has no line number information. 0x8fe18b42 in __dyld_misaligned_stack_error () (gdb) s Single stepping until exit from function __dyld_misaligned_stack_error, which has no line number information. 0x8fe18b5a in __dyld_stub_binding_helper_interface2 () (gdb) s Single stepping until exit from function __dyld_stub_binding_helper_interface2, which has no line number information. 0x8fe06e40 in __dyld__ZN4dyld14bindLazySymbolEPK11mach_headerPm () (gdb) s Single stepping until exit from function __dyld__ZN4dyld14bindLazySymbolEPK11mach_headerPm, which has no line number information. 0x8fe0e430 in __dyld__ZNK11ImageLoader15containsAddressEPKv () (gdb) s Single stepping until exit from function __dyld__ZNK11ImageLoader15containsAddressEPKv, which has no line number information. 0x8fe13250 in __dyld__ZNK16ImageLoaderMachO13beginSegmentsEv () (gdb) s Single stepping until exit from function __dyld__ZNK16ImageLoaderMachO13beginSegmentsEv, which has no line number information. 0x8fe0e457 in __dyld__ZNK11ImageLoader15containsAddressEPKv () (gdb) s Single stepping until exit from function __dyld__ZNK11ImageLoader15containsAddressEPKv, which has no line number information. 0x8fe06f22 in __dyld__ZN4dyld14bindLazySymbolEPK11mach_headerPm () (gdb) s Single stepping until exit from function __dyld__ZN4dyld14bindLazySymbolEPK11mach_headerPm, which has no line number information. 0x8fe18b6f in __dyld_stub_binding_helper_interface2 () (gdb) s Single stepping until exit from function __dyld_stub_binding_helper_interface2, which has no line number information. 0x93b6aeaf in exit () (gdb) s Single stepping until exit from function exit, which has no line number information. 0xa0a74539 in dyld_stub___cxa_finalize () (gdb) s Single stepping until exit from function dyld_stub___cxa_finalize, which has no line number information. 0x93b6aeeb in __cxa_finalize () (gdb) s Single stepping until exit from function __cxa_finalize, which has no line number information. 0x8fe04ee0 in __dyld__ZN4dyld14runTerminatorsEPv () (gdb) s Single stepping until exit from function __dyld__ZN4dyld14runTerminatorsEPv, which has no line number information. 0x8fe12ee0 in __dyld__ZN16ImageLoaderMachO13doTerminationERKN11ImageLoader11LinkContextE () (gdb) s Single stepping until exit from function __dyld__ZN16ImageLoaderMachO13doTerminationERKN11ImageLoader11LinkContextE, which has no line number information. cleanup () at ../../../gcc-4.4-work/libgfortran/runtime/main.c:174 174 { (gdb) s 0x000fa493 in __i686.get_pc_thunk.bx () (gdb) s Single stepping until exit from function __i686.get_pc_thunk.bx, which has no line number information. cleanup () at ../../../gcc-4.4-work/libgfortran/runtime/main.c:175 175 close_units (); (gdb) s *__gfortrani_close_units () at ../../../gcc-4.4-work/libgfortran/io/unit.c:688 688 __gthread_mutex_lock (&unit_lock); (gdb) s ** Simulating stepping into inlined subroutine. ** 694 if (__gthread_active_p ()) (gdb) p __gthread_active_p () No symbol "__gthread_active_p" in current context. (gdb) s 689 while (unit_root != NULL) (gdb) p unit_root No symbol "unit_root" in current context. (gdb) s 695 return __gthrw_(pthread_mutex_lock) (mutex); (gdb) s ^C Program received signal SIGINT, Interrupt. 0x93b424ee in semaphore_wait_signal_trap () If I uncomment the commented line I get: Breakpoint 1, main (argc=1, argv=0xbfffdb98) at ../../../gcc-4.4-work/libgfortran/fmain.c:11 11 { (gdb) s 13 store_exe_path (argv[0]); (gdb) s *__gfortran_store_exe_path (argv0=0xbfffdd04 "/Volumes/MacBook/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out") at ../../../gcc-4.4-work/libgfortran/runtime/main.c:114 114 if (argv0[0] == '/') (gdb) s 103 { (gdb) s 114 if (argv0[0] == '/') (gdb) s 116 exe_path = argv0; (gdb) s 117 please_free_exe_path_when_done = 0; (gdb) s 133 } (gdb) s main (argc=1, argv=0xbfffdb98) at ../../../gcc-4.4-work/libgfortran/fmain.c:16 16 set_args (argc, argv); (gdb) s *__gfortran_set_args (argc=1, argv=0xbfffdb98) at ../../../gcc-4.4-work/libgfortran/runtime/main.c:82 82 argc_save = argc; (gdb) s 83 argv_save = argv; (gdb) s 84 } (gdb) s main (argc=1, argv=0xbfffdb98) at ../../../gcc-4.4-work/libgfortran/fmain.c:21 21 MAIN__ (); (gdb) s ^C Program received signal SIGINT, Interrupt. 0x93b424ee in semaphore_wait_signal_trap () >From pr30617 I noticed that the "mutex" behavior is not the same on Darwin and on Linux, but I don't know anything about the whole stuff. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36806