https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93624

--- Comment #2 from Juan Javier Dominguez Moreno <juan.dominguez at 
eveutilities dot com> ---
Hello,

I ran into the same problem using:

$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id
--enable-lto --enable-multilib --enable-plugin --enable-shared
--enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-libunwind-exceptions --disable-werror
gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.1.0 (GCC) 

The example is in the attached file "deallocate_test.f08".

The address sanitizer output is:

=================================================================
==17194==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f6c75f26459 in __interceptor_malloc
/build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x5591e02303fe in create_container_leak
/home/juan/temp/deallocate_test.f08:57
    #2 0x5591e0231136 in do_leak /home/juan/temp/deallocate_test.f08:42
    #3 0x5591e0230277 in deallocate_test /home/juan/temp/deallocate_test.f08:34
    #4 0x5591e0231667 in main /home/juan/temp/deallocate_test.f08:30
    #5 0x7f6c75863001 in __libc_start_main (/usr/lib/libc.so.6+0x27001)

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f6c75f26459 in __interceptor_malloc
/build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x5591e022faf0 in __deallocate_test_mod_MOD_make_object
/home/juan/temp/deallocate_test.f08:21
    #2 0x5591e02304da in create_container_leak
/home/juan/temp/deallocate_test.f08:59
    #3 0x5591e0231136 in do_leak /home/juan/temp/deallocate_test.f08:42
    #4 0x5591e0230277 in deallocate_test /home/juan/temp/deallocate_test.f08:34
    #5 0x5591e0231667 in main /home/juan/temp/deallocate_test.f08:30
    #6 0x7f6c75863001 in __libc_start_main (/usr/lib/libc.so.6+0x27001)

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f6c75f26459 in __interceptor_malloc
/build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x5591e022faf0 in __deallocate_test_mod_MOD_make_object
/home/juan/temp/deallocate_test.f08:21
    #2 0x5591e022fea9 in create_container_no_leak
/home/juan/temp/deallocate_test.f08:66
    #3 0x5591e0230b55 in do_no_leak /home/juan/temp/deallocate_test.f08:50
    #4 0x5591e0230283 in deallocate_test /home/juan/temp/deallocate_test.f08:35
    #5 0x5591e0231667 in main /home/juan/temp/deallocate_test.f08:30
    #6 0x7f6c75863001 in __libc_start_main (/usr/lib/libc.so.6+0x27001)

Indirect leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f6c75f26459 in __interceptor_malloc
/build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x5591e02305a9 in create_container_leak
/home/juan/temp/deallocate_test.f08:59
    #2 0x5591e0231136 in do_leak /home/juan/temp/deallocate_test.f08:42
    #3 0x5591e0230277 in deallocate_test /home/juan/temp/deallocate_test.f08:34
    #4 0x5591e0231667 in main /home/juan/temp/deallocate_test.f08:30
    #5 0x7f6c75863001 in __libc_start_main (/usr/lib/libc.so.6+0x27001)

SUMMARY: AddressSanitizer: 40 byte(s) leaked in 4 allocation(s).

Reply via email to