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.11k stars 328 forks source link

[SR-6657] Couldn't load 'self' because its value couldn't be evaluated #4501

Open swift-ci opened 6 years ago

swift-ci commented 6 years ago
Previous ID SR-6657
Radar rdar://problem/36256619
Original Reporter robdashnash (JIRA User)
Type Bug

Attachment: Download

Environment Xcode Version 9.2 (9C40b) macOS 10.13.2
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 1 | |Component/s | LLDB for Swift | |Labels | Bug | |Assignee | @adrian-prantl | |Priority | Medium | md5: 377c2c0d373101032aa087833faa8b7d

Issue Description:

At runtime, the value could not be evaluated.

public protocol CardableScene: class where Self: UIViewController {
  var showsNavigationBar: Bool { get }
}

public extension CardableScene {

  var showsNavigationBar: Bool {
    return navigationItem.title != nil
  }
}

(lldb) po scene.showsNavigationBar
2017-12-20 07:30:23.558169+0000 DanceClass[1194:29854] +[DanceClass.DanceClassViewController navigationItem]: unrecognized selector sent to class 0x109344cd0
error: warning: couldn't get required object pointer (substituting NULL): Couldn't load 'self' because its value couldn't be evaluated

swift-ci commented 6 years ago

Comment by Rob Nash (JIRA)

FYI

The protocol 'CardableScene' currently shows 'redundant layout constraint" warning, as explained here

https://bugs.swift.org/browse/SR-6265?focusedCommentId=31224&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-31224

However, it has been suggested in the comments that this issue is not related.

belkadan commented 6 years ago

@swift-ci create

belkadan commented 6 years ago

Do you have a complete project where this reproduces? That'll make it easier to be sure we're looking at the same thing.

swift-ci commented 6 years ago

Comment by Rob Nash (JIRA)

Ye sure @belkadan project attached. Run the workspace on an iPhone simulator of your choice and take a look at DanceClassViewController.swift

override func viewDidLoad() {
        super.viewDidLoad()
        navigationItem.title = "Class"
} [^Archive.zip] 
belkadan commented 6 years ago

It looks like that one isn't the problem one, but breaking at Card.swift:17 lets me try the "p scene.showsNavigationBar" that causes the problem. Accessing plain Objective-C methods like "p scene.view" also produces this error.

belkadan commented 6 years ago

(Thanks!)

swift-ci commented 6 years ago

Comment by Alex Reilly (JIRA)

Any updates on this? Still experiencing it on the current Xcode (9.3)

Full error that I'm experiencing:

(lldb) po newDatasource.values
objc[60841]: Method cache corrupted. This may be a message to an invalid object, or a memory error somewhere else.
objc[60841]: receiver 0x7b14000f0230, SEL 0x10fef5a70, isa 0x111f6bf98, cache 0x111f6bfa8, buckets 0x7b1400101030, mask 0x3, occupied 0x1
objc[60841]: receiver 0 bytes, buckets 80 bytes
objc[60841]: selector 'release'
objc[60841]: isa '_TtGCs13ManagedBufferGVs17_HeapBufferHeaderVs18_StringBufferIVars_Vs6UInt16_'
objc[60841]: Method cache corrupted. This may be a message to an invalid object, or a memory error somewhere else.
expression produced error: warning: couldn't get required object pointer (substituting NULL): Couldn't load 'self' because its value couldn't be evaluated

error: Execution was interrupted, reason: signal SIGABRT.
The process has been returned to the state before expression evaluation.
belkadan commented 6 years ago

That's probably a different issue, Alex. Can you file that separately with your own reproducer?

0acf245c-f0fa-406f-afb9-4746d10f0359 commented 5 years ago

This bug is an unfortunate series of events. I plan to work on this 🙂

0acf245c-f0fa-406f-afb9-4746d10f0359 commented 5 years ago

(I have ideas on how to fix this, it's just not trivial).

0acf245c-f0fa-406f-afb9-4746d10f0359 commented 5 years ago

I never got around to this, but I have ideas on how to fix. It would be a good starter bug.

swift-ci commented 4 years ago

Comment by Andrey Yakushev (JIRA)

Same problem in Xcode 11.1, during XCTests (sorry, can't show code - NDA). But looks very close (but with Foundation classes instead of UIKit)

adrian-prantl commented 4 years ago

The radar linked with this issue is marked as fixed — Is this accurate?