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-755] [Linux] Stack traces do not include debug symbols #43370
Comments
Comment by Gregor Milos (Grzegorz Miłoś) (JIRA) This is because swift uses local symbols in ELF executables extensively and `dladdr` cannot find them (that's the documented behaviour of `dladdr` on Linux). AFAIK there is no simple alternative to `dladdr` and implementing ELF parsing code in stdlib isn't a good idea. Instead, I'm proposing writing a python script that is able to re-symbolicated stack trace afterwards. The input to it would be the executable + a log that contains a stack trace. It'll use lldb python bindings to construct debugging target identical in memory layout to what run at the time of the crash. Then it'll interrogate all the stack trace addresses for appropriate symbol information. One complication is that due to Linux's ASLR, we need extra information about where the libraries were mapped at the time of the crash. This can be achieved by minor stdlib patch to print offset of framePC from the base of the shared lib that contains the address. |
Comment by Gregor Milos (Grzegorz Miłoś) (JIRA) PR: #4479 |
This seems to be broken again. I'm running `swift-5.5.1-RELEASE` on an Ubuntu derivative w/ kernel 5.11 x86_64-unknown-linux-gnu. Here's an example stacktrace:
|
Environment
Linux x64
swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a
Additional Detail from JIRA
md5: 08f080f5fb0fe8d5531da4d738eb7636
Issue Description:
A recent Swift snapshot added stack traces for e.g.
fatalError
. 👍 However, these stack traces do not support debug symbols 🙁 The behavior is verified correct on OSX, so this bug is Linux-specific.Expected:
test
symbols should appear in this stack traceActual: symbols are given for all modules except
test
.The text was updated successfully, but these errors were encountered: