apache / skywalking

APM, Application Performance Monitoring System
https://skywalking.apache.org/
Apache License 2.0
23.86k stars 6.52k forks source link

[Bug] [PHP]Segmentation fault (core dumped) #9866

Closed cuifox closed 2 years ago

cuifox commented 2 years ago

Search before asking

Apache SkyWalking Component

PHP (apache/skywalking-php)

What happened

PHP 7.3.33 (cli) (built: Nov 30 2021 08:42:58) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies

/tmp/pear/download/skywalking_agent-0.1.0 # make PHP_CONFIG=php-config cargo build --release make: *** [Makefile:193: modules/skywalking_agent.so] Segmentation fault (core dumped)

What you expected to happen

core dumped

How to reproduce

dont konw

Anything else

No response

Are you willing to submit PR?

Code of Conduct

wu-sheng commented 2 years ago

Please make your title of issue complete.

jmjoy commented 2 years ago

Which OS and release version do you use?

cuifox commented 2 years ago

docker image php:7.3-fpm-alpine

jmjoy commented 2 years ago

Please use higher version alpine for building Rust, because there is a known bug for musl.

https://github.com/rust-lang/rust/issues/76021

cuifox commented 2 years ago

My current Linux Alpine,Which version can succeed?

cat /etc/alpine-release

3.15.1

cat /etc/apk/repositories

https://mirrors.aliyun.com/alpine/edge/main https://mirrors.aliyun.com/alpine/edge/community https://mirrors.aliyun.com/alpine/edge/testing

apk info musl

musl-1.2.3-r1 description: the musl c library (libc) implementation

musl-1.2.3-r1 webpage: https://musl.libc.org/

musl-1.2.3-r1 installed size: 608 KiB

php -v

PHP 7.3.33 (cli) (built: Mar 18 2022 04:05:52) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies

jmjoy commented 2 years ago

What's your Dockerfile, or build steps?

cuifox commented 2 years ago

FROM php:7.3-fpm-alpine

RUN set -ex \ && echo "https://mirrors.aliyun.com/alpine/edge/main" > /etc/apk/repositories \ && echo "https://mirrors.aliyun.com/alpine/edge/community" >> /etc/apk/repositories \ && echo "https://mirrors.aliyun.com/alpine/edge/testing" >> /etc/apk/repositories \ && apk add --update --no-cache --virtual .build-deps1 g++ autoconf make cargo clang protobuf \ && apk add --update --no-cache --virtual .build-deps2 git libevent-dev openssl-dev jpeg-dev freetype-dev libpng-dev libzip-dev libwebp-dev libmcrypt-dev libxml2-dev \ && docker-php-ext-install pcntl posix pdo_mysql soap sockets \ && docker-php-ext-configure gd --with-webp=/usr/include/webp --with-jpeg=/usr/include --with-freetype=/usr/include/freetype2/ \ && docker-php-ext-install -j$(nproc) gd \ && pecl install redis zip apcu mcrypt event skywalking_agent \ && docker-php-ext-enable redis zip apcu mcrypt event skywalking_agent \ && apk del .build-deps1

CMD ["php-fpm"]

jmjoy commented 2 years ago

I think the coredump was caused by make, not rust.

Alpine occasionally has strange problems. I recommend Debian.

cuifox commented 2 years ago

Errors have been mentioned above:

/tmp/pear/download/skywalking_agent-0.1.0 # make PHP_CONFIG=php-config cargo build --release make: *** [Makefile:193: modules/skywalking_agent.so] Segmentation fault (core dumped)

Successed: alpine:3.16.2

php -v

PHP 7.4.32 (cli) (built: Oct 7 2022 00:41:01) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies

apk info musl

musl-1.2.3-r0 description: the musl c library (libc) implementation

musl-1.2.3-r0 webpage: https://musl.libc.org/

musl-1.2.3-r0 installed size: 608 KiB

cuifox commented 2 years ago

I want to succeed in this version : php:7.3-fpm-alpine

cuifox commented 2 years ago

image