Skip to content

[Bug]: FrankenPHP with enabled tracing exits with code 137 + sigaltstack error (during graceful shutdown) #3651

@janatjak

Description

@janatjak

Bug report

dd-trace extensions crash on FrankenPHP during graceful shutdown with error: signal 15 received on thread with no signal stack (fatal error: non-Go code disabled sigaltstack) php/frankenphp#2137

Steps ti reproduce:

FROM dunglas/frankenphp:1.11-php8.5-trixie

ARG DATADOG_PHP_VERSION=1.15.2
# amd64 or arm64 - issue is on both platforms
ARG TARGETARCH=arm64

RUN apt update && apt install -y wget
RUN wget "https://github.com/DataDog/dd-trace-php/releases/download/${DATADOG_PHP_VERSION}/datadog-php-tracer_${DATADOG_PHP_VERSION}_${TARGETARCH}.deb"
RUN dpkg -i datadog-php-tracer_${DATADOG_PHP_VERSION}_${TARGETARCH}.deb
# build and run image
docker build . -t bug
docker run -p 8080:8080 -e SERVER_NAME=:8080 --name dd-bug bug

# http request - required for start datadog-ipc-helper process
curl 127.0.0.1:8080

docker stop dd-bug

Container output:

signal 15 received on thread with no signal stack
fatal error: non-Go code disabled sigaltstack

runtime stack:
runtime.throw({0x1bf4b5d?, 0x0?})
	/usr/local/go/src/runtime/panic.go:1094 +0x34 fp=0xffff1c313550 sp=0xffff1c313520 pc=0x482d94
runtime.noSignalStack(...)
	/usr/local/go/src/runtime/signal_unix.go:1106
runtime.adjustSignalStack2(0xf, 0xffff1c313608, 0x31448a0, 0x1)
	/usr/local/go/src/runtime/signal_unix.go:599 +0xa0 fp=0xffff1c313580 sp=0xffff1c313550 pc=0x463e50
runtime.adjustSignalStack(0xf, 0x31448a0, 0xffff1c313630)
	/usr/local/go/src/runtime/signal_unix.go:588 +0x234 fp=0xffff1c313600 sp=0xffff1c313580 pc=0x463d94
runtime.sigtrampgo(0xf, 0xffff17ff23c0, 0xffffdf1ae710)
	/usr/local/go/src/runtime/signal_unix.go:480 +0x84 fp=0xffff1c313680 sp=0xffff1c313600 pc=0x4638b4
runtime.sigtramp()
	/usr/local/go/src/runtime/sys_linux_arm64.s:462 +0x54 fp=0xffff1c313740 sp=0xffff1c313680 pc=0x48c734

With ddtrace.disable=On container shutdown gracefully.

docker run -p 8080:8080 -e SERVER_NAME=:8080 -e FRANKENPHP_CONFIG="php_ini ddtrace.disable On" --name dd-bug bug

PHP version

8.5

Tracer or profiler version

1.15.2

Installed extensions

No response

Output of phpinfo()

No response

Upgrading from

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions