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

            Bug ID: 107940
           Summary: temp_directory_path testcase broken
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: laurent.alfonsi at linaro dot org
  Target Milestone: ---

Testcase of gnu testsuite 
  
libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc

sometimes crashes and leaves a directory with broken user/permissions. i.e :
    $ ls -lrt
builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-gcc.git~master-stage2/aarch64-linux-gnu/libstdc++-v3/testsuite/normal14/filesystem-test.temp_directory_path.193969877.WdDDBh/
    ls: cannot access
'builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-gcc.git~master-stage2/aarch64-linux-gnu/libstdc++-v3/testsuite/normal14/filesystem-test.temp_directory_path.193969877.WdDDBh/tmp':
Permission denied
    total 0
    d????????? ? ? ? ?            ? tmp

It is probably useless but here are the cmd launched by dejagnu to build this
test :
    ABE=$PWD
    $PWD/builds/destdir/x86_64-pc-linux-gnu/bin/aarch64-linux-gnu-g++ \
    
-B$ABE/builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-$GCCVER-stage2/./gcc \
     -nostdinc++ \
    
-L$ABE/builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-$GCCVER-stage2/aarch64-linux-gnu/libstdc++-v3/src
\
    
-L$ABE/builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-$GCCVER-stage2/aarch64-linux-gnu/libstdc++-v3/src/.libs
\
    
-L$ABE/builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-$GCCVER-stage2/aarch64-linux-gnu/libstdc++-v3/libsupc++/.libs
\
     -B$ABE/builds/destdir/x86_64-pc-linux-gnu/aarch64-linux-gnu/bin/ \
     -B$ABE/builds/destdir/x86_64-pc-linux-gnu/aarch64-linux-gnu/lib/ \
     -isystem $ABE/builds/destdir/x86_64-pc-linux-gnu/aarch64-linux-gnu/include
\
     -isystem
$ABE/builds/destdir/x86_64-pc-linux-gnu/aarch64-linux-gnu/sys-include \
    
-B$ABE/builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-$GCCVER-stage2/aarch64-linux-gnu/./libstdc++-v3/src/.libs
\
     -O1  \
     -D_GNU_SOURCE \
     -DLOCALEDIR="." \
     -nostdinc++ \
    
-I$ABE/builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-$GCCVER-stage2/aarch64-linux-gnu/libstdc++-v3/include/aarch64-linux-gnu
\
    
-I$ABE/builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-$GCCVER-stage2/aarch64-linux-gnu/libstdc++-v3/include
\
     -I$ABE/snapshots/$GCCVER/libstdc++-v3/libsupc++ \
     -I$ABE/snapshots/$GCCVER/libstdc++-v3/include/backward \
     -I$ABE/snapshots/$GCCVER/libstdc++-v3/testsuite/util \
    
$ABE/snapshots/gcc~master/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc
\
     -DUSE_FILESYSTEM_TS \
     -lstdc++fs \
     -Wl,--gc-sections \
    
-L$ABE/builds/x86_64-pc-linux-gnu/aarch64-linux-gnu/gcc-$GCCVER-stage2/aarch64-linux-gnu/libstdc++-v3/src/filesystem/.libs
\
     -lm -g -static \
     -o ./temp_directory_path.exe

The test sometimes crashes while running temp_directory_path.exe
- crashes with O2, ok with O1.
- crashes when using qemu-aarch64 v7.2.0-rc0-24-g98f10f0e26, ok with qemu
v7.2.0-rc2-19-gac14949821
- on native aa64, and it seems to work.
- But valgrind reports many uninitialized values, ...
Which explain this instability to pass/fail.

sanitizer=address reports an issue while stack unwinding :

    ==13419==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000
(pc 0x0055012adf14 bp 0x0055007ff090 sp 0x0055007ff090 T0)
    ==13419==The signal is caused by a UNKNOWN memory access.
    ==13419==Hint: address points to the zero page.
        #0 0x55012adf14 in aarch64_fallback_frame_state md-unwind-support.h:74
        #1 0x55012adf14 in uw_frame_state_for
/home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/libgcc/unwind-dw2.c:1275
        #2 0x55012af2f8 in _Unwind_RaiseException
/home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/libgcc/unwind.inc:104
        #3 0x550106e5c0 in __cxa_throw
/home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/libstdc++-v3/libsupc++/eh_throw.cc:93
        #4 0x4141c4 in
std::experimental::filesystem::v1::temp_directory_path[abi:cxx11]()
/home/laurent.alfonsi/abe/snapshots/gcc.git~master/libstdc++-v3/src/filesystem/ops.cc:1337
        #5 0x40deb8 in test03()
/home/laurent.alfonsi/abe/snapshots/gcc~master/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc:121
        #6 0x4034cc in main
/home/laurent.alfonsi/abe/snapshots/gcc~master/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc:162
        #7 0x550130b2e8 in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
        #8 0x550130b3b8 in __libc_start_main_impl ../csu/libc-start.c:381
        #9 0x403aec in _start
(/home/laurent.alfonsi/abe/temp_directory_path.exe+0x403aec) (BuildId:
be39c337f0ff0a3afba1bb02d7ff75402eb15fb4)

    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV md-unwind-support.h:74 in
aarch64_fallback_frame_state
    ==13419==ABORTING

This may be linked to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90787.
But, I confirm my toolchain is based on trunk (13.0), and contains the 90787
fix.

Reply via email to