Skip to content

[VL] Initialize typeConvertor_ in VeloxToSubstraitPlanConvertor#11682

Merged
rui-mo merged 1 commit intoapache:mainfrom
acvictor:acvictor/ubSanError
Mar 3, 2026
Merged

[VL] Initialize typeConvertor_ in VeloxToSubstraitPlanConvertor#11682
rui-mo merged 1 commit intoapache:mainfrom
acvictor:acvictor/ubSanError

Conversation

@acvictor
Copy link
Contributor

@acvictor acvictor commented Mar 2, 2026

What changes are proposed in this pull request?

When running Gluten CPP tests with ASan/UBSan I see the following failure in velox_plan_conversion_test

[----------] 3 tests from SubstraitExtensionCollectorTest
  ...
I20260302 13:05:13.832439 18017 Task.cpp:2413] Terminating task test_cursor_3 with state Finished after running for 1ms
/mnt/vss/_work/1/s/Gluten/cpp/velox/substrait/VeloxToSubstraitPlan.cc:200:83: runtime error: member call on null pointer of type 'struct element_type'
    #0 0x155516780544 in gluten::VeloxToSubstraitPlanConvertor::toSubstrait(google::protobuf::Arena&, std::shared_ptr<facebook::velox::core::ValuesNode const> const&, substrait::ReadRel*) (/mnt/vss/_work/1/s/Gluten/cpp/build/releases/libvelox.so+0x24d80544) (BuildId: 3823968b38694acf997dceea565932e47a84025b)
    #1 0x155516787ff2 in gluten::VeloxToSubstraitPlanConvertor::toSubstrait(google::protobuf::Arena&, std::shared_ptr<facebook::velox::core::PlanNode const> const&, substrait::Rel*) (/mnt/vss/_work/1/s/Gluten/cpp/build/releases/libvelox.so+0x24d87ff2) (BuildId: 3823968b38694acf997dceea565932e47a84025b)
    #2 0x15551678b61f in gluten::VeloxToSubstraitPlanConvertor::toSubstrait(google::protobuf::Arena&, std::shared_ptr<facebook::velox::core::ProjectNode const> const&, substrait::ProjectRel*) (/mnt/vss/_work/1/s/Gluten/cpp/build/releases/libvelox.so+0x24d8b61f) (BuildId: 3823968b38694acf997dceea565932e47a84025b)
    #3 0x155516788760 in gluten::VeloxToSubstraitPlanConvertor::toSubstrait(google::protobuf::Arena&, std::shared_ptr<facebook::velox::core::PlanNode const> const&, substrait::Rel*) (/mnt/vss/_work/1/s/Gluten/cpp/build/releases/libvelox.so+0x24d88760) (BuildId: 3823968b38694acf997dceea565932e47a84025b)
    #4 0x15551678a118 in gluten::VeloxToSubstraitPlanConvertor::toSubstrait(google::protobuf::Arena&, std::shared_ptr<facebook::velox::core::PlanNode const> const&) (/mnt/vss/_work/1/s/Gluten/cpp/build/releases/libvelox.so+0x24d8a118) (BuildId: 3823968b38694acf997dceea565932e47a84025b)
    #5 0x5555620a121b in gluten::VeloxSubstraitRoundTripTest::assertPlanConversion(std::shared_ptr<facebook::velox::core::PlanNode const> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xcb4d21b) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #6 0x55556201ff8e in gluten::VeloxSubstraitRoundTripTest_project_Test::TestBody() (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xcacbf8e) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #7 0x555562105acc in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xcbb1acc) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #8 0x5555620f4f0d in testing::Test::Run() (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xcba0f0d) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #9 0x5555620f50c4 in testing::TestInfo::Run() (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xcba10c4) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #10 0x5555620f51e4 in testing::TestSuite::Run() (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xcba11e4) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #11 0x5555620fcf2b in testing::internal::UnitTestImpl::RunAllTests() (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xcba8f2b) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #12 0x5555620f53ac in testing::UnitTest::Run() (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xcba13ac) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #13 0x555561d800c6 in main (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xc82c0c6) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)
    #14 0x1554ec027efa in __libc_start_call_main (/usr/lib/libc.so.6+0x27efa) (BuildId: 770b2da56f3278b92bc9ac4649f450a417ace260)
    #15 0x1554ec027fba in __libc_start_main (/usr/lib/libc.so.6+0x27fba) (BuildId: 770b2da56f3278b92bc9ac4649f450a417ace260)
    #16 0x555561da1514 in _start (/mnt/vss/_work/1/s/Gluten/cpp/build/velox/tests/velox_plan_conversion_test+0xc84d514) (BuildId: 3161011723acf3e0b9f071279f41d6ce7480fd14)

  *** UBSAN ERROR: velox_plan_conversion_test ***
42:/mnt/vss/_work/1/s/Gluten/cpp/velox/substrait/VeloxToSubstraitPlan.cc:200:83: runtime error: member call on null pointer of type 'struct element_type'

This is because typeConvertor_ is declared but never default initialized.

How was this patch tested?

Existing UTs

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the VELOX label Mar 2, 2026
@acvictor acvictor marked this pull request as ready for review March 3, 2026 05:49
@acvictor
Copy link
Contributor Author

acvictor commented Mar 3, 2026

@rui-mo can you please review this PR? Thanks in advance!

Copy link
Contributor

@rui-mo rui-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@rui-mo rui-mo merged commit eb8133b into apache:main Mar 3, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants