Skip to content

Conversation

@harishisnow
Copy link

ClickHouse power pc build release version crashes by using following SQL(which is essentially functional test 02287_legacy_column_name_of_tuple_literal_over_distributed):

select if(in(dummy, tuple(0, 1)), 'ok', 'ok') from remote('localhost', system.one) settings legacy_column_name_of_tuple_literal=1, prefer_localhost_replica=0;

Note that debug version(with -O0 option to compile) works fine which indicates it could be a compiler optimization issue.

A llvm github issue was created:
llvm/llvm-project#102311

Stack info from core dump:

Core was generated by `../clickhouse18-2 server '.

Program terminated with signal SIGSEGV, Segmentation fault.

#0 std::_1::construct_at[abi:v15000]<DB::ExecutingGraph::Node*, DB::ExecutingGraph::Node*, DB::ExecutingGraph::Node*>(DB::ExecutingGraph::Node, DB::ExecutingGraph::Node&&) (_location=0xfb610150283a0a00, __args=)

at ./contrib/llvm-project/libcxx/include/__memory/construct_at.h:35
35 return ::new (VSTD::voidify(*location)) _Tp(_VSTD::forward<_Args>(_args)...);

[Current thread is 1 (Thread 0x7589b2f29110 (LWP 242663))]

(gdb) bt

#0 std::_1::construct_at[abi:v15000]<DB::ExecutingGraph::Node*, DB::ExecutingGraph::Node*, DB::ExecutingGraph::Node*>(DB::ExecutingGraph::Node, DB::ExecutingGraph::Node&&) (_location=0xfb610150283a0a00, __args=)

at ./contrib/llvm-project/libcxx/include/__memory/construct_at.h:35
{{boostorg/context#1 std::_1::allocator_traits<std::1::allocatorDB::ExecutingGraph::Node* >::construct[abi:v15000]<DB::ExecutingGraph::Node*, DB::ExecutingGraph::Node*, void, void>(std::1::allocatorDB::ExecutingGraph::Node*&, DB::ExecutingGraph::Node*, DB::ExecutingGraph::Node&&) (_p=0xfb610150283a0a00, }}

__args=)

at ./contrib/llvm-project/libcxx/include/__memory/allocator_traits.h:298
boostorg/context#2 std::_1::deque<DB::ExecutingGraph::Node*, std::_1::allocatorDB::ExecutingGraph::Node* >::push_back (this=0x7589b2f27ec0, __v=)

at ./contrib/llvm-project/libcxx/include/deque:1967
boostorg/context#3 std::_1::queue<DB::ExecutingGraph::Node*, std::1::deque<DB::ExecutingGraph::Node*, std::_1::allocatorDB::ExecutingGraph::Node* > >::pushabi:v15000 (this=0x7589b2f27ec0, __v=)

at ./contrib/llvm-project/libcxx/include/queue:365
{{boostorg/context#4 DB::ExecutingGraph::updateNode (this=0x7589b6d41300, pid=0, queue=..., }}

async_queue=...)

at ./ppc18-rel/./src/Processors/Executors/ExecutingGraph.cpp:344
boostorg/context#5 0x0000000022a679ec in DB::PipelineExecutor::executeStepImpl (

this=0x7589b6e78818, thread_num=, yield_flag=0x0)

at ./ppc18-rel/./src/Processors/Executors/PipelineExecutor.cpp:291
-Type for more, q to quit, c to continue without paging-c

boostorg/context#6 0x0000000022a66f0c in DB::PipelineExecutor::executeSingleThread (

this=0x7589b6e78818, thread_num=0)

at ./ppc18-rel/./src/Processors/Executors/PipelineExecutor.cpp:238
{{boostorg/context#7 DB::PipelineExecutor::executeImpl (this=0x7589b6e78818, }}

num_threads=, concurrency_control=)

at ./ppc18-rel/./src/Processors/Executors/PipelineExecutor.cpp:410
{{boostorg/context#8 0x0000000022a66bf4 in DB::PipelineExecutor::execute (this=0x7589b6e78818, }}

num_threads=1, concurrency_control=)

at ./ppc18-rel/./src/Processors/Executors/PipelineExecutor.cpp:110
{{boostorg/context#9 0x0000000022a76684 in DB::threadFunction (data=..., thread_group=..., }}

{{ num_threads=1, }}

concurrency_control=<error reading variable: Unable to access DWARF register number 73>)

at ./ppc18-rel/./src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:83
boostorg/context#10 DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0::operator()() const (this=)

at ./ppc18-rel/./src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:109
boostorg/context#11 std::_1::invoke[abi:v15000]<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&) (_f=...)

at ./contrib/llvm-project/libcxx/include/__functional/invoke.h:394
boostorg/context#12 ZNSt3118apply_tuple_implB6v15000IRZN2DB28PullingAsyncPipelineExecutor4pullERNS1_5ChunkEmE3$_0RNS_5tupleIJEEETpTnmJEEEDcOT_OT0_NS_15tuple_indicesIJXspT1_EEEE (_f=..., __t=...) at ./contrib/llvm-project/libcxx/include/tuple:1789

boostorg/context#13 std::_1::apply[abi:v15000]<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::1::tuple<>&) (_f=..., __t=...)

at ./contrib/llvm-project/libcxx/include/tuple:1798
boostorg/context#14 ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::{lambda()https://github.com/boostorg/context/issues/1}::operator()() (this=) at ./src/Common/ThreadPool.h:251

boostorg/context#15 std::_1::invoke[abi:v15000]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::{lambda()https://github.com/boostorg/context/issues/1}&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&) (_f=...)

at ./contrib/llvm-project/libcxx/include/__functional/invoke.h:394
boostorg/context#16 std::_1::invoke_void_return_wrapper<void, true>::call<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::{lambda()https://github.com/boostorg/context/issues/1}&>(ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::{lambda()https://github.com/boostorg/context/issues/1}&) (_args=...)

at ./contrib/llvm-project/libcxx/include/__functional/invoke.h:479
boostorg/context#17 std::_1::function::_default_alloc_func<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::{lambda()https://github.com/boostorg/context/issues/1}, void ()>::operator()abi:v15000 (

this=)

at ./contrib/llvm-project/libcxx/include/__functional/function.h:235
boostorg/context#18 std::_1::function::policy_invoker<void ()>::call_impl<std::1::function::default_alloc_func<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::{lambda()https://github.com/boostorg/context/issues/1}, void ()> >(std::1::function::_policy_storage const*) (

__buf=)

at ./contrib/llvm-project/libcxx/include/__functional/function.h:716
boostorg/context#19 0x000000001ad68d4c in std::_1::function::_policy_func<void ()>::operator()abi:v15000 const (this=0x7589b2f28570)

at ./contrib/llvm-project/libcxx/include/__functional/function.h:848
boostorg/context#20 std::__1::function<void()>::operator() (this=0x7589b2f28570)

at ./contrib/llvm-project/libcxx/include/__functional/function.h:1187
{{boostorg/context#21 ThreadPoolImplstd::__1::thread::worker (this=0x758b92e42e40, }}

thread_it=...) at ./ppc18-rel/./src/Common/ThreadPool.cpp:462
boostorg/context#22 0x000000001ad6def4 in ThreadPoolImplstd::_1::thread::scheduleImpl(std::1::function<void ()>, Priority, std::_1::optional, bool)::{lambda()https://github.com/boostorg/context/pull/2}::operator()() const (this=0x758b064491a8)

at ./ppc18-rel/./src/Common/ThreadPool.cpp:219
boostorg/context#23 std::_1::invoke[abi:v15000]<ThreadPoolImplstd::1::thread::scheduleImpl(std::1::function<void ()>, Priority, std::1::optional, bool)::{lambda()https://github.com/boostorg/context/pull/2}>(ThreadPoolImplstd::1::thread::scheduleImpl(std::1::function<void ()>, Priority, std::1::optional, bool)::{lambda()https://github.com/boostorg/context/pull/2}&&) (_f=...)

at ./contrib/llvm-project/libcxx/include/__functional/invoke.h:394
boostorg/context#24 ZNSt3116thread_executeB6v15000INS_10unique_ptrINS_15thread_structENS_14default_deleteIS2_EEEEZN14ThreadPoolImplINS_6threadEE12scheduleImplIvEET_NS_8functionIFvvEEE8PriorityNS_8optionalImEEbEUlvE0_JETpTnmJEEEvRNS_5tupleIJSA_T0_DpT1_EEENS_15tuple_indicesIJXspT2_EEEE (_t=...)

at ./contrib/llvm-project/libcxx/include/thread:284
boostorg/context#25 std::_1::thread_proxy[abi:v15000]<std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_deletestd::1::thread_struct >, ThreadPoolImplstd::1::thread::scheduleImpl(std::1::function<void ()>, Priority, std::_1::optional, bool)::{lambda()https://github.com/boostorg/context/pull/2}> >(void*) (

__vp=0x758b064491a0) at ./contrib/llvm-project/libcxx/include/thread:295
boostorg/context#26 0x0000758b93ce8838 in start_thread ()

from /lib/powerpc64le-linux-gnu/libpthread.so.0

boostorg/context#27 0x0000758b93beba44 in clone () from /lib/powerpc64le-linux-gnu/libc.so.6

@CLAassistant
Copy link

CLAassistant commented Sep 13, 2024

CLA assistant check
All committers have signed the CLA.

@harishisnow
Copy link
Author

The fix contains handling of VS63 register

@harishisnow harishisnow force-pushed the fix_clickhouse_crash_on_power_pc branch from 864118d to 59f5e01 Compare September 17, 2024 05:11
@rschu1ze rschu1ze self-assigned this Oct 8, 2024
@rschu1ze
Copy link
Member

rschu1ze commented Oct 8, 2024

@harishisnow Unfortunately, nobody in the ClickHouse team is able to double-check PPC64 assembly. I generally like to get your PR merged but I would feel (much) better if the upstream fix boostorg/context#267 was merged first. Having that other fix merged first means the Boost maintainers are okay with it - that would give me a lot more confidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants