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

[SR-9310] LLDB detaches automatically for Swift static function breakpoints #4616

Open
swift-ci opened this issue Nov 20, 2018 · 1 comment
Labels
bug Something isn't working LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-9310
Radar https://bugreport.apple.com/web/?problemID=46202527
Original Reporter dbeard (JIRA User)
Type Bug
Environment

macOS 10.14

Xcode 10.0

Swift 4.2

New build system

Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: de091cb104d48501845e1e4d1edcdf9a

Issue Description:

May be happening for other types of methods too, but this one is the most consistent.

Fails with the following error:

Shared Swift state for FooApp could not be initialized.The REPL and expressions are unavailable.(lldb) [1]    21363 segmentation fault  PATH= lldb 

Backtrace for failing method:

(lldb) bt
* thread #​1, queue = 'com.apple.main-thread', stop reason = step over
  * frame #​0: 0x00000001097fdfdf LLDB` lldb_private::Target::GetScratchTypeSystemForLanguage(this=0x0000000118038a00, error=0x00007ffeefbea778, language=eLanguageTypeSwift, create_on_demand=true, compiler_options=0x0000000000000000)  + 3935 at Target.cpp:2202
    frame #​1: 0x0000000109599652 LLDB` lldb_private::SwiftLanguageRuntime::GetScratchSwiftASTContext(this=0x000000019eb328f0)  + 82 at SwiftLanguageRuntime.cpp:1186
    frame #​2: 0x000000010959b619 LLDB` lldb_private::SwiftLanguageRuntime::GetMetadataPromise(this=0x000000019eb328f0, addr=105553178953504, swift_ast_ctx=0x0000000000000000)  + 89 at SwiftLanguageRuntime.cpp:1297
    frame #​3: 0x0000000108dba888 LLDB` lldb_private::formatters::swift::SwiftMetatype_SummaryProvider(valobj=0x000000018bee0400, stream=0x00007ffeefbeb738, options=0x00007ffeefbeba20)  + 648 at SwiftMetatype.cpp:43
    frame #&#8203;4: 0x0000000109f2b1a0 LLDB` bool std::__1::__invoke_void_return_wrapper<bool>::__call<bool (*&)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&), lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&>(bool (*&&&)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&), lldb_private::ValueObject&&&, lldb_private::Stream&&&, lldb_private::TypeSummaryOptions const&&&) [inlined] decltype(__f=(0x000000019eb46aa8), __args=0x000000018bee0400, __args=0x00007ffeefbeb738, __args=0x00007ffeefbeba20)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)>(fp)(std::__1::forward<lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&>(fp0))) std::__1::__invoke<bool (*&)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&), lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&>(bool (*&&&)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&), lldb_private::ValueObject&&&, lldb_private::Stream&&&, lldb_private::TypeSummaryOptions const&&&)  + 144 at type_traits:4428
    frame #&#8203;5: 0x0000000109f2b16b LLDB` bool std::__1::__invoke_void_return_wrapper<bool>::__call<bool (__args=(0x000000019eb46aa8), __args=0x000000018bee0400, __args=0x00007ffeefbeb738, __args=0x00007ffeefbeba20)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&), lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&>(bool (*&&&)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&), lldb_private::ValueObject&&&, lldb_private::Stream&&&, lldb_private::TypeSummaryOptions const&&&)  + 91 at __functional_base:318
    frame #&#8203;6: 0x0000000109f2b0d9 LLDB` std::__1::__function::__func<bool (*)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&), std::__1::allocator<bool (*)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)>, bool (lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)>::operator(this=0x000000019eb46aa0, __arg=0x000000018bee0400, __arg=0x00007ffeefbeb738, __arg=0x00007ffeefbeba20)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)  + 89 at functional:1562
    frame #&#8203;7: 0x0000000109fb4820 LLDB` std::__1::function<bool (lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)>::operator(this=0x000000019eb46aa0, __arg=0x000000018bee0400, __arg=0x00007ffeefbeb738, __arg=0x00007ffeefbeba20)(lldb_private::ValueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&) const  + 176 at functional:1913
    frame #&#8203;8: 0x0000000109fb4361 LLDB` lldb_private::CXXFunctionSummaryFormat::FormatObject(this=0x000000019eb46a80, valobj=0x000000018bee0400, dest="", options=0x00007ffeefbeba20)  + 561 at TypeSummary.cpp:142
    frame #&#8203;9: 0x0000000108dd0659 LLDB` lldb_private::ValueObject::GetSummaryAsCString(this=0x000000018bee0400, summary_ptr=0x000000019eb46a80, destination="", options=0x00007ffeefbebbe0)  + 777 at ValueObject.cpp:780
    frame #&#8203;10: 0x0000000108dd091c LLDB` lldb_private::ValueObject::GetSummaryAsCString(this=0x000000018bee0400, lang=eLanguageTypeUnknown)  + 460 at ValueObject.cpp:790
    frame #&#8203;11: 0x0000000108dd75aa LLDB` lldb_private::ValueObject::DumpPrintableRepresentation(this=0x000000018bee0400, s=0x00007ffeefbec8c8, val_obj_display=eValueObjectRepresentationStyleSummary, custom_format=eFormatDefault, special=1, do_dump_error=false)  + 3210 at ValueObject.cpp:1491
    frame #&#8203;12: 0x000000010900bf28 LLDB` lldb_private::SwiftLanguage::GetFunctionDisplayName(this=0x000000019ea4cf30, sc=0x000000019ea4b4c0, exe_ctx=0x00007ffeefbf61f0, representation=eNameWithArgs, s=0x00007ffeefbedbe8)  + 5672 at SwiftLanguage.cpp:1778
    frame #&#8203;13: 0x0000000108d231f7 LLDB` lldb_private::FormatEntity::Format(entry=0x0000000116383368, s=0x00007ffeefbf04b8, sc=0x000000019ea4b4c0, exe_ctx=0x00007ffeefbf61f0, addr=0x0000000000000000, valobj=0x0000000000000000, function_changed=false, initial_function=false)  + 17767 at FormatEntity.cpp:1606
    frame #&#8203;14: 0x0000000108d1f463 LLDB` lldb_private::FormatEntity::Format(entry=0x00000001163830f8, s=0x00007ffeefbf2958, sc=0x000000019ea4b4c0, exe_ctx=0x00007ffeefbf61f0, addr=0x0000000000000000, valobj=0x0000000000000000, function_changed=false, initial_function=false)  + 2003 at FormatEntity.cpp:1140
    frame #&#8203;15: 0x0000000108d1f463 LLDB` lldb_private::FormatEntity::Format(entry=0x0000000117065808, s=0x00007ffeefbf61a0, sc=0x000000019ea4b4c0, exe_ctx=0x00007ffeefbf61f0, addr=0x0000000000000000, valobj=0x0000000000000000, function_changed=false, initial_function=false)  + 2003 at FormatEntity.cpp:1140
    frame #&#8203;16: 0x0000000108d1ef50 LLDB` lldb_private::FormatEntity::Format(entry=0x000000011613f100, s=0x00007ffeefbf61a0, sc=0x000000019ea4b4c0, exe_ctx=0x00007ffeefbf61f0, addr=0x0000000000000000, valobj=0x0000000000000000, function_changed=false, initial_function=false)  + 704 at FormatEntity.cpp:1125
    frame #&#8203;17: 0x00000001097bcfcc LLDB` lldb_private::StackFrame::DumpUsingSettingsFormat(this=0x000000019ea4b450, strm=0x00007ffeefbf87e8, show_unique=false, frame_marker=0x0000000000000000)  + 780 at StackFrame.cpp:1768
    frame #&#8203;18: 0x00000001097be2dc LLDB` lldb_private::StackFrame::GetStatus(this=0x000000019ea4b450, strm=0x00007ffeefbf87e8, show_frame_info=true, show_source=true, show_unique=false, frame_marker=0x0000000000000000)  + 140 at StackFrame.cpp:1852
    frame #&#8203;19: 0x00000001097cdf7e LLDB` lldb_private::StackFrameList::GetStatus(this=0x000000019e90b2a0, strm=0x00007ffeefbf87e8, first_frame=0, num_frames=1, show_frame_info=true, num_frames_with_source=1, show_unique=false, selected_frame_marker=0x0000000000000000)  + 3118 at StackFrameList.cpp:844
    frame #&#8203;20: 0x000000010986ddc9 LLDB` lldb_private::Thread::GetStatus(this=0x000000011624e010, strm=0x00007ffeefbf87e8, start_frame=0, num_frames=1, num_frames_with_source=1, stop_format=true, only_stacks=false)  + 1657 at Thread.cpp:1989
    frame #&#8203;21: 0x0000000109739fcb LLDB` lldb_private::Process::GetThreadStatus(this=0x0000000116868200, strm=0x00007ffeefbf87e8, only_threads_with_stop_reason=true, start_frame=0, num_frames=1, num_frames_with_source=1, stop_format=true)  + 1403 at Process.cpp:5924
    frame #&#8203;22: 0x0000000109738d24 LLDB` lldb_private::Process::HandleProcessStateChangedEvent(event_sp=element_type @ 0x000000019d17aa50 strong=2 weak=1, stream=0x00007ffeefbf87e8, pop_process_io_handler=0x00007ffeefbf8203, pop_command_interpreter=0x00007ffeefbf8202)  + 11780 at Process.cpp:1305
    frame #&#8203;23: 0x000000010973520d LLDB` lldb_private::Process::WaitForProcessToStop(this=0x0000000116868200, timeout=0x00007ffeefbf8678, event_sp_ptr=0x0000000000000000, wait_always=true, hijack_listener_sp=std::__1::shared_ptr<lldb_private::Listener>::element_type @ 0x000000019e90afb0 strong=3 weak=2, stream=0x00007ffeefbf87e8, use_run_lock=true)  + 2109 at Process.cpp:1023
    frame #&#8203;24: 0x000000010973dc26 LLDB` lldb_private::Process::ResumeSynchronous(this=0x0000000116868200, stream=0x00007ffeefbf87e8)  + 822 at Process.cpp:1761
    frame #&#8203;25: 0x0000000108a85494 LLDB` CommandObjectProcessContinue::DoExecute(this=0x000000011611e140, command=0x00007ffeefbf8bf8, result=0x00007ffeefbfac20)  + 1908 at CommandObjectProcess.cpp:692
    frame #&#8203;26: 0x000000010914c2fb LLDB` lldb_private::CommandObjectParsed::Execute(this=0x000000011611e140, args_string="", result=0x00007ffeefbfac20)  + 1483 at CommandObject.cpp:991
    frame #&#8203;27: 0x0000000109105340 LLDB` lldb_private::CommandInterpreter::HandleCommand(this=0x0000000116307280, command_line="c", lazy_add_to_history=eLazyBoolCalculate, result=0x00007ffeefbfac20, override_context=0x0000000000000000, repeat_on_empty_command=true, no_context_switching=false)  + 14784 at CommandInterpreter.cpp:1689
    frame #&#8203;28: 0x000000010911296d LLDB` lldb_private::CommandInterpreter::IOHandlerInputComplete(this=0x0000000116307280, io_handler=0x000000011613e530, line="c")  + 1165 at CommandInterpreter.cpp:2777
    frame #&#8203;29: 0x000000010919f4e1 LLDB` lldb_private::IOHandlerEditline::Run(this=0x000000011613e530)  + 1745 at IOHandler.cpp:575
    frame #&#8203;30: 0x0000000108bd5037 LLDB` lldb_private::Debugger::RunIOHandler(this=0x0000000116306a20, reader_sp=std::__1::shared_ptr<lldb_private::IOHandler>::element_type @ 0x000000011613e530 strong=3 weak=1)  + 359 at Debugger.cpp:1089
    frame #&#8203;31: 0x000000010910d88d LLDB` lldb_private::CommandInterpreter::HandleCommandsFromFile(this=0x0000000116307280, cmd_file=0x00007ffeefbfb8b8, context=0x0000000000000000, options=0x00007ffeefbfb888, result=0x00007ffeefbfdbb0)  + 3261 at CommandInterpreter.cpp:2467
    frame #&#8203;32: 0x00000001089d2414 LLDB` CommandObjectCommandsSource::DoExecute(this=0x000000011630ce00, command=0x00007ffeefbfbb88, result=0x00007ffeefbfdbb0)  + 996 at CommandObjectCommands.cpp:331
    frame #&#8203;33: 0x000000010914c2fb LLDB` lldb_private::CommandObjectParsed::Execute(this=0x000000011630ce00, args_string="-s 0 'commands.txt'", result=0x00007ffeefbfdbb0)  + 1483 at CommandObject.cpp:991
    frame #&#8203;34: 0x0000000109105340 LLDB` lldb_private::CommandInterpreter::HandleCommand(this=0x0000000116307280, command_line="command source -s 0 'commands.txt'", lazy_add_to_history=eLazyBoolCalculate, result=0x00007ffeefbfdbb0, override_context=0x0000000000000000, repeat_on_empty_command=true, no_context_switching=false)  + 14784 at CommandInterpreter.cpp:1689
    frame #&#8203;35: 0x000000010911296d LLDB` lldb_private::CommandInterpreter::IOHandlerInputComplete(this=0x0000000116307280, io_handler=0x0000000116144380, line="command source -s 0 'commands.txt'")  + 1165 at CommandInterpreter.cpp:2777
    frame #&#8203;36: 0x000000010919f4e1 LLDB` lldb_private::IOHandlerEditline::Run(this=0x0000000116144380)  + 1745 at IOHandler.cpp:575
    frame #&#8203;37: 0x0000000108bd4842 LLDB` lldb_private::Debugger::ExecuteIOHandlers(this=0x0000000116306a20)  + 114 at Debugger.cpp:1044
    frame #&#8203;38: 0x00000001091140df LLDB` lldb_private::CommandInterpreter::RunCommandInterpreter(this=0x0000000116307280, auto_handle_events=true, spawn_thread=false, options=0x0000000116143f70)  + 223 at CommandInterpreter.cpp:2977
    frame #&#8203;39: 0x00000001001b45e9 LLDB` lldb::SBDebugger::RunCommandInterpreter(this=0x00007ffeefbfeac0, auto_handle_events=true, spawn_thread=false, options=0x00007ffeefbfe318, num_errors=0x00007ffeefbfe320, quit_requested=0x00007ffeefbfe337, stopped_for_crash=0x00007ffeefbfe336)  + 185 at SBDebugger.cpp:905
    frame #&#8203;40: 0x000000010000ac24 lldb` Driver::MainLoop(this=0x00007ffeefbfeaa0)  + 6676 at Driver.cpp:1110
    frame #&#8203;41: 0x000000010000b704 lldb` main(argc=3, argv=0x00007ffeefbfec08)  + 468 at Driver.cpp:1258
    frame #&#8203;42: 0x00007fff7740c085 libdyld.dylib` start  + 1
    frame #&#8203;43: 0x00007fff7740c085 libdyld.dylib` start  + 1 
@swift-ci
Copy link
Author

Comment by Daniel Beard (JIRA)

Resolved in Xcode 10.2

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLDB for Swift
Projects
None yet
Development

No branches or pull requests

1 participant