3.22 regression: Crash with 32bit clang + mingw + TIMESTAMP
Downstream issue: https://github.com/msys2/MINGW-packages/issues/10152
Starting with 3.22 (3.21.4 works) the following crashes:
CMakeLists.txt:
string(TIMESTAMP DEFAULT_BUILD "%Y%m%d")
$ cmake -GNinja .
-- Building for: Ninja
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is Clang 13.0.0
-- The CXX compiler identification is Clang 13.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/clang32/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/clang32/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX comp
Segmentation fault
Thread 1 received signal SIGSEGV, Segmentation fault.
0x010eea42 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__set_short_size (this=0x10, __s=4) at C:/msys64/clang32/include/c++/v1/string:1500
1500 {__r_.first().__s.__size_ = (unsigned char)(__s << 1);}
(gdb) bt
#0 0x010eea42 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__set_short_size (this=0x10, __s=4)
at C:/msys64/clang32/include/c++/v1/string:1500
#1 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init (this=0x10, __s=0x93e9d0 "@▒D\v@▒D\v\b▒", __sz=4)
at C:/msys64/clang32/include/c++/v1/string:1882
#2 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string (this=0x10, __s=0x93e9d0 "@▒D\v@▒D\v\b▒", __n=4)
at C:/msys64/clang32/include/c++/v1/string:1915
#3 cmTimestamp::AddTimestampComponent (this=0x93ec18, flag=89 'Y',
timeStruct=..., timeT=1637518452)
at /usr/src/debug/cmake-3.22.0/Source/cmTimestamp.cxx:217
#4 0x010ee6bf in cmTimestamp::CreateTimestampFromTimeT (this=0x93ec18,
timeT=<optimized out>, formatString=..., utcFlag=<optimized out>)
at /usr/src/debug/cmake-3.22.0/Source/cmTimestamp.cxx:98
#5 0x010ee3b4 in cmTimestamp::CurrentTime (this=0x93ec18, formatString=...,
utcFlag=<optimized out>)
at /usr/src/debug/cmake-3.22.0/Source/cmTimestamp.cxx:46
#6 0x0108adbf in (anonymous namespace)::HandleTimestampCommand (args=...,
status=...) at /usr/src/debug/cmake-3.22.0/Source/cmStringCommand.cxx:850
#7 0x0119c6ff in cmSubcommandTable::operator() (this=<optimized out>,
key=..., args=..., status=...)
at /usr/src/debug/cmake-3.22.0/Source/cmSubcommandTable.cxx:27
#8 0x0b458439 in ?? ()
Backtrace stopped: previous
Edited by Christoph Reiter