Closed sl1pkn07 closed 1 month ago
same script, but now in 64-bits
double free or corruption (!prev)
75% tests passed, 1 tests failed out of 4
Total Test time (real) = 10.84 sec
The following tests FAILED:
4 - glslang-gtests (Child aborted)
Errors while running CTest
CTestCostData.txt LastTest.log LastTestsFailed.log
greetings
EDIT: disable system compile flags gets same error in each arch
Takes a while to figure out what's at issue here. I think the problem you have is that after googletest runs you see this:
[==========] 1382 tests from 54 test suites ran. (4855 ms total)
[ PASSED ] 1382 tests.
corrupted size vs. prev_size while consolidating
<end of output>
Test time = 5.60 sec
----------------------------------------------------------
Test Failed.
"glslang-gtests" end time: Mar 17 00:10 CET
"glslang-gtests" time elapsed: 00:00:05
----------------------------------------------------------
Functionally, glslang seems okay, as each individual test passes. I don't know where the prev_size
is coming from. Also, I don't see an <end of output>
message, where is that coming from?
Hi
seeing the coredumpctl i see gets tons of "segfaults" (maybe one for each test i run)
but none of the coredumps get any valid/clear output because Archlinux don't ship any symbol in any package, and build glslang in Debug mode also not works :(
for example:
└───╼ coredumpctl info 2769377
PID: 2769377 (glslangtests)
UID: 1000 (sl1pkn07)
GID: 100 (users)
Signal: 6 (ABRT)
Timestamp: Tue 2020-03-17 03:21:50 CET (4h 56min ago)
Command Line: /tmp/makepkg/sl1-vulkan-git/src/glslang/build/gtests/glslangtests --test-root /tmp/makepkg/sl1-vulkan-git/src/glslang/gtests/../Test
Executable: /tmp/makepkg/sl1-vulkan-git/src/glslang/build/gtests/glslangtests
Control Group: /user.slice/user-1000.slice/session-1.scope
Unit: session-1.scope
Slice: user-1000.slice
Session: 1
Owner UID: 1000 (sl1pkn07)
Boot ID: 74e7f8ceac5c442da7e8fa7996f74bc9
Machine ID: c20ee0c57658685bfedf50384b0e3ec0
Hostname: sL1pKn07
Storage: /var/lib/systemd/coredump/core.glslangtests.1000.74e7f8ceac5c442da7e8fa7996f74bc9.2769377.1584411710000000000000.lz4
Message: Process 2769377 (glslangtests) of user 1000 dumped core.
Stack trace of thread 2769377:
#0 0x00007f23fe103ce5 raise (libc.so.6 + 0x3bce5)
#1 0x00007f23fe0ed857 abort (libc.so.6 + 0x25857)
#2 0x00007f23fe1472b0 __libc_message (libc.so.6 + 0x7f2b0)
#3 0x00007f23fe14e74a malloc_printerr (libc.so.6 + 0x8674a)
#4 0x00007f23fe1505cc _int_free (libc.so.6 + 0x885cc)
#5 0x00007f23fe860311 n/a (/tmp/makepkg/sl1-vulkan-git/src/glslang/build/SPIRV/libSPVRemapper.so + 0x12311)
Hi
if help, this is the content of the LocalResults
folder
localResults.zip
greetings
EDIT:
testing with MALLOC_CHECK_=2
get different output
[ PASSED ] 1382 tests.
free(): invalid pointer
75% tests passed, 1 tests failed out of 4
glibc on my system is 2.31
ok, builded with -fsanitize=address
discover this (64-bits build)
=================================================================
==3851555==ERROR: AddressSanitizer: attempting double-free on 0x602000006950 in thread T0:
#0 0x7f9c9c6a1960 in operator delete(void*) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:165
#1 0x7f9c9a6411a6 in __gnu_cxx::new_allocator<char const*>::deallocate(char const**, unsigned long) /usr/include/c++/9.3.0/ext/new_allocator.h:128
#2 0x7f9c9a6411a6 in std::allocator_traits<std::allocator<char const*> >::deallocate(std::allocator<char const*>&, char const**, unsigned long) /usr/include/c++/9.3.0/bits/alloc_traits.h:470
#3 0x7f9c9a6411a6 in std::_Vector_base<char const*, std::allocator<char const*> >::_M_deallocate(char const**, unsigned long) /usr/include/c++/9.3.0/bits/stl_vector.h:351
#4 0x7f9c9a6411a6 in std::_Vector_base<char const*, std::allocator<char const*> >::~_Vector_base() /usr/include/c++/9.3.0/bits/stl_vector.h:332
#5 0x7f9c9a6411a6 in std::vector<char const*, std::allocator<char const*> >::~vector() /usr/include/c++/9.3.0/bits/stl_vector.h:680
#6 0x7f9c9a6411a6 in spv::OperandParameters::~OperandParameters() /usr/src/debug/glslang/SPIRV/doc.h:168
#7 0x7f9c9a6411a6 in __tcf_2 /usr/src/debug/glslang/SPIRV/doc.cpp:1358
#8 0x7f9c99a84b3d in __cxa_finalize (/usr/lib/libc.so.6+0x3eb3d)
#9 0x7f9c9a614c47 (/tmp/makepkg/sl1-vulkan-git/src/glslang/build/SPIRV/libSPVRemapper.so+0x1cc47)
0x602000006950 is located 0 bytes inside of 8-byte region [0x602000006950,0x602000006958)
freed by thread T0 here:
#0 0x7f9c9c6a1960 in operator delete(void*) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:165
#1 0x7f9c9b036696 in __gnu_cxx::new_allocator<char const*>::deallocate(char const**, unsigned long) /usr/include/c++/9.3.0/ext/new_allocator.h:128
#2 0x7f9c9b036696 in std::allocator_traits<std::allocator<char const*> >::deallocate(std::allocator<char const*>&, char const**, unsigned long) /usr/include/c++/9.3.0/bits/alloc_traits.h:470
#3 0x7f9c9b036696 in std::_Vector_base<char const*, std::allocator<char const*> >::_M_deallocate(char const**, unsigned long) /usr/include/c++/9.3.0/bits/stl_vector.h:351
#4 0x7f9c9b036696 in std::_Vector_base<char const*, std::allocator<char const*> >::~_Vector_base() /usr/include/c++/9.3.0/bits/stl_vector.h:332
#5 0x7f9c9b036696 in std::vector<char const*, std::allocator<char const*> >::~vector() /usr/include/c++/9.3.0/bits/stl_vector.h:680
#6 0x7f9c9b036696 in spv::OperandParameters::~OperandParameters() /usr/src/debug/glslang/SPIRV/doc.h:168
#7 0x7f9c9b036696 in __tcf_2 /usr/src/debug/glslang/SPIRV/doc.cpp:1358
previously allocated by thread T0 here:
#0 0x7f9c9c6a0968 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:104
#1 0x7f9c9b05bef4 in __gnu_cxx::new_allocator<char const*>::allocate(unsigned long, void const*) /usr/include/c++/9.3.0/ext/new_allocator.h:114
#2 0x7f9c9b05bef4 in std::allocator_traits<std::allocator<char const*> >::allocate(std::allocator<char const*>&, unsigned long) /usr/include/c++/9.3.0/bits/alloc_traits.h:444
#3 0x7f9c9b05bef4 in std::_Vector_base<char const*, std::allocator<char const*> >::_M_allocate(unsigned long) /usr/include/c++/9.3.0/bits/stl_vector.h:343
#4 0x7f9c9b05bef4 in void std::vector<char const*, std::allocator<char const*> >::_M_realloc_insert<char const* const&>(__gnu_cxx::__normal_iterator<char const**, std::vector<char const*, std::allocator<char const*> > >, char const* const&) /usr/include/c++/9.3.0/bits/vector.tcc:440
SUMMARY: AddressSanitizer: double-free /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:165 in operator delete(void*)
==3851555==ABORTING
32-bits
=================================================================
==4040766==ERROR: AddressSanitizer: attempting double-free on 0xf1914050 in thread T0:
#0 0xf798f545 in operator delete(void*) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:165
#1 0xf5c06cbb in __gnu_cxx::new_allocator<char const*>::deallocate(char const**, unsigned int) /usr/include/c++/9.3.0/ext/new_allocator.h:128
#2 0xf5c06cbb in std::allocator_traits<std::allocator<char const*> >::deallocate(std::allocator<char const*>&, char const**, unsigned int) /usr/include/c++/9.3.0/bits/alloc_traits.h:470
#3 0xf5c06cbb in std::_Vector_base<char const*, std::allocator<char const*> >::_M_deallocate(char const**, unsigned int) /usr/include/c++/9.3.0/bits/stl_vector.h:351
#4 0xf5c06cbb in std::_Vector_base<char const*, std::allocator<char const*> >::~_Vector_base() /usr/include/c++/9.3.0/bits/stl_vector.h:332
#5 0xf5c06cbb in std::vector<char const*, std::allocator<char const*> >::~vector() /usr/include/c++/9.3.0/bits/stl_vector.h:680
#6 0xf5c06cbb in spv::OperandParameters::~OperandParameters() /usr/src/debug/glslang/SPIRV/doc.h:168
#7 0xf5c06cbb in __tcf_2 /usr/src/debug/glslang/SPIRV/doc.cpp:1358
#8 0xf4fb2a00 in __cxa_finalize (/usr/lib32/libc.so.6+0x37a00)
#9 0xf5bd3127 (/tmp/makepkg/sl1-lib32-vulkan-git/src/glslang/build/SPIRV/libSPVRemapper.so+0xd127)
0xf1914050 is located 0 bytes inside of 4-byte region [0xf1914050,0xf1914054)
freed by thread T0 here:
#0 0xf798f545 in operator delete(void*) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:165
#1 0xf621efcb in __gnu_cxx::new_allocator<char const*>::deallocate(char const**, unsigned int) /usr/include/c++/9.3.0/ext/new_allocator.h:128
#2 0xf621efcb in std::allocator_traits<std::allocator<char const*> >::deallocate(std::allocator<char const*>&, char const**, unsigned int) /usr/include/c++/9.3.0/bits/alloc_traits.h:470
#3 0xf621efcb in std::_Vector_base<char const*, std::allocator<char const*> >::_M_deallocate(char const**, unsigned int) /usr/include/c++/9.3.0/bits/stl_vector.h:351
#4 0xf621efcb in std::_Vector_base<char const*, std::allocator<char const*> >::~_Vector_base() /usr/include/c++/9.3.0/bits/stl_vector.h:332
#5 0xf621efcb in std::vector<char const*, std::allocator<char const*> >::~vector() /usr/include/c++/9.3.0/bits/stl_vector.h:680
#6 0xf621efcb in spv::OperandParameters::~OperandParameters() /usr/src/debug/glslang/SPIRV/doc.h:168
#7 0xf621efcb in __tcf_2 /usr/src/debug/glslang/SPIRV/doc.cpp:1358
previously allocated by thread T0 here:
#0 0xf798e605 in operator new(unsigned int) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:104
#1 0xf62458b8 in __gnu_cxx::new_allocator<char const*>::allocate(unsigned int, void const*) /usr/include/c++/9.3.0/ext/new_allocator.h:114
#2 0xf62458b8 in std::allocator_traits<std::allocator<char const*> >::allocate(std::allocator<char const*>&, unsigned int) /usr/include/c++/9.3.0/bits/alloc_traits.h:444
#3 0xf62458b8 in std::_Vector_base<char const*, std::allocator<char const*> >::_M_allocate(unsigned int) /usr/include/c++/9.3.0/bits/stl_vector.h:343
#4 0xf62458b8 in void std::vector<char const*, std::allocator<char const*> >::_M_realloc_insert<char const* const&>(__gnu_cxx::__normal_iterator<char const**, std::vector<char const*, std::allocator<char const*> > >, char const* const&) /usr/include/c++/9.3.0/bits/vector.tcc:440
SUMMARY: AddressSanitizer: double-free /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:165 in operator delete(void*)
==4040766==ABORTING
I looked at the code, based on the call stacks you provided:
It almost feels like a bug with the execution environment somehow cleaning up the wrong way on process exit.
I don't put too much priority on this given that it is outside core use of glslang as a validator/translator and happens only on process exit.
Of course, if someone can identify a change that improves it, that would be great.
as note. same output with clang 9.0.1
time is passed. the failure still here with glibc 2.33 and gcc 10.2.0
Yes, but is it a bug with the intended use of glslang, or just a testing harness issue? It seems to pass the tests and not relate to core use of glslang.
This is caused by the fact that both the SPVRemapper
and glslang
libraries include doc.cpp and its global structures, and the glslangtests
binary links against both of them. Once we get symbol visibility working this will be fixed.
This should be fixed by #3732.
script:
I want build glslang with linked SPIRV-Tools libs in static mode, but i what to build glslang as shared libs, so i add this little patch
-DBUILD_SHARED_LIBS=ON
pull this config to SPIRV-Tools, then i disabe it only in SPIRV-ToolsgslangValidation
andspirv-remap
have buildtin SPIRV-Tools from theglslang/External/spirv-tools
folder, so i not need install the SPIRV-Tools related tools/libraries. because i what build it in another packagerun test
output:
Testing/Temporally logs
CTestCostData.txt LastTest.log LastTestsFailed.log
Environment
Archlinux Gcc
cmake version 3.16.5
commit : HEAD
I never doing the test before, idk when start fail
greetings