llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.41k stars 12.15k forks source link

[LLDB] Segmentation fault when running ASAN compiled program #117976

Open OmarEmaraDev opened 4 days ago

OmarEmaraDev commented 4 days ago

I get the following segmentation fault when running Blender compiled with ASAN. Diagnostics file is empty.

 #0 0x000070113bbc4d90 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/src/debug/llvm/llvm-18.1.8.src/lib/Support/Unix/Signals.inc:723:22
 #1 0x000070113bbc1d4d llvm::sys::RunSignalHandlers() /usr/src/debug/llvm/llvm-18.1.8.src/lib/Support/Signals.cpp:105:20
 #2 0x000070113bbc1d4d SignalHandler /usr/src/debug/llvm/llvm-18.1.8.src/lib/Support/Unix/Signals.inc:403:31
 #3 0x000070113ae4c1d0 (/usr/lib/libc.so.6+0x3d1d0)
 #4 0x00007011440d23e3 RetrieveUnsigned(std::shared_ptr<lldb_private::ValueObject>, std::shared_ptr<lldb_private::Process>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) (.isra.0) /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:91:27
 #5 0x0000701143bc770e std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1069:21
 #6 0x0000701143bc770e std::__shared_ptr<lldb_private::ValueObject, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1525:7
 #7 0x0000701143bc770e std::shared_ptr<lldb_private::ValueObject>::~shared_ptr() /usr/include/c++/14.1.1/bits/shared_ptr.h:175:11
 #8 0x0000701143bc770e RetrieveString /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:97:32
 #9 0x0000701143bd8036 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1068:6
#10 0x0000701143bd8036 std::__shared_ptr<lldb_private::ValueObject, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1525:7
#11 0x0000701143bd8036 std::shared_ptr<lldb_private::ValueObject>::~shared_ptr() /usr/include/c++/14.1.1/bits/shared_ptr.h:175:11
#12 0x0000701143bd8036 lldb_private::InstrumentationRuntimeUBSan::RetrieveReportData(lldb_private::ExecutionContextRef) /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:160:41
#13 0x0000701143bd8036 lldb_private::InstrumentationRuntimeUBSan::NotifyBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long, unsigned long) /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:220:56
#14 0x0000701143bd8036 lldb_private::InstrumentationRuntimeUBSan::NotifyBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long, unsigned long) /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:200:0
#15 0x0000701143aadea6 lldb_private::BreakpointOptions::InvokeCallback(lldb_private::StoppointCallbackContext*, unsigned long, unsigned long) /usr/src/debug/lldb/lldb-18.1.8.src/source/Breakpoint/BreakpointOptions.cpp:441:26
#16 0x0000701143aadea6 lldb_private::Breakpoint::InvokeCallback(lldb_private::StoppointCallbackContext*, int) /usr/src/debug/lldb/lldb-18.1.8.src/source/Breakpoint/Breakpoint.cpp:433:34
#17 0x0000701143aadea6 lldb_private::BreakpointLocation::InvokeCallback(lldb_private::StoppointCallbackContext*) /usr/src/debug/lldb/lldb-18.1.8.src/source/Breakpoint/BreakpointLocation.cpp:194:34
#18 0x0000701143aadea6 lldb_private::StopInfoBreakpoint::PerformAction(lldb_private::Event*) /usr/src/debug/lldb/lldb-18.1.8.src/source/Target/StopInfo.cpp:535:61
#19 0x0000701143a7def5 lldb_private::Process::ProcessEventData::ShouldStop(lldb_private::Event*, bool&) /usr/src/debug/lldb/lldb-18.1.8.src/source/Target/Process.cpp:4060:46
#20 0x0000701143a831c1 lldb_private::Process::ProcessEventData::DoOnRemoval(lldb_private::Event*) /usr/src/debug/lldb/lldb-18.1.8.src/source/Target/Process.cpp:4118:3
#21 0x0000701143b0cd41 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&) /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1243:17
#22 0x0000701143b0cd41 std::__shared_ptr<lldb_private::Event, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<lldb_private::Event, void>(std::__weak_ptr<lldb_private::Event, (__gnu_cxx::_Lock_policy)2> const&) /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1549:4
#23 0x0000701143b0cd41 std::shared_ptr<lldb_private::Event>::shared_ptr<lldb_private::Event, void>(std::weak_ptr<lldb_private::Event> const&) /usr/include/c++/14.1.1/bits/shared_ptr.h:380:25
#24 0x0000701143b0cd41 std::enable_shared_from_this<lldb_private::Event>::shared_from_this() /usr/include/c++/14.1.1/bits/shared_ptr.h:934:50
#25 0x0000701143b0cd41 lldb_private::Event::DoOnRemoval() /usr/src/debug/lldb/lldb-18.1.8.src/source/Utility/Event.cpp:90:36
#26 0x000070114408883c lldb_private::Listener::FindNextEventInternal(std::unique_lock<std::mutex>&, lldb_private::Broadcaster*, unsigned int, std::shared_ptr<lldb_private::Event>&, bool) (.constprop.0) /usr/src/debug/lldb/lldb-18.1.8.src/source/Utility/Listener.cpp:234:28
#27 0x0000701143b0a8e7 lldb_private::Listener::GetEventInternal(lldb_private::Timeout<std::ratio<1l, 1000000l>> const&, lldb_private::Broadcaster*, unsigned int, std::shared_ptr<lldb_private::Event>&) /usr/src/debug/lldb/lldb-18.1.8.src/source/Utility/Listener.cpp:280:30
#28 0x0000701143b0a8e7 lldb_private::Listener::GetEvent(std::shared_ptr<lldb_private::Event>&, lldb_private::Timeout<std::ratio<1l, 1000000l>> const&) /usr/src/debug/lldb/lldb-18.1.8.src/source/Utility/Listener.cpp:320:26
#29 0x000070114392ea30 lldb_private::Debugger::DefaultEventHandler() /usr/src/debug/lldb/lldb-18.1.8.src/source/Core/Debugger.cpp:1887:30
#30 0x000070114392ea30 operator() /usr/src/debug/lldb/lldb-18.1.8.src/source/Core/Debugger.cpp:1966:61
#31 0x000070114392ea30 __invoke_impl<void*, lldb_private::Debugger::StartEventHandlerThread()::<lambda()>&> /usr/include/c++/14.1.1/bits/invoke.h:61:36
#32 0x000070114392ea30 __invoke_r<void*, lldb_private::Debugger::StartEventHandlerThread()::<lambda()>&> /usr/include/c++/14.1.1/bits/invoke.h:114:35
#33 0x000070114392ea30 _M_invoke /usr/include/c++/14.1.1/bits/std_function.h:290:30
#34 0x00007011439ca51b std::function<void* ()>::operator()() const /usr/include/c++/14.1.1/bits/std_function.h:591:9
#35 0x00007011439ca51b lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) /usr/src/debug/lldb/lldb-18.1.8.src/source/Host/common/HostNativeThreadBase.cpp:62:23
#36 0x000070113aea339d start_thread /usr/src/debug/glibc/glibc/nptl/pthread_create.c:447:8
#37 0x000070113af2849c __GI___clone3 /usr/src/debug/glibc/glibc/misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80:0
LLDB diagnostics will be written to /tmp/diagnostics-250484
Please include the directory content when filing a bug report
Segmentation fault (core dumped)
OmarEmaraDev commented 4 days ago

Possibly related to #87156.

llvmbot commented 4 days ago

@llvm/issue-subscribers-lldb

Author: Omar Emara (OmarEmaraDev)

I get the following segmentation fault when running Blender compiled with ASAN. Diagnostics file is empty. ``` #0 0x000070113bbc4d90 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/src/debug/llvm/llvm-18.1.8.src/lib/Support/Unix/Signals.inc:723:22 #1 0x000070113bbc1d4d llvm::sys::RunSignalHandlers() /usr/src/debug/llvm/llvm-18.1.8.src/lib/Support/Signals.cpp:105:20 #2 0x000070113bbc1d4d SignalHandler /usr/src/debug/llvm/llvm-18.1.8.src/lib/Support/Unix/Signals.inc:403:31 #3 0x000070113ae4c1d0 (/usr/lib/libc.so.6+0x3d1d0) #4 0x00007011440d23e3 RetrieveUnsigned(std::shared_ptr<lldb_private::ValueObject>, std::shared_ptr<lldb_private::Process>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) (.isra.0) /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:91:27 #5 0x0000701143bc770e std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1069:21 #6 0x0000701143bc770e std::__shared_ptr<lldb_private::ValueObject, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1525:7 #7 0x0000701143bc770e std::shared_ptr<lldb_private::ValueObject>::~shared_ptr() /usr/include/c++/14.1.1/bits/shared_ptr.h:175:11 #8 0x0000701143bc770e RetrieveString /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:97:32 #9 0x0000701143bd8036 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1068:6 #10 0x0000701143bd8036 std::__shared_ptr<lldb_private::ValueObject, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1525:7 #11 0x0000701143bd8036 std::shared_ptr<lldb_private::ValueObject>::~shared_ptr() /usr/include/c++/14.1.1/bits/shared_ptr.h:175:11 #12 0x0000701143bd8036 lldb_private::InstrumentationRuntimeUBSan::RetrieveReportData(lldb_private::ExecutionContextRef) /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:160:41 #13 0x0000701143bd8036 lldb_private::InstrumentationRuntimeUBSan::NotifyBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long, unsigned long) /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:220:56 #14 0x0000701143bd8036 lldb_private::InstrumentationRuntimeUBSan::NotifyBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long, unsigned long) /usr/src/debug/lldb/lldb-18.1.8.src/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp:200:0 #15 0x0000701143aadea6 lldb_private::BreakpointOptions::InvokeCallback(lldb_private::StoppointCallbackContext*, unsigned long, unsigned long) /usr/src/debug/lldb/lldb-18.1.8.src/source/Breakpoint/BreakpointOptions.cpp:441:26 #16 0x0000701143aadea6 lldb_private::Breakpoint::InvokeCallback(lldb_private::StoppointCallbackContext*, int) /usr/src/debug/lldb/lldb-18.1.8.src/source/Breakpoint/Breakpoint.cpp:433:34 #17 0x0000701143aadea6 lldb_private::BreakpointLocation::InvokeCallback(lldb_private::StoppointCallbackContext*) /usr/src/debug/lldb/lldb-18.1.8.src/source/Breakpoint/BreakpointLocation.cpp:194:34 #18 0x0000701143aadea6 lldb_private::StopInfoBreakpoint::PerformAction(lldb_private::Event*) /usr/src/debug/lldb/lldb-18.1.8.src/source/Target/StopInfo.cpp:535:61 #19 0x0000701143a7def5 lldb_private::Process::ProcessEventData::ShouldStop(lldb_private::Event*, bool&) /usr/src/debug/lldb/lldb-18.1.8.src/source/Target/Process.cpp:4060:46 #20 0x0000701143a831c1 lldb_private::Process::ProcessEventData::DoOnRemoval(lldb_private::Event*) /usr/src/debug/lldb/lldb-18.1.8.src/source/Target/Process.cpp:4118:3 #21 0x0000701143b0cd41 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&) /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1243:17 #22 0x0000701143b0cd41 std::__shared_ptr<lldb_private::Event, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<lldb_private::Event, void>(std::__weak_ptr<lldb_private::Event, (__gnu_cxx::_Lock_policy)2> const&) /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1549:4 #23 0x0000701143b0cd41 std::shared_ptr<lldb_private::Event>::shared_ptr<lldb_private::Event, void>(std::weak_ptr<lldb_private::Event> const&) /usr/include/c++/14.1.1/bits/shared_ptr.h:380:25 #24 0x0000701143b0cd41 std::enable_shared_from_this<lldb_private::Event>::shared_from_this() /usr/include/c++/14.1.1/bits/shared_ptr.h:934:50 #25 0x0000701143b0cd41 lldb_private::Event::DoOnRemoval() /usr/src/debug/lldb/lldb-18.1.8.src/source/Utility/Event.cpp:90:36 #26 0x000070114408883c lldb_private::Listener::FindNextEventInternal(std::unique_lock<std::mutex>&, lldb_private::Broadcaster*, unsigned int, std::shared_ptr<lldb_private::Event>&, bool) (.constprop.0) /usr/src/debug/lldb/lldb-18.1.8.src/source/Utility/Listener.cpp:234:28 #27 0x0000701143b0a8e7 lldb_private::Listener::GetEventInternal(lldb_private::Timeout<std::ratio<1l, 1000000l>> const&, lldb_private::Broadcaster*, unsigned int, std::shared_ptr<lldb_private::Event>&) /usr/src/debug/lldb/lldb-18.1.8.src/source/Utility/Listener.cpp:280:30 #28 0x0000701143b0a8e7 lldb_private::Listener::GetEvent(std::shared_ptr<lldb_private::Event>&, lldb_private::Timeout<std::ratio<1l, 1000000l>> const&) /usr/src/debug/lldb/lldb-18.1.8.src/source/Utility/Listener.cpp:320:26 #29 0x000070114392ea30 lldb_private::Debugger::DefaultEventHandler() /usr/src/debug/lldb/lldb-18.1.8.src/source/Core/Debugger.cpp:1887:30 #30 0x000070114392ea30 operator() /usr/src/debug/lldb/lldb-18.1.8.src/source/Core/Debugger.cpp:1966:61 #31 0x000070114392ea30 __invoke_impl<void*, lldb_private::Debugger::StartEventHandlerThread()::<lambda()>&> /usr/include/c++/14.1.1/bits/invoke.h:61:36 #32 0x000070114392ea30 __invoke_r<void*, lldb_private::Debugger::StartEventHandlerThread()::<lambda()>&> /usr/include/c++/14.1.1/bits/invoke.h:114:35 #33 0x000070114392ea30 _M_invoke /usr/include/c++/14.1.1/bits/std_function.h:290:30 #34 0x00007011439ca51b std::function<void* ()>::operator()() const /usr/include/c++/14.1.1/bits/std_function.h:591:9 #35 0x00007011439ca51b lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) /usr/src/debug/lldb/lldb-18.1.8.src/source/Host/common/HostNativeThreadBase.cpp:62:23 #36 0x000070113aea339d start_thread /usr/src/debug/glibc/glibc/nptl/pthread_create.c:447:8 #37 0x000070113af2849c __GI___clone3 /usr/src/debug/glibc/glibc/misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80:0 LLDB diagnostics will be written to /tmp/diagnostics-250484 Please include the directory content when filing a bug report Segmentation fault (core dumped) ```