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 stack use after scope when get extra file size (backport #39704) #39741

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 23, 2024

This is an automatic backport of pull request #39704 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

Why I'm doing: When in ASAN mode, we find that BE crash because stack use after scope: ``` ==2519==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7f655d1a9750 at pc 0x00000ac2e06b bp 0x7f655d1a95f0 sp 0x7f655d1a95e8 READ of size 8 at 0x7f655d1a9750 thread T4331 #0 0xac2e06a in std::__cxx11::basic_string, std::allocator >::length() const /opt/rh/gcc-toolset-10/root/usr/include/c++/10.3.0/bits/basic_string.h:908 #1 0xad8aab2 in std::__cxx11::basic_string, std::allocator >::reserve(unsigned long) /opt/rh/gcc-toolset-10/root/usr/include/c++/10.3.0/bits/basic_string.tcc:284 #2 0x1af62f3a in std::filesystem::__cxx11::path::operator=(std::filesystem::__cxx11::path const&) ../../../.././libstdc++-v3/src/c++17/fs_path.cc:457 #3 0x1af53f8c in std::filesystem::__cxx11::_Dir::_Dir(std::filesystem::__cxx11::path const&, bool, std::error_code&) ../../../.././libstdc++-v3/src/c++17/fs_dir.cc:51 #4 0x1af53f8c in std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*) ../../../.././libstdc++-v3/src/c++17/fs_dir.cc:135 #5 0xafaf18f in std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&) /opt/rh/gcc-toolset-10/root/usr/include/c++/10.3.0/bits/fs_dir.h:387 #6 0x1323a519 in starrocks::TabletUpdates::_get_extra_file_size(long*, long*) const /root/celerdata/be/src/storage/tablet_updates.cpp:2888 ```

What I'm doing:

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

@wanpengfei-git wanpengfei-git merged commit 917d9d3 into branch-3.1 Jan 23, 2024
28 of 29 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-3.1/pr-39704 branch January 23, 2024 04:27
Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[BE Incremental Coverage Report]

pass : 4 / 4 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 src/storage/tablet_updates.cpp 4 4 100.00% []

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.

2 participants