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-10458] EXC_BAD_ACCESS when calling URL(string:) API #3446

Open
swift-ci opened this issue Apr 11, 2019 · 4 comments
Open

[SR-10458] EXC_BAD_ACCESS when calling URL(string:) API #3446

swift-ci opened this issue Apr 11, 2019 · 4 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-10458
Radar None
Original Reporter leonid.kokhnovych (JIRA User)
Type Bug

Attachment: Download

Environment

Version 10.2 (10E125)

Swift 5.0

Mac OS 10.14.4

Additional Detail from JIRA
Votes 0
Component/s Compiler, Foundation, Standard Library
Labels Bug, RunTimeCrash
Assignee None
Priority Medium

md5: da3eaf8c5f11e2f7f8f57f9ede691808

Issue Description:

Hi everyone! I have an issue that I'm not able to constantly reproduce, but want to share in case someone has a clue what might be going on.

I'm getting the following crash error

EXC_BAD_ACCESS (code=1, address=0x0)

when running the code similar to something below (can't share the original code due to software license):

internal enum Server {
    case ServerFromList(path: String)


    var url: URL? {
        switch self {
        case .ServerFromList(let path):
            return URL(string: path)
        }
    }
}


let server = Server.ServerFromList(path: "https://www.forticloud.com")
print("\(server.url)")
print("test")

The stack trace is:

po Thread.callStackSymbols46 elements
  - 0 : "0   ???                                 0x00000001468a3a08 0x0 + 5478431240"
  - 1 : "1   ???                                 0x00000001468a3aab 0x0 + 5478431403"
  - 2 : "2   FortiExplorer                       0x00000001064c42f0 main + 0"
  - 3 : "3   libswiftCore.dylib                  0x00000001145926f9 $sSS23_bridgeToObjectiveCImplyXlyF + 9"
  - 4 : "4   libswiftFoundation.dylib            0x0000000114cbd45a $s10Foundation3URLV6stringACSgSSh_tcfC + 90"
  - 5 : "5   FortiExplorerCore                   0x0000000112bbc305 $s17FortiExplorerCore0A12CloudRequestC6ServerO3url10Foundation3URLVSgvg + 901"
...

The Xcode stack trace looks like:

![](Screen Shot 2019-04-11 at 12.46.21 PM.png)

A few more details about the input path:

(lldb) po type(of: path)
Swift.String


(lldb) po dump(path)
- "https://www.forticloud.com"
"https://www.forticloud.com"
@belkadan
Copy link

@milseman, does this look familiar at all?

Leonid, is the project one you can share with just Apple at https://bugreport.apple.com? I don't know how much progress we'll be able to make with just this.

@milseman
Copy link
Mannequin

milseman mannequin commented Apr 12, 2019

@Catfish-Man, any idea what could be going wrong?

@Catfish-Man
Copy link
Member

One relatively likely one given this is bridging is that the incoming object was overreleased and replaced by something else.

Though the lldb backtrace looks like stack corruption, so maybe not?

@swift-ci
Copy link
Contributor Author

Comment by Leonid Kokhnovych (JIRA)

@belkadan Thanks for your response. I can't share the full source code, sorry... I will try to spend more time to reproduce the issue and will provide more info if I have something to share.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants