https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88411
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu.org --- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Here is some debugging info. Does not happen every time: $ gfortran a.f90 -pthread $ valgrind --tool=drd ./a.out ==4274== drd, a thread error detector ==4274== Copyright (C) 2006-2017, and GNU GPL'd, by Bart Van Assche. ==4274== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==4274== Command: ./a.out ==4274== ==4274== Thread 3: ==4274== Conflicting load by thread 3 at 0x05fe2268 size 4 ==4274== at 0x5075A80: buf_flush (unix.c:533) ==4274== by 0x5072D62: sflush (unix.h:89) ==4274== by 0x5072D62: _gfortrani_data_transfer_init_worker (transfer.c:3176) ==4274== by 0x507D213: async_io (async.c:135) ==4274== by 0x4C30CC3: vgDrd_thread_wrapper (drd_pthread_intercepts.c:444) ==4274== by 0x5A22723: start_thread (in /lib64/libpthread-2.22.so) ==4274== by 0x5D23E8C: clone (in /lib64/libc-2.22.so) ==4274== Address 0x5fe2268 is at offset 56 from 0x5fe2230. Allocation context: ==4274== at 0x4C2F830: calloc (vg_replace_malloc.c:711) ==4274== by 0x4E69BB2: _gfortrani_xcalloc (memory.c:83) ==4274== by 0x5075790: fd_to_stream (unix.c:1096) ==4274== by 0x5076501: _gfortrani_open_external (unix.c:1572) ==4274== by 0x506C0AA: _gfortrani_new_unit (open.c:535) ==4274== by 0x506C9F5: already_open (open.c:711) ==4274== by 0x506C9F5: _gfortran_st_open (open.c:888) ==4274== by 0x400F82: MAIN__ (in /home/ig25/Krempel/A2/a.out) ==4274== by 0x401302: main (in /home/ig25/Krempel/A2/a.out) ==4274== Other segment start (thread 1) ==4274== at 0x4C34AB8: pthread_mutex_unlock_intercept (drd_pthread_intercepts.c:978) ==4274== by 0x4C34AB8: pthread_mutex_unlock (drd_pthread_intercepts.c:991) ==4274== by 0x507351E: data_transfer_init (transfer.c:3147) ==4274== by 0x400FC4: MAIN__ (in /home/ig25/Krempel/A2/a.out) ==4274== by 0x401302: main (in /home/ig25/Krempel/A2/a.out) ==4274== Other segment end (thread 1) ==4274== at 0x5A29DCD: ??? (in /lib64/libpthread-2.22.so) ==4274== by 0x507598A: raw_write (unix.c:366) ==4274== by 0x5075AB9: buf_flush (unix.c:540) ==4274== by 0x5075AB9: buf_flush (unix.c:526) ==4274== by 0x5075BCD: buf_write (unix.c:653) ==4274== by 0x5075BCD: buf_write (unix.c:626) ==4274== by 0x506F186: swrite (unix.h:59) ==4274== by 0x506F186: write_buf (transfer.c:865) ==4274== by 0x506F280: unformatted_write (transfer.c:1150) ==4274== by 0x506FC09: _gfortrani_transfer_array_inner (transfer.c:2486) ==4274== by 0x506FCCA: _gfortran_transfer_array (transfer.c:2535) ==4274== by 0x401079: MAIN__ (in /home/ig25/Krempel/A2/a.out) ==4274== by 0x401302: main (in /home/ig25/Krempel/A2/a.out) ==4274== =