swiftlang / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Swift’s stable releases of Clang as well as support the Swift project.
https://llvm.org
Other
1.12k stars 331 forks source link

[SR-2789] lldb-rpc-server crash #4584

Open swift-ci opened 8 years ago

swift-ci commented 8 years ago
Previous ID SR-2789
Radar None
Original Reporter ewconnell (JIRA User)
Type Bug

Attachment: Download

Environment Mac OS 10.12, MacBook Pro (Retina, 13-inch, Early 2015)
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 2 | |Component/s | LLDB for Swift | |Labels | Bug, 3.1Regression | |Assignee | None | |Priority | Medium | md5: f4c43b249a6c62ac5b5883d1baaeed8b

Issue Description:

While trying to print out the value of a variable the lldb rpc server keeps crashing

belkadan commented 8 years ago

Can you attach the project, and if so are there steps that reliably reproduce the issue?

swift-ci commented 8 years ago

Comment by Edward Connell (JIRA)

Hi Jordan, I'm sorry I can't attach the project.
I was trying to print the value of a class member variable whose type is an implicitly unwrapped protocol.
Over the past 6 months I have found in many cases that doing things with variables of a protocol type cause the debugger or compiler to crash. So most of the time I have had to substitute a concrete base class to work around the problems.

swift-ci commented 8 years ago

Comment by Edward Connell (JIRA)

I added another crash log while trying to print the value of a different member variable, which was of a concrete class type.

swift-ci commented 7 years ago

Comment by PT (JIRA)

I have had this issue when I try to print any variable when running UI tests on iOS 9 simulators. iOS 10 displays the variable value correctly. Attached the crash log lldb-rpc-server_2017-02-24-135005_OSTML0222474-2.crash

(lldb) po title
Message from debugger: The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.

swift-ci commented 7 years ago

Comment by aaron crespo (JIRA)

Uploaded a few more stopped on a break point in my test target. Cannot attack project. Xcode 8.3 swift 3.1. This was working under Xcode 8.2

swift-ci commented 7 years ago

Comment by Daniel Bromberg (JIRA)

My app consistently crashes during startup before any breakpoint is reached, about 2 seconds into execution. The crash occurs regardless of

It's very heisenbuggy regarding exactly when it crashes relative to the program's initialization process, so it's probably a fool's errand to find the minimum shareable non-proprietary project to reproduce this.

Everything was fine w/Swift 2.3 & Xcode 8.2 and the App has been stable for over a year otherwise. lldb-rpc-server_2017-05-04-170403_inspector-gadget.crash

belkadan commented 7 years ago

Crash logs really aren't sufficient here. They don't include what LLDB was trying to do at the time. There's a log you can enable, but that probably dumps too much information about a proprietary project.

If anyone's willing to submit their project to Apple even if they can't submit it publicly, please attach it to a bug at https://bugreport.apple.com

swift-ci commented 7 years ago

Comment by Daniel Bromberg (JIRA)

It's a huge blocker for us – development is effectively stopped – and we already submit (bitcode, at least) to Apple during App Store submission process, so that's not a problem. I've added you to our GitHub repository and will follow up at the Apple bug report site. I hope that works.

swift-ci commented 7 years ago

Comment by Daniel Bromberg (JIRA)

Solved, at least apparently for the first few re-runs, by deleting and re-installing Xcode from the App store. I originally installed it from Apple's .zip download, during which I had to override the non-verified warnings (a little ironic because it came straight from Apple, but .zips must be considered 2nd class citizens). Retroactively I'm suspicious that this caused serious integrity problems. I'm sure the chain of cause and effect must be very long. This is nothing simple like Xcode failing to run because of a missing or corrupted install file.

swift-ci commented 5 years ago

Comment by Reuben Morais (JIRA)

I can reliably reproduce this with Xcode 10.3 and Swift 5.0.1 while debugging this open source project: https://github.com/ianyh/Amethyst

I'm on commit b478a849f7d583996ce8593b6a81c0c580017051. Setting a breakpoint on FocusTransitionCoordinator::focusScreen, then triggering it with option+shift+w and stepping around a bit will cause that crash. Inspecting variables in the debugger will also cause it.

Let me know if there's anything else I can provide to help fix this.

belkadan commented 5 years ago

Is it the same crash backtrace as the logs in this bug? If not, please file a separate bug—it's very likely things have changed since this three-year-old report.

belkadan commented 5 years ago

(And thank you for finding a reproducer!)

swift-ci commented 5 years ago

Comment by Reuben Morais (JIRA)

Done: https://bugs.swift.org/browse/SR-11331