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

error: String(cString: info.dli_fname) #6

Open
tangjianfengVS opened this issue Oct 15, 2023 · 1 comment
Open

error: String(cString: info.dli_fname) #6

tangjianfengVS opened this issue Oct 15, 2023 · 1 comment

Comments

@tangjianfengVS
Copy link

/// Address for which this struct was constructed
static func create(address: UInt, index: Int) -> StackSymbol {
var info = dl_info()
dladdr(UnsafeRawPointer(bitPattern: address), &info)

    let stackSymbol = StackSymbol(symbol: symbol(info: info),
                                  file: String(cString: info.dli_fname),
                                  address: address,
                                  symbolAddress: unsafeBitCast(info.dli_saddr, to: UInt.self),
                                  image: image(info: info),
                                  offset: offset(info: info, address: address),
                                  index: index)
    return stackSymbol
}

error:
String(cString: info.dli_fname)
RCBacktrace/StackSymbol.swift:57: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

@hborders
Copy link

I also see this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants