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 the bug of array out-of-bounds access #48230

Merged
merged 4 commits into from
Jul 12, 2024

Conversation

sevev
Copy link
Contributor

@sevev sevev commented Jul 11, 2024

Why I'm doing

Pindex support page compression after version 3.1.13/3.2.9, and we will record each page compressed size into page_off which is a vector. However, if you upgrade from old version and disable pindex shard compression in pre-version, the page_off only keep one element and you may meet out-of-bounds access.

The stack is following:

*** Aborted at 1720652163 (unix time) try "date -d @1720652163" if you are using GNU date ***
PC: @          0x515ebd2 starrocks::ImmutableIndex::_read_page()
*** SIGSEGV (@0x7f8d3df760b8) received by PID 383772 (TID 0x7f6fdb9dc700) from PID 1039622328; stack trace: ***
    @          0x653d642 google::(anonymous namespace)::FailureSignalHandler()
    @     0x7f90873acc17 os::Linux::chained_handler()
    @     0x7f90873b4565 JVM_handle_linux_signal
    @     0x7f90873a97b3 signalHandler()
    @     0x7f908684a630 (unknown)
    @          0x515ebd2 starrocks::ImmutableIndex::_read_page()
    @          0x5173158 starrocks::ImmutableIndex::_get_in_shard_by_page()
    @          0x5176bfa starrocks::ImmutableIndex::_get_in_shard()
    @          0x51772c6 starrocks::ImmutableIndex::get()
    @          0x5177c25 starrocks::PersistentIndex::_get_from_immutable_index()
    @          0x518481c starrocks::PersistentIndex::upsert()
    @          0x4dd1c05 starrocks::PrimaryIndex::_upsert_into_persistent_index()
    @          0x4dd1f76 starrocks::PrimaryIndex::upsert()
    @          0x4ed9b98 starrocks::TabletUpdates::_do_update()
    @          0x4eea126 starrocks::TabletUpdates::_apply_normal_rowset_commit()
    @          0x4eecd96 starrocks::TabletUpdates::_apply_rowset_commit()
    @          0x4eed0e6 starrocks::TabletUpdates::do_apply()
    @          0x2d0d8ed starrocks::ThreadPool::dispatch_thread()
    @          0x2d0733a starrocks::Thread::supervise_thread()
    @     0x7f9086842ea5 start_thread
    @     0x7f9085c43b0d __clone
    @                0x0 (unknown)

What I'm doing:

Initial page_off if BE is upgrade from old version.

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.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@sevev sevev requested a review from a team as a code owner July 11, 2024 13:37
@mergify mergify bot assigned sevev Jul 11, 2024
Signed-off-by: sevev <[email protected]>
Signed-off-by: sevev <[email protected]>
Signed-off-by: sevev <[email protected]>
Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[BE Incremental Coverage Report]

pass : 5 / 5 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/storage/persistent_index.cpp 5 5 100.00% []

@wyb wyb merged commit 5725f4c into StarRocks:main Jul 12, 2024
45 checks passed
Copy link

@Mergifyio backport branch-3.3

Copy link

@Mergifyio backport branch-3.2

Copy link

@Mergifyio backport branch-3.1

@github-actions github-actions bot removed the 3.1 label Jul 12, 2024
Copy link
Contributor

mergify bot commented Jul 12, 2024

backport branch-3.3

✅ Backports have been created

Copy link
Contributor

mergify bot commented Jul 12, 2024

backport branch-3.2

✅ Backports have been created

Copy link
Contributor

mergify bot commented Jul 12, 2024

backport branch-3.1

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jul 12, 2024
mergify bot pushed a commit that referenced this pull request Jul 12, 2024
mergify bot pushed a commit that referenced this pull request Jul 12, 2024
Signed-off-by: sevev <[email protected]>
(cherry picked from commit 5725f4c)

# Conflicts:
#	be/test/storage/persistent_index_test.cpp
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