Open sternezsl opened 3 weeks ago
The reason is that there is a change related dynamic_cast
in LLVM 17.0.1
https://releases.llvm.org/17.0.1/tools/clang/docs/ReleaseNotes.html
Improved code generation for dynamic_cast to a final type. Instead of dispatching to the runtime library to compare the RTTI data, Clang now generates a direct comparison of the vtable pointer in cases where the ABI requires the vtable for a class to be unique. This optimization can be disabled with -fno-assume-unique-vtables. This optimization is not yet implemented for the MS C++ ABI.
After add the compile option -fno-assume-unique-vtables
, everything works now.
When running unittest
thrift/lib/cpp2/test/FutureTest.cpp
It crashed on https://github.com/facebook/fbthrift/blob/7db5a066e9d011c19e1df8b3e07aa37e3b7e9c99/thrift/lib/cpp2/server/ThriftServer.cpp#L393 Simple demo built with c++20 works well. The platform is linux aarch64(same segmentfault on macOS m1), LLVM version is 18.1.6