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

            Bug ID: 122137
           Summary: Testcase gfortran.dg/pdt_46.f03 fails with
                    -fsanitize=address
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gcc dot gnu.org
  Target Milestone: ---

After having seen that this testcase fails on x86_64-apple-darwin17, see

https://gcc.gnu.org/pipermail/gcc-testresults/2025-October/858685.html

I tried to reproduce this in some way.

% gfc-16 -g pdt_46.f03 -O2 -Wall -fsanitize=addresspdt_46.f03:52:17:

   52 |     x = foo(5)(a)
      |                 ^
Warning: 'x_8->vec.data' may be used uninitialized [-Wmaybe-uninitialized]
pdt_46.f03:55:9:

   55 |     y = x
      |         ^
Warning: 'y_32->vec.data' may be used uninitialized [-Wmaybe-uninitialized]


And running it:

% ./a.out 

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7fb98c0578ff in ???
#1  0x7fb98c8472da in
_ZN11__sanitizer30atomic_compare_exchange_strongINS_14atomic_uint8_tEEEbPVT_PNS2_4TypeES5_NS_12memory_orderE
        at
../../../../gcc-trunk/libsanitizer/sanitizer_common/sanitizer_atomic_clang.h:84
#2  0x7fb98c8472da in
_ZN6__asan9Allocator38AtomicallySetQuarantineFlagIfAllocatedEPNS_9AsanChunkEPvPN11__sanitizer18BufferedStackTraceE
        at ../../../../gcc-trunk/libsanitizer/asan/asan_allocator.cpp:668
#3  0x7fb98c8472da in
_ZN6__asan9Allocator10DeallocateEPvmmPN11__sanitizer18BufferedStackTraceENS_9AllocTypeE
        at ../../../../gcc-trunk/libsanitizer/asan/asan_allocator.cpp:732
#4  0x7fb98c91df28 in ___interceptor_free
        at ../../../../gcc-trunk/libsanitizer/asan/asan_malloc_linux.cpp:52
#5  0x40144f in main2
        at /home/anlauf/gcc-bugs/pdt_46.f03:52
#6  0x40144f in test
        at /home/anlauf/gcc-bugs/pdt_46.f03:32
#7  0x40144f in main
        at /home/anlauf/gcc-bugs/pdt_46.f03:29
Segmentation fault

Reply via email to