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-8232] Leak when storing optional URL #50764

Closed
swift-ci opened this issue Jul 11, 2018 · 5 comments
Closed

[SR-8232] Leak when storing optional URL #50764

swift-ci opened this issue Jul 11, 2018 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself memory leak bug: Memory leak regression swift 4.2

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8232
Radar rdar://problem/42086749
Original Reporter damiandudycz (JIRA User)
Type Bug
Status Resolved
Resolution Cannot Reproduce

Attachment: Download

Environment

Xcode 10, iOS 12, Swift 4.2

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.2Regression, Leak
Assignee None
Priority Medium

md5: 5d2a2fd97aae3377acab62a62ee39f43

Issue Description:

When you store optional URL in some class, then this URL causes leak. Please see simple code below. Leaks appear in libswiftCore and in CoreFoundation. This only happens on real device - not in simulator.

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        let url = URL(string: "http://google.com/asd")
        print(url)
        t = Test(url: url!)
    }

    var t: Test?

}

class Test {
    let url: URL!
    init(url: URL) {
        self.url = url
    }
}
@belkadan
Copy link
Contributor

This sounds like something we fixed already with resilience. @slavapestov, @mikeash, do either of you remember something like this?

@slavapestov
Copy link
Member

I seem to recall an issue where false leaks were reported but I don't remember any more details.

@belkadan
Copy link
Contributor

Better make sure it's tracked.

@swift-ci create

@slavapestov
Copy link
Member

I only see the false leak on iOS 11, and not iOS 12 beta 5. damiandudycz (JIRA User) are you still seeing this with latest Xcode/iOS?

@slavapestov
Copy link
Member

I suspect it was a mismatch between Swift and the remote mirrors library on the device. This explains why it worked in the simulator as well, because there we use Swift's copy of the library.

Please re-open if you believe otherwise.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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 A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself memory leak bug: Memory leak regression swift 4.2
Projects
None yet
Development

No branches or pull requests

4 participants