https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65904
Bug ID: 65904 Summary: Memory corruption with acc_shutdown, nvptx offloading, libgomp.oacc-c-c++-common/asyncwait-1.c Product: gcc Version: unknown Status: UNCONFIRMED Keywords: openacc Severity: normal Priority: P3 Component: libgomp Assignee: jules at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- Seems to have appeared with the "recent" libgomp changes (r221878, r221922). *** glibc detected *** ./asyncwait-1.exe: double free or corruption (!prev): 0x0000000001cfdcf0 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x2ac3b574bb96] [...]/build-gcc/x86_64-unknown-linux-gnu/./libgomp/.libs/libgomp.so.1(+0x153dd)[0x2ac3b52a33dd] [...]/build-gcc/x86_64-unknown-linux-gnu/./libgomp/.libs/libgomp.so.1(acc_shutdown+0x115)[0x2ac3b52a57a5] ./asyncwait-1.exe[0x40333d] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x2ac3b56ee76d] ./asyncwait-1.exe[0x400fb9] ======= Memory map: ======== [...] Valgrind reports: [...] ==24645== Invalid read of size 8 ==24645== at 0x60A53C8: gomp_free_memmap (target.c:914) ==24645== by 0x60A77A4: acc_shutdown (oacc-init.c:229) ==24645== by 0x402254: main (in [...]/asyncwait-1.exe) ==24645== Address 0xda94f78 is 88 bytes inside a block of size 1,512 free'd ==24645== at 0x4C2A739: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==24645== by 0x60A53DC: gomp_free_memmap (target.c:917) ==24645== by 0x60A77A4: acc_shutdown (oacc-init.c:229) ==24645== by 0x402254: main (in [...]/asyncwait-1.exe) [...]