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-10527] swift-lldb crashes setting breakpoint on app with deployment target <12.0 #4571

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

Comments

@swift-ci
Copy link

Previous ID SR-10527
Radar None
Original Reporter ivhernandez (JIRA User)
Type Bug
Environment

Xcode 10.2.1
lldb version 7.0.0
Swift version 5.0-dev (LLVM 06f1615069, Swift d5426bc)

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

md5: 0195b20bfcafd1f5f212126750e70ab6

Issue Description:

Repro Steps:

  1. Create a new single view application Xcode project.

  2. Set deployment target to 11.4 or anything below 12.0.

  3. Build application.

  4. Boot, install, launch on a simulator with simctl.

  5. Attach to process by pid with swift-lldb.

  6. Run command: `b ViewController.swift:14`

The crash is occuring in GenType.cpp in swift::irgen::TypeConverter::TypeConverter() with error:
_LLVM ERROR: Cannot read '/Users/ivanhernandez/Desktop/GitHub_Clones/swift-lldb/build/Debug/LLDB.framework/Resources/Swift/iphonesimulator/layouts-x86_64.yaml'
Assertion failed: (e == 0), function ~recursive_mutex, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/libcxx/libcxx-400.9.4/src/mutex.cpp, line 64._

This occurs when using a deployment target under 12.0. Looks like the crash is avoided in iOS >= 12.0 because the TypeConverter constructor returns early if SupportsObjCMetadataUpdateCallback(Triple) is true which happens when iOS version is >=12.2 or macOS version >= 10.14.4. When using deployment target 12.0 or greater, the triple is set to "x86_64--macosx12.2.0" for some reason and 12.2.0 >= 10.14.4 so the constructor exits early. On iOS 11.4 and lower, the triple is "x86_64-apple-ios11.4.0". The constructor does not returns early and instead tries to read LLDB.framework/Resources/Swift/iphonesimulator/layouts-x86_64.yaml which doesn't exist and swift-lldb crashes.

I am using swift-lldb built from the 'stable' branch at commit d5426bc and swift from the 'master' branch. This crash does not occur when using swift-lldb and swift from the 'swift-5.0-branch' branch.

*Stack trace: *
(lldb) bt

@belkadan
Copy link

cc @slavapestov, @dcci

@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

2 participants