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

[Refactor] skip asan stack-use-after-scope in _get_extra_file_size #40951

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

luohaha
Copy link
Contributor

@luohaha luohaha commented Feb 7, 2024

Why I'm doing:

In asan mode, it detect that directory_iterator will have stack-use-after-scope issue, but the code seems ok. Skip the check for now to continue the rest tests until we find out why.

==26577==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7f8adf303538 at pc 0x00000a79369d bp 0x7f8adf303390 sp 0x7f8adf303388
READ of size 8 at 0x7f8adf303538 thread T5313
   #0 0xa79369c in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const /opt/rh/gcc-toolset-10/root/usr/include/c++/10.3.0/bits/basic_string.h:187
   #1 0xa793976 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_is_local() const /opt/rh/gcc-toolset-10/root/usr/include/c++/10.3.0/bits/basic_string.h:222
   #2 0xa791ea1 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::capacity() const /opt/rh/gcc-toolset-10/root/usr/include/c++/10.3.0/bits/basic_string.h:966
   #3 0xa8ed5c2 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long) /opt/rh/gcc-toolset-10/root/usr/include/c++/10.3.0/bits/basic_string.tcc:287
   #4 0x18abc9ca in std::filesystem::__cxx11::path::operator=(std::filesystem::__cxx11::path const&) ../../../.././libstdc++-v3/src/c++17/fs_path.cc:457
   #5 0x18aada1c in std::filesystem::__cxx11::_Dir::_Dir(std::filesystem::__cxx11::path const&, bool, std::error_code&) ../../../.././libstdc++-v3/src/c++17/fs_dir.cc:51
   #6 0x18aada1c 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
   #7 0xab11cd5 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
   #8 0x12d1f597 in starrocks::TabletUpdates::_get_extra_file_size() const /root/starrocks/be/src/storage/tablet_updates.cpp:2885

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

Signed-off-by: luohaha <18810541851@163.com>
@luohaha luohaha requested a review from a team as a code owner February 7, 2024 07:15
@mergify mergify bot assigned luohaha Feb 7, 2024
@imay
Copy link
Contributor

imay commented Feb 7, 2024

It doesn't make any sense to skip this warning

Copy link

github-actions bot commented Feb 7, 2024

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Feb 7, 2024

[BE Incremental Coverage Report]

pass : 1 / 1 (100.00%)

file detail

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

@luohaha luohaha closed this Feb 7, 2024
@luohaha luohaha reopened this Feb 28, 2024
@luohaha luohaha closed this Mar 4, 2024
@luohaha luohaha reopened this Mar 4, 2024
@luohaha luohaha merged commit 92a1e60 into StarRocks:main Mar 4, 2024
81 checks passed
@luohaha
Copy link
Contributor Author

luohaha commented Mar 4, 2024

https://github.com/Mergifyio backport branch-3.2

@luohaha
Copy link
Contributor Author

luohaha commented Mar 4, 2024

https://github.com/Mergifyio backport branch-3.1

Copy link
Contributor

mergify bot commented Mar 4, 2024

backport branch-3.2

✅ Backports have been created

Copy link
Contributor

mergify bot commented Mar 4, 2024

backport branch-3.1

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Mar 4, 2024
…40951)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit 92a1e60)
mergify bot pushed a commit that referenced this pull request Mar 4, 2024
…40951)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit 92a1e60)
wanpengfei-git pushed a commit that referenced this pull request Mar 4, 2024
…ackport #40951) (#42049)

Co-authored-by: Yixin Luo <18810541851@163.com>
wanpengfei-git pushed a commit that referenced this pull request Mar 4, 2024
…ackport #40951) (#42048)

Co-authored-by: Yixin Luo <18810541851@163.com>
@sduzh
Copy link
Contributor

sduzh commented Mar 8, 2024

Potential fix: #42347

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.

5 participants