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

segfault et. al when running on ARM #1131

Closed
klingenm opened this issue Feb 2, 2024 · 11 comments
Closed

segfault et. al when running on ARM #1131

klingenm opened this issue Feb 2, 2024 · 11 comments
Assignees
Labels
agent-php bug Something isn't working

Comments

@klingenm
Copy link

klingenm commented Feb 2, 2024

Describe the bug
When running module on ARM, the module causes;

  • corrupted size vs. prev_size
  • free(): invalid next size (fast)
  • corrupted double-linked list
  • SIGSEGV

To Reproduce
Steps to reproduce the behavior:

  1. build using
    BUILD_ARCHITECTURE=linux-arm64 make -f .ci/Makefile build
  2. fix the packaging script to support arm
diff --git a/packaging/Makefile b/packaging/Makefile
index d71784f..dfa5b49 100644
--- a/packaging/Makefile
+++ b/packaging/Makefile
@@ -8,6 +8,7 @@ PHP_AGENT_DIR:=/opt/elastic/apm-agent-php
PHP_VERSION?=7.2
GIT_SHA?=$(shell git rev-parse HEAD || echo "unknown")
RELEASE_VERSION?=
+BUILD_ARCH?=x86-64
GITHUB_RELEASES_URL=https://github.com/elastic/apm-agent-php/releases/download
export FPM_FLAGS=

@@ -40,7 +41,7 @@ create-%: prepare  ## Create the specific package
-e OUTPUT=$(OUTPUT) \
-e FPM_FLAGS=${FPM_FLAGS} \
-e PHP_AGENT_DIR=${PHP_AGENT_DIR} \
-               -e BUILD_ARCH=x86-64 \
+               -e BUILD_ARCH=${BUILD_ARCH} \
                -w /app $(IMAGE)
        @echo "::endgroup::"
  1. Then make -C packaging rpm BUILD_ARCH=arm64 PHP_VERSION=8.1
  2. Install it somehwere and run your app
  3. see all errors above

Expected behavior

Expect APM events be sent to server.

I did see the comments build but there is also no information on when/if/ever this will be supported.

Should I give up trying to use Elastic Observability if I wanna run my stuff on ARM?

@klingenm klingenm added the bug Something isn't working label Feb 2, 2024
@klingenm
Copy link
Author

klingenm commented Feb 2, 2024

To be completely honest; I actually only got SIGSEGV and corrupted size vs. prev_size when running using the commands above. I also created a custom build image using quay.io/centos/centos:stream9instead of the soon-to-be-dead centos:7. I did this to make sure it was not some obscure backwards compatibility issue with glibc between the versions in centos:7 and fedora:39 (what I'm running my stuff in right now).

@intuibase
Copy link
Contributor

Hey @klingenm

Thank you for feedback. The reason why we choose centos 7 was glibc backward compatibility. It is compatible with newer versions. Anyway, I was working on ARM build but didn't merged it yet, however I will share libraries built on github workflow I developed (https://github.com/intuibase/apm-agent-php/tree/poc_arm_build). I'll appreciate if you could download and test them on your setup. You can find them here: https://drive.google.com/drive/folders/1U_7YgmBAeMGgNA2em5z_NJdQJLz-ZEYp?usp=sharing

@klingenm
Copy link
Author

klingenm commented Feb 7, 2024

I'm not able to load those extensions, used file to check and:

# file /opt/elastic/apm-agent-php/extensions/elastic_apm-20210902.so
/opt/elastic/apm-agent-php/extensions/elastic_apm-20210902.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=a62090a4464109fe578589a31c95a5d12e753a15, stripped

looks like you sent me x86 modules @intuibase .

@intuibase
Copy link
Contributor

Hey @klingenm

I'm sorry I mixed up the files. I decided to update ARM branch and run new build - please try out new files. They're compatible with master, please get PHP part from there of from this branch of my fork

@klingenm
Copy link
Author

@intuibase I'll have a look when I get time. I think it will not be until next week.

@intuibase
Copy link
Contributor

Hey @klingenm
Have you been able to run tests?

@SergeyKleyman
Copy link
Contributor

Hi @klingenm . Are you still interested in continuing to work on this feature?

@fgdeveloper
Copy link

fgdeveloper commented Apr 4, 2024

Hi,
sorry to interfere, but I've been following this issue for a while.

I've compliled the poc_arm_build using the @intuibase fork setup and it's currently deployed and working in AWS Fargate graviton containers running Alpine, successfully reporting to ElasticCloud.

Arm64 support would be greatly appreciated; the effort is already done by @intuibase so having it merged seems like a quick win for the product and the community.

Thanks!

@intuibase
Copy link
Contributor

Hey all, @klingenm @fgdeveloper @patrikalienus
We just released APM agent v1.14.0 with experimental support for ARM64. Please try it out and let us know it it works for you.

@intuibase intuibase self-assigned this Sep 11, 2024
@klingenm
Copy link
Author

klingenm commented Nov 18, 2024

@intuibase sorry for no answer, GitHub inbox was a bit clogged after vacation and got to looking it now, as I'm not really using it in my day to day.

We actually left you for another observability provider. Not because of this, but the cumbersome labor intensive index management required.

@fgdeveloper
Copy link

Hi @intuibase,

I actually added the APK to our ECS containers and everything seems to be working fine. Our Elastic engineer reports no issues so far.

Thanks for the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-php bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants