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-10504] No Stack Trace is produced on Linux Ubuntu 16.04/18.04 with AArch64 CPU #52904

Closed
futurejones opened this issue Apr 18, 2019 · 2 comments
Closed

Comments

@futurejones
Copy link
Contributor

@futurejones futurejones commented Apr 18, 2019

Previous ID SR-10504
Radar None
Original Reporter @futurejones
Type Bug
Status Closed
Resolution Done
Environment

Linux Ubuntu 16.04/18.04 AArch64

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

md5: 89c3bbd67c6b974a07f1d6df8c0c6da8

Issue Description:

No Stack Trace is being produced on Linux Ubuntu 16.04/18.04 with AArch64 CPU.
The following are the outputs from running the backtrace.swift test file.

x86

(lldb) target create backtrace
Current executable set to 'backtrace' (x86_64).
(lldb) r
Process 3130 launched: '/backtrace' (x86_64)
Fatal error: Unexpectedly found nil while unwrapping an Optional value
Current stack trace:
0    libswiftCore.so                    0x00007ffff7cce050 _swift_stdlib_reportFatalError + 69
1    libswiftCore.so                    0x00007ffff7bdbdc6 <unavailable> + 3280326
2    libswiftCore.so                    0x00007ffff7bdc145 <unavailable> + 3281221
3    libswiftCore.so                    0x00007ffff7a03bd0 _fatalErrorMessage(_:_:file:line:flags:) + 19
4    backtrace                          0x00005555555550eb <unavailable> + 4331
5    backtrace                          0x0000555555554ff4 <unavailable> + 4084
6    libc.so.6                          0x00007ffff6c70740 __libc_start_main + 240
7    backtrace                          0x0000555555554d79 <unavailable> + 3449
Process 3130 stopped
* thread #&#8203;1, name = 'backtrace', stop reason = Fatal error: Unexpectedly found nil while unwrapping an Optional value
    frame #&#8203;0: 0x00007ffff7c707c0 libswiftCore.so`_swift_runtime_on_report
libswiftCore.so`_swift_runtime_on_report:
->  0x7ffff7c707c0 <+0>: retq
    0x7ffff7c707c1:      nopw   %cs:(%rax,%rax)
libswiftCore.so`_swift_reportToDebugger:
    0x7ffff7c707d0 <+0>: jmp    0x7ffff7c707c0            ; _swift_runtime_on_report
    0x7ffff7c707d5:      nopw   %cs:(%rax,%rax)
Target 0: (backtrace) stopped.
(lldb)

aarch64

(lldb) target create backtrace
Current executable set to 'backtrace' (aarch64).
(lldb) r
Process 1085 launched: '/backtrace' (aarch64)
Fatal error: Unexpectedly found nil while unwrapping an Optional value
Current stack trace:
Process 1085 stopped
* thread #&#8203;1, name = 'backtrace', stop reason = Fatal error: Unexpectedly found nil while unwrapping an Optional value
    frame #&#8203;0: 0x0000007fb7e297b4 libswiftCore.so`_swift_runtime_on_report
libswiftCore.so`_swift_runtime_on_report:
->  0x7fb7e297b4 <+0>: ret

libswiftCore.so`_swift_reportToDebugger:
    0x7fb7e297b8 <+0>: b      0x7fb7e297b4              ; _swift_runtime_on_report

libswiftCore.so`_swift_shouldReportFatalErrorsToDebugger:
    0x7fb7e297bc <+0>: adrp   x8, 292
    0x7fb7e297c0 <+4>: ldrb   w0, [x8, #&#8203;0x490]
Target 0: (backtrace) stopped.
(lldb)

As there is no stack trace being produced the linux-fatal-bracktrace test is failing on aarch64.

@belkadan
Copy link
Contributor

@belkadan belkadan commented Apr 18, 2019

It looks like the implementation for this is in swift::printCurrentBacktrace in stdlib/public/runtime/Errors.cpp, if you want to check it out. It's just calling backtrace(3), though, so you or someone would have to look into why that might be failing on AArch64.

@futurejones
Copy link
Contributor Author

@futurejones futurejones commented Jul 16, 2020

Closing this as the test is now passing.

@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
Projects
None yet
Development

No branches or pull requests

2 participants