swift-backtrace icon indicating copy to clipboard operation
swift-backtrace copied to clipboard

Is it arm64 supported?

Open rmaqueda opened this issue 6 years ago • 8 comments

Hello,

First of all thanks for this tool, it would be amazing for me to have stack traces working on Linux.

I'm trying to use it in a Raspberry pi with Ubuntu (arm64), but I am not able to print the stack trace with Backtrace.print() or forcing a crash and see the stack.

Do you think it could work?

Thanks again.

rmaqueda avatar Oct 28 '19 17:10 rmaqueda

I'm afraid I don't know, I don't have any ARM64 hardware so I haven't tried it myself.

Your experience suggests that it probably doesn't work 😢

Let me know if you manage to debug what the problem might be.

ianpartridge avatar Oct 28 '19 17:10 ianpartridge

Thanks for your quick answer.

I've tried the same code in Ubuntu x86_64 to discard any other kind of problems and is working as expected, so looks like something is wrong with ARM64 😞.

I'm trying to find out what's happening but my knowledges in C and debug in Linux are limited. Any suggestion is very appreciated

Many thanks!

rmaqueda avatar Oct 28 '19 19:10 rmaqueda

The backtracing code is based on https://github.com/ianlancetaylor/libbacktrace - I couldn't see at a quick glance whether that supports ARM64 or not.

ianpartridge avatar Oct 28 '19 20:10 ianpartridge

@rmaqueda

I fork this project to support Android armv7 aarch64 x86 x86_64 arch. Maybe you can refer it, hope it give you some help.

https://github.com/Guang1234567/swift-backtrace

The swift-android-toolchain is here. Usage and Sample also in README.md


Snapshot:

https://github.com/Guang1234567/swift-android-architecture/blob/6542dd554a6f4b8fe622a16ec29da40b204ffe7f/todoapp/app/src/main/swift/Sources/TodoCore/TaskRepository.swift#L55

image

Guang1234567 avatar Feb 06 '20 05:02 Guang1234567

BTW, this project depends on libunwind.

So have two way to resolve it:

  • Way 1:

Install the libunwind.so to ubuntu arm64 OS. Maybe you need to compile it from source code by yourself (⊙﹏⊙).

Then Fork this project and create new swift module name CUnwind like Clibunwind, and make CBacktrace depends on it.

  • Way 2:

Fork this project and create new swift module name CUnwind and build it from source code by SPM directly, and make CBacktrace depends on it.

Guang1234567 avatar Feb 06 '20 06:02 Guang1234567

Hi @Guang1234567 thanks for the information - it's great to hear you've added ARM support in your fork! Would you be interested in contributing your changes back here in a pull request? I would be happy to merge support for Android.

ianpartridge avatar Feb 06 '20 10:02 ianpartridge

Adding a +1 here. I noticed backtrace stopped working when I switched to AWS Graviton. Would be great to have arm64 support!

grahamburgsma avatar Jan 15 '22 23:01 grahamburgsma

Adding a +1 here. I noticed backtrace stopped working when I switched to AWS Graviton. Would be great to have arm64 support!

@grahamburgsma

I fork this repo to support arm64 for android. Hope it save your time.

https://github.com/Guang1234567/swift-backtrace

Guang1234567 avatar Jan 19 '22 06:01 Guang1234567