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

[fix](crash) fix be crash because of int overflow #41554

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

cambyzju
Copy link
Contributor

@cambyzju cambyzju commented Oct 8, 2024

come from: #38514

After long run, MultiCoreTaskQueue::_next_core overflow, make core_id = _next_core.fetch_add(1) % _core_size; got negative value

The crash stack:

#0  doris::pipeline::PriorityTaskQueue::push (this=0x0, task=task@entry=0x7f6a4cb4d800) at /root/be/src/pipeline/task_queue.cpp:115
#1  0x0000564e19c729fd in doris::pipeline::MultiCoreTaskQueue::push_back (this=0x7f6b59551990, task=0x7f6a4cb4d800, core_id=-31)
    at /root/be/src/pipeline/task_queue.cpp:216
#2  0x0000564e19c72934 in doris::pipeline::MultiCoreTaskQueue::push_back (this=0x0, task=0x0) at /root/be/src/pipeline/task_queue.cpp:208
#3  0x0000564e19c763f3 in doris::pipeline::TaskScheduler::schedule_task (this=<optimized out>, task=0x7f6a4cb4d800)
    at /root/be/src/pipeline/task_scheduler.cpp:224
#4  0x0000564e19c4cc24 in doris::pipeline::PipelineXFragmentContext::submit (this=0x7f6a4da5bc10)
    at /root/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp:1418
#5  0x0000564e0ff86683 in doris::FragmentMgr::exec_plan_fragment(doris::TPipelineFragmentParams const&, doris::QuerySource, std::function<void (doris::RuntimeState*, doris::Status*)> const&) (this=this@entry=0x7f6e94a67000, params=..., query_source=<optimized out>, cb=...)
    at /root/be/src/runtime/fragment_mgr.cpp:1013
#6  0x0000564e0ff84e80 in doris::FragmentMgr::exec_plan_fragment (this=0x7f6e94a67000, params=..., query_source=3680166656)
    at /root/be/src/runtime/fragment_mgr.cpp:685
#7  0x0000564e1014b4d5 in doris::PInternalServiceImpl::_exec_plan_fragment_impl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, doris::PFragmentRequestVersion, bool, std::function<void (doris::RuntimeState*, doris::Status*)> const&) (this=this@entry=0x7f6f01d21300, 
    ser_request=..., version=<optimized out>, compact=<optimized out>, cb=...) at /root/be/src/service/internal_service.cpp:582
#8  0x0000564e1014ae02 in doris::PInternalServiceImpl::_exec_plan_fragment_in_pthread (this=0x7f6f01d21300, controller=<optimized out>, request=
    0x7f6a9f1bb020, response=0x7f689e352d00, done=0x7f689e352d40) at /root/be/src/service/internal_service.cpp:328
#9  0x0000564e10171b9b in std::function<void ()>::operator()() const (this=<optimized out>)
    at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:560
#10 doris::WorkThreadPool<false>::work_thread (this=0x7f6f01d214b8, thread_id=<optimized out>) at /root/be/src/util/work_thread_pool.hpp:158
#11 0x0000564e1c7b0d60 in std::execute_native_thread_routine (__p=0x7f6f00ef6970) at ../../../../../libstdc++-v3/src/c++11/thread.cc:82
#12 0x00007f6f03d77ea5 in start_thread () from /lib64/libpthread.so.0
#13 0x00007f6f047a69fd in clone () from /lib64/libc.so.6

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@cambyzju
Copy link
Contributor Author

cambyzju commented Oct 8, 2024

run buildall

@wm1581066 wm1581066 added the usercase Important user case type label label Oct 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.29% (9632/25832)
Line Coverage: 28.68% (79891/278577)
Region Coverage: 28.10% (41291/146927)
Branch Coverage: 24.72% (21037/85084)
Coverage Report: http://coverage.selectdb-in.cc/coverage/eff454d6009cb7b2010c2740466f974ba04d1825_eff454d6009cb7b2010c2740466f974ba04d1825/report/index.html

Copy link
Contributor

github-actions bot commented Oct 8, 2024

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Oct 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

PR approved by anyone and no changes requested.

@lide-reed lide-reed merged commit 00ec3a8 into apache:master Oct 8, 2024
26 of 30 checks passed
cambyzju added a commit to cambyzju/incubator-doris that referenced this pull request Oct 8, 2024
eldenmoon pushed a commit to eldenmoon/incubator-doris that referenced this pull request Oct 10, 2024
cjj2010 pushed a commit to cjj2010/doris that referenced this pull request Oct 12, 2024
amorynan pushed a commit to amorynan/doris that referenced this pull request Oct 12, 2024
dataroaring pushed a commit that referenced this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/2.1.7-merged dev/3.0.3-merged reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants