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-9914] LLDB REPL autocomplete cast assertion failure #4342

Closed
marcrasi mannequin opened this issue Feb 13, 2019 · 9 comments
Closed

[SR-9914] LLDB REPL autocomplete cast assertion failure #4342

marcrasi mannequin opened this issue Feb 13, 2019 · 9 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@marcrasi
Copy link
Mannequin

marcrasi mannequin commented Feb 13, 2019

Previous ID SR-9914
Radar None
Original Reporter @marcrasi
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: f317b009ecfa0fd922e0d73cb880a979

Issue Description:

I'm using the Feb 3, 2019 Ubuntu 18.04 Trunk Development Snapshot (https://swift.org/builds/development/ubuntu1804/swift-DEVELOPMENT-SNAPSHOT-2019-02-03-a/swift-DEVELOPMENT-SNAPSHOT-2019-02-03-a-ubuntu18.04.tar.gz).

If I start up the LLDB REPL and type `pri<TAB>`, I get:

lldb: /home/buildnode/jenkins/workspace/oss-swift-package-linux-ubuntu-18_04/llvm/include/llvm/Support/Casting.h:255: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = swift::SourceFile, Y = swift::FileUnit]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
#&#8203;0 0x0000000000415464 PrintStackTraceSignalHandler(void*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/lldb+0x415464)
#&#8203;1 0x00000000004135dc llvm::sys::RunSignalHandlers() (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/lldb+0x4135dc)
#&#8203;2 0x0000000000415672 SignalHandler(int) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/lldb+0x415672)
#&#8203;3 0x00007f42e93710c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#&#8203;4 0x00007f42e0f2bfcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
#&#8203;5 0x00007f42e0f2d3fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
#&#8203;6 0x00007f42e0f24e37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
#&#8203;7 0x00007f42e0f24ee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
#&#8203;8 0x00007f42e2eba4a6 lldb_private::SwiftREPL::CompleteCode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, lldb_private::StringList&) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0xb314a6)
#&#8203;9 0x00007f42e2c3d594 lldb_private::REPL::IOHandlerComplete(lldb_private::IOHandler&, char const*, char const*, char const*, int, int, lldb_private::StringList&) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x8b4594)
#&#8203;10 0x00007f42e2ba6fd1 lldb_private::IOHandlerEditline::AutoCompleteCallback(char const*, char const*, char const*, int, int, lldb_private::StringList&, void*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x81dfd1)
#&#8203;11 0x00007f42e2c4b75b lldb_private::Editline::TabCommand(int) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x8c275b)
#&#8203;12 0x00007f42e2c4d869 lldb_private::Editline::ConfigureEditor(bool)::$_13::__invoke(editline*, int) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x8c4869)
#&#8203;13 0x00007f42e0aca7e7 el_wgets (/usr/lib/x86_64-linux-gnu/libedit.so.2+0x107e7)
#&#8203;14 0x00007f42e0ac5da3 el_gets (/usr/lib/x86_64-linux-gnu/libedit.so.2+0xbda3)
#&#8203;15 0x00007f42e2c4d28d lldb_private::Editline::GetLines(int, lldb_private::StringList&, bool&) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x8c428d)
#&#8203;16 0x00007f42e2ba77f4 lldb_private::IOHandlerEditline::Run() (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x81e7f4)
#&#8203;17 0x00007f42e2b8ab06 lldb_private::Debugger::ExecuteIOHandlers() (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x801b06)
#&#8203;18 0x00007f42e2b8ec6f lldb_private::Debugger::IOHandlerThread(void*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x805c6f)
#&#8203;19 0x00007f42e2c553ec lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/head-nightly-2019-02-03/usr/bin/../lib/liblldb.so.7+0x8cc3ec)
#&#8203;20 0x00007f42e9367494 start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7494)
#&#8203;21 0x00007f42e0fe1a8f clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8a8f)
Aborted

As far as I can tell, the text that you are trying to complete doesn't matter. It always gives you the same assertion failure.

@belkadan
Copy link

! jingham@apple.com (JIRA User), @dcci, have we seen this yet?

@dcci
Copy link
Mannequin

dcci mannequin commented Feb 13, 2019

@belkadan I haven't seen this one.@marcrasi do you happen to know whether this is Linux specific or also reproduces on MacOS?

@marcrasi
Copy link
Mannequin Author

marcrasi mannequin commented Feb 13, 2019

I just tested it out with the MacOS 2/3/19 development toolchain, and I can also reproduce it there.

@swift-ci
Copy link

Comment by Jim Ingham (JIRA)

Same operation does not crash on the swift-5.0-branch.

  1> pri
Available completions:
print(items: Any...) -> Void
print(items: Any..., separator: String, terminator: String) -> Void
print(items: Any..., separator: String, terminator: String, to: &TextOutputStream) -> Void
print(items: Any..., to: &TextOutputStream) -> Void
private
  1>

@dcci
Copy link
Mannequin

dcci mannequin commented Feb 15, 2019

This is the new DWARFImporter. If I disable it, the crash goes away.
cc: @adrian-prantl

@adrian-prantl
Copy link
Member

The quick workaround is to disable the DWARFImporter in the REPL. The better fix is to not have the DWARFImporter claim that it can load a module for which no DWARF exists. I'll take a look at that.

@dcci
Copy link
Mannequin

dcci mannequin commented Feb 15, 2019

I have a patch coming for you.

@dcci
Copy link
Mannequin

dcci mannequin commented Feb 15, 2019

Proposed: apple/swift-lldb#1299

@dcci
Copy link
Mannequin

dcci mannequin commented Feb 15, 2019

Merged. Let me know if there are other issues.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
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

3 participants