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

build a stackwalker binary for arm64 #15

Closed
wants to merge 1 commit into from
Closed

Conversation

biancadanforth
Copy link

@biancadanforth biancadanforth commented Apr 18, 2024

While trying to verify https://bugzilla.mozilla.org/show_bug.cgi?id=1888201 in Socorro stage by fetching/processing/inspecting a crash locally, I hit an error in make build[1]. Based on the error message, I believe I've hit docker/roadmap#384, since socorro-stackwalk builds a binary only for the x86_64-unknown-linux-gnu target (i.e. x86_64 architecture), but my dev machine is arm64. I am not sure what could have changed, as I successfully ran the local Socorro stack a month or so ago without issue[2].

I noticed that the rust-minidump project provides a binary for each release for Apple Silicon (arm64 architecture) among other platforms, so I thought I'd try to build a tar.gz for that and reference it in Socorro's set_up_stackwalker.sh to see if that gets make build to work.

This is a WIP to test that this approach works. Ideal state is that the bin/build_stackwalker.sh script produces binaries for multiple targets and all target binaries are published as part of a single GitHub Release, similar to the rust-minidump project's releases.


[1]: rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2 (or qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory if I disable "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" in Docker Desktop settings). After some research, I learned that /lib64/ld-linux-x86-64.so.2 is the dynamic linker specified by the binary, and it is for the x86-64 architecture.

[2]: I tried rolling back my Docker Desktop version a few versions back (well past when I remember things working), but I keep getting the same error. I also looked into rolling back my Rosetta version, but that installation is handled by my OS and not configurable AFAICT outside of rolling back my OS version.

@biancadanforth
Copy link
Author

I talked to @relud , and they helped me figure out what the issue is here (thank you!).

The base image being built for the app in socorro is multi-platform. Because we don't explicitly specify the platform, it defaults to "the target platform of the build request". For me this is linux/arm64, while for everyone else who have Linux OS or Intel Macs, it's linux/amd64.

The correct fix is to explicitly specify the platform when pulling the base image. So I will open up PRs in all the crash ingestion repos to do this.

FWIW, my WIP solution here doesn't work as-is, as I am specifying the wrong target (Mac OS instead of Linux), which explains why even after I created this new tar.gz and pulled it down in Socorro to build and run the stackwalk binary, I was still getting an error in make build indicating the architectures didn't match: /tmp/set_up_stackwalker.sh: line 37: /stackwalk-rust/minidump-stackwalk: cannot execute binary file: Exec format error.

@biancadanforth biancadanforth deleted the arm64-tar branch April 18, 2024 16:31
biancadanforth added a commit to mozilla-services/socorro that referenced this pull request Apr 18, 2024
biancadanforth added a commit to mozilla-services/antenna that referenced this pull request Apr 18, 2024
biancadanforth added a commit to mozilla-services/tecken that referenced this pull request Apr 18, 2024
biancadanforth added a commit to mozilla-services/eliot that referenced this pull request Apr 18, 2024
biancadanforth added a commit to mozilla-services/socorro that referenced this pull request Apr 18, 2024
biancadanforth added a commit to mozilla-services/antenna that referenced this pull request Apr 18, 2024
biancadanforth added a commit to mozilla-services/tecken that referenced this pull request Apr 18, 2024
biancadanforth added a commit to mozilla-services/eliot that referenced this pull request Apr 18, 2024
biancadanforth added a commit to mozilla-services/socorro that referenced this pull request May 6, 2024
biancadanforth added a commit to mozilla-services/antenna that referenced this pull request May 6, 2024
biancadanforth added a commit to mozilla-services/tecken that referenced this pull request May 6, 2024
biancadanforth added a commit to mozilla-services/eliot that referenced this pull request May 6, 2024
biancadanforth added a commit to mozilla-services/socorro that referenced this pull request May 7, 2024
biancadanforth added a commit to mozilla-services/antenna that referenced this pull request May 7, 2024
biancadanforth added a commit to mozilla-services/eliot that referenced this pull request May 7, 2024
biancadanforth added a commit to mozilla-services/socorro that referenced this pull request May 7, 2024
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

Successfully merging this pull request may close these issues.

1 participant