apm-agent-php
apm-agent-php copied to clipboard
segfault et. al when running on ARM
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:
- build using BUILD_ARCHITECTURE=linux-arm64 make -f .ci/Makefile build
- 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::"
- Then
make -C packaging rpm BUILD_ARCH=arm64 PHP_VERSION=8.1
- Install it somehwere and run your app
- 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?
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:stream9
instead 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).
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
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 .
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
@intuibase I'll have a look when I get time. I think it will not be until next week.
Hey @klingenm Have you been able to run tests?
Hi @klingenm . Are you still interested in continuing to work on this feature?
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!
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.