Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] fix array_map crash #55383

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Conversation

before-Sunrise
Copy link
Contributor

@before-Sunrise before-Sunrise commented Jan 23, 2025

Why I'm doing:

for BinaryColumnBase::replicate, it can allocate a huge vector, which size exceed uint32 max, so need to call upgrade_if_overflow to avoid check faild:
F20250123 12:27:53.005990 140324118660672 binary_column.cpp:36] Check failed: _bytes.size() == _offsets.back() (20624569792 vs. 3444700608)

W20250124 11:08:55.984929 140035107186240 stack_util.cpp:347] 2025-01-24 11:08:55.984899, query_id=8b99278a-da00-11ef-9066-00163e03f27c, fragment_instance_id=8b99278a-da00-11ef-9066-00163e03f284 throws exception: std::bad_alloc, trace:
     @          0x916689e  __wrap___cxa_throw
    @          0x5a4ab5e  starrocks::AllocatorFactory<starrocks::Allocator, starrocks::MemHookAllocator>::checked_alloc(unsigned long) [clone .part.0]
    @          0x5a4b449  starrocks::AllocatorFactory<starrocks::Allocator, starrocks::MemHookAllocator>::checked_alloc(unsigned long)
    @          0x5817894  std::vector<unsigned char, starrocks::raw::RawAllocator<unsigned char, 16ul, starrocks::ColumnAllocator<unsigned char> > >::_M_default_append(unsigned long)
    @          0x584bfce  starrocks::BinaryColumnBase<unsigned int>::replicate(std::vector<unsigned int, starrocks::ColumnAllocator<unsigned int> > const&)
    @          0x5867077  starrocks::NullableColumn::replicate(std::vector<unsigned int, starrocks::ColumnAllocator<unsigned int> > const&)
    @          0x83502ae  starrocks::StatusOr<std::shared_ptr<starrocks::Column> > starrocks::ArrayMapExpr::evaluate_lambda_expr<false, true>(starrocks::ExprContext*, starrocks::Chunk*, std::vector<std::shared_ptr<starrocks::Column>, std::allocator<std::shared_ptr<starrocks::Column      ^A
    @          0x8349863  starrocks::ArrayMapExpr::evaluate_checked(starrocks::ExprContext*, starrocks::Chunk*)
    @          0x5a50443  starrocks::ExprContext::evaluate(starrocks::Expr*, starrocks::Chunk*, unsigned char*)
    @          0x833ff14  starrocks::VectorizedFunctionCallExpr::evaluate_checked(starrocks::ExprContext*, starrocks::Chunk*)
    @          0x5a50443  starrocks::ExprContext::evaluate(starrocks::Expr*, starrocks::Chunk*, unsigned char*)
    @          0x5a50952  starrocks::ExprContext::evaluate(starrocks::Chunk*, unsigned char*)
    @          0x7f33a85  starrocks::pipeline::ProjectOperator::push_chunk(starrocks::RuntimeState*, std::shared_ptr<starrocks::Chunk> const&)
    @          0x579b088  starrocks::pipeline::PipelineDriver::process(starrocks::RuntimeState*, int)
    @          0x8cf53f3  starrocks::pipeline::GlobalDriverExecutor::_worker_thread()
    @          0x91a55a2  starrocks::ThreadPool::dispatch_thread()
    @          0x919d4c9  starrocks::Thread::supervise_thread(void*)
    @     0x7f5cf933bac3  (/usr/lib/x86_64-linux-gnu/libc.so.6+0x94ac2)
    @     0x7f5cf93cd850  (/usr/lib/x86_64-linux-gnu/libc.so.6+0x12684f)

What I'm doing:

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.4
    • 3.3
    • 3.2
    • 3.1
    • 3.0

Signed-off-by: before-Sunrise <unclejyj@gmail.com>
@before-Sunrise before-Sunrise requested a review from a team as a code owner January 23, 2025 13:58
Signed-off-by: before-Sunrise <unclejyj@gmail.com>
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

@silverbullet233 silverbullet233 enabled auto-merge (squash) January 24, 2025 06:18
Copy link

[BE Incremental Coverage Report]

pass : 20 / 23 (86.96%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/column/adaptive_nullable_column.h 0 1 00.00% [526]
🔵 be/src/column/binary_column.cpp 4 6 66.67% [157, 159]
🔵 be/src/exprs/array_map_expr.cpp 5 5 100.00% []
🔵 be/src/column/array_view_column.cpp 1 1 100.00% []
🔵 be/src/column/nullable_column.cpp 4 4 100.00% []
🔵 be/src/exprs/map_apply_expr.cpp 2 2 100.00% []
🔵 be/src/column/const_column.cpp 1 1 100.00% []
🔵 be/src/exec/stream/aggregate/agg_group_state.cpp 1 1 100.00% []
🔵 be/src/column/column.h 1 1 100.00% []
🔵 be/src/column/fixed_length_column_base.cpp 1 1 100.00% []

@silverbullet233 silverbullet233 merged commit d3f5052 into StarRocks:main Jan 24, 2025
60 of 62 checks passed
Copy link

@Mergifyio backport branch-3.4

@github-actions github-actions bot removed the 3.4 label Jan 24, 2025
Copy link

@Mergifyio backport branch-3.3

@github-actions github-actions bot removed the 3.3 label Jan 24, 2025
Copy link
Contributor

mergify bot commented Jan 24, 2025

backport branch-3.4

✅ Backports have been created

Copy link
Contributor

mergify bot commented Jan 24, 2025

backport branch-3.3

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 24, 2025
Signed-off-by: before-Sunrise <unclejyj@gmail.com>
(cherry picked from commit d3f5052)
mergify bot pushed a commit that referenced this pull request Jan 24, 2025
Signed-off-by: before-Sunrise <unclejyj@gmail.com>
(cherry picked from commit d3f5052)

# Conflicts:
#	be/src/column/adaptive_nullable_column.h
#	be/src/column/binary_column.cpp
#	be/src/column/binary_column.h
#	be/src/column/column.h
#	be/src/column/const_column.cpp
#	be/src/column/const_column.h
#	be/src/column/fixed_length_column_base.cpp
#	be/src/column/fixed_length_column_base.h
#	be/src/column/nullable_column.cpp
#	be/src/column/nullable_column.h
before-Sunrise added a commit to before-Sunrise/starrocks that referenced this pull request Feb 6, 2025
Signed-off-by: before-Sunrise <unclejyj@gmail.com>
silverbullet233 pushed a commit that referenced this pull request Feb 6, 2025
Signed-off-by: before-Sunrise <unclejyj@gmail.com>
wanpengfei-git pushed a commit that referenced this pull request Feb 6, 2025
Co-authored-by: before-Sunrise <71162020+before-Sunrise@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants