ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
4k stars 567 forks source link

[pg] Segfault at select current_database() #1738

Open rekby opened 9 months ago

rekby commented 9 months ago

Segfault at SELECT current_database();

Reproduce:

  1. Run local_ydb with postgres experiment enabled https://github.com/ydb-platform/ydb/wiki/Local-run-postgres-tests
  2. Connect to YDB with psql: psql postgres://root:1234@localhost:5432/local
  3. echo 'SELECT current_database()' | psql postgres://root:1234@localhost:5432/local
Stacktrace

``` #0 0x00007f81707905ca in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00000000564691d2 in namestrcpy (name=0x7f8153290170, str=0x0) at /home/rekby/ydbwork/ydb/ydb/library/yql/parser/pg_wrapper/postgresql/src/backend/utils/adt/name.c:236 #2 0x0000000056460628 in current_database (fcinfo=0x7f8153290130) at /home/rekby/ydbwork/ydb/ydb/library/yql/parser/pg_wrapper/postgresql/src/backend/utils/adt/misc.c:179 #3 0x0000000055d52652 in NYql::TPgResolvedCall::DoCall (this=0x477fffbd7580, callInfo=...) at /home/rekby/ydbwork/ydb/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp:1000 #4 0x0000000055d52282 in NYql::TPgResolvedCall::DoCalculate (this=0x477fffbd7580, compCtx=...) at /home/rekby/ydbwork/ydb/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp:990 #5 0x0000000055d516d4 in NKikimr::NMiniKQL::TMutableComputationNode>::GetValue(NKikimr::NMiniKQL::TComputationContext&) const ( this=0x477fffbd7580, compCtx=...) at /home/rekby/ydbwork/ydb/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h:217 #6 0x0000000042a4603b in NKikimr::NMiniKQL::TArrayNode::DoCalculate (this=0x477ff12b23d0, ctx=...) at /-B/ydb/library/yql/minikql/computation/llvm14/mkql_computation_node_holders_codegen.cpp:244 #7 0x0000000042a45164 in NKikimr::NMiniKQL::TMutableComputationNode::GetValue (this=0x477ff12b23d0, compCtx=...) at /home/rekby/ydbwork/ydb/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h:214 #8 0x0000000042a4603b in NKikimr::NMiniKQL::TArrayNode::DoCalculate (this=0x477ff12b2460, ctx=...) at /-B/ydb/library/yql/minikql/computation/llvm14/mkql_computation_node_holders_codegen.cpp:244 #9 0x0000000042a45164 in NKikimr::NMiniKQL::TMutableComputationNode::GetValue (this=0x477ff12b2460, compCtx=...) at /home/rekby/ydbwork/ydb/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h:214 #10 0x000000004b9261f0 in NKikimr::NMiniKQL::(anonymous namespace)::TIteratorWrapper::DoCalculate (this=0x477ff12b24f0, ctx=...) at /-B/ydb/library/yql/minikql/comp_nodes/llvm14/mkql_iterator.cpp:21 #11 0x000000004b925564 in NKikimr::NMiniKQL::TMutableComputationNode::GetValue (this=0x477ff12b24f0, compCtx=...) at /home/rekby/ydbwork/ydb/ydb/library/yql/minikql/computation/mkql_computation_node_impl.h:214 #12 0x0000000042eeddcf in NKikimr::NMiniKQL::(anonymous namespace)::TComputationGraph::GetValue (this=0x477fffa3b620) at /-B/ydb/library/yql/minikql/computation/llvm14/mkql_computation_node_graph.cpp:623 #13 0x000000004de363bf in NYql::NDq::TDqTaskRunner::Run (this=0x477fff80b700) at /home/rekby/ydbwork/ydb/ydb/library/yql/dq/runtime/dq_tasks_runner.cpp:703 #14 0x000000005289626f in NYql::NDq::TDqSyncComputeActorBase::DoExecuteImpl (this=0x477ff0781e00) at /home/rekby/ydbwork/ydb/ydb/library/yql/dq/actors/compute/dq_sync_compute_actor_base.h:52 #15 0x0000000052895a0e in NYql::NDq::TDqComputeActorBase::DoExecute ( this=0x477ff0781e00) at /home/rekby/ydbwork/ydb/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h:297 #16 0x00000000528b2651 in NYql::NDq::TDqComputeActorBase::HandleExecuteBase ( this=0x477ff0781e00, ev=Python Exception : There is no member named T_. ) at /home/rekby/ydbwork/ydb/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h:1094 #17 0x0000000052894b1c in NYql::NDq::TDqComputeActorBase::BaseStateFuncBody ( this=0x477ff0781e00, ev=TAutoPtr = {...}) at /home/rekby/ydbwork/ydb/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h:246 #18 0x000000005289364f in NKikimr::NKqp::TKqpComputeActor::StateFunc (this=0x477ff0781e00, ev=TAutoPtr = {...}) at /home/rekby/ydbwork/ydb/ydb/core/kqp/compute_actor/kqp_pure_compute_actor.cpp:131 #19 0x000000003ccb286e in NActors::TActorCallbackBehaviour::Receive (this=0x477ff0781e30, actor=0x477ff0781e00, ev=TAutoPtr = {...}) at /home/rekby/ydbwork/ydb/ydb/library/actors/core/actor.cpp:232 #20 0x000000003cd20ec3 in NActors::IActor::Receive (this=0x477ff0781e00, ev=TAutoPtr = {...}) at /home/rekby/ydbwork/ydb/ydb/library/actors/core/actor.h:526 #21 0x000000003cd185be in NActors::TGenericExecutorThread::Execute (this=0x477ffcf80b00, mailbox=0x477ffb941600, hint=4184, isTailExecution=false) at /home/rekby/ydbwork/ydb/ydb/library/actors/core/executor_thread.cpp:244 #22 0x000000003cd0c56d in NActors::TGenericExecutorThread::ProcessExecutorPool(NActors::IExecutorPool*)::$_0::operator()(unsigned int, bool) const ( this=0x7f816a42ddc8, activation=4184, isTailExecution=false) at /home/rekby/ydbwork/ydb/ydb/library/actors/core/executor_thread.cpp:425 #23 0x000000003cd0bf45 in NActors::TGenericExecutorThread::ProcessExecutorPool (this=0x477ffcf80b00, pool=0x477ffeec8100) at /home/rekby/ydbwork/ydb/ydb/library/actors/core/executor_thread.cpp:478 #24 0x000000003cd0ce2e in NActors::TExecutorThread::ThreadProc (this=0x477ffcf80b00) at /home/rekby/ydbwork/ydb/ydb/library/actors/core/executor_thread.cpp:504 #25 0x0000000039dd45b6 in (anonymous namespace)::ThreadProcWrapper (param=0x477ffcf80b00) at /home/rekby/ydbwork/ydb/util/system/thread.cpp:383 #26 0x0000000039dda24d in (anonymous namespace)::TPosixThread::ThreadProxy (arg=0x477fff5894e0) at /home/rekby/ydbwork/ydb/util/system/thread.cpp:244 #27 0x00007f8170671ac3 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #28 0x00007f8170703850 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 ```

vitstn commented 9 months ago

https://github.com/ydb-platform/ydb/pull/1817