Skip to content

[BUG] Possible SIGSEGV from ddtrace or ddappsec #2030

@NickStallman

Description

@NickStallman

Bug description

We've had a bunch of SIGSEV errors which have been getting worse over the last few days.
Yesterday it started happening within minutes or seconds of a PHP-FPM 7.4.33 restart, and once it started then basically all PHP requests to that PHP-FPM pool failed.

PHP version

PHP 7.4.33 (cli) (built: Feb 14 2023 18:31:54) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with ddtrace v0.86.3, Copyright Datadog, by Datadog
    with ddappsec v0.7.2, Copyright Datadog, by Datadog

Tracer version

0.86.3

Installed extensions

[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
ddappsec
ddtrace
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
imap
intl
json
libxml
mbstring
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]
ddappsec
ddtrace

OS info

PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy

Diagnostics and configuration

I have not been able to directly pin it to ddtrace or ddappsec, however after disabling both the issue has immediately vanished.
So that's about as close to as a smoking gun I seem to be able to get, which is unfortunate as ddappsec is doing a fantastic job.

I've managed to get a coredump from a crash, and it appears to be related to shutdown functions.

Stacktrace:
 #0  0x0000560956d95901 in zend_hash_add_new ()
 No symbol table info available.
 #1  0x0000560956db185f in ?? ()
 No symbol table info available.
 #2  0x0000560956d645a9 in zend_set_compiled_filename ()
 No symbol table info available.
 #3  0x0000560956d4e01a in open_file_for_scanning ()
 No symbol table info available.
 #4  0x0000560956d4e26d in compile_file ()
 No symbol table info available.
 #5  0x00007fe7aba5bdfd in ?? () from /usr/lib/php/20190902/phar.so
 No symbol table info available.
 #6  0x0000560956d4e357 in compile_filename ()
 No symbol table info available.
 #7  0x0000560956dd42d7 in ?? ()
 No symbol table info available.
 #8  0x0000560956df07ac in ?? ()
 No symbol table info available.
 #9  0x0000560956e0988c in execute_ex ()
 No symbol table info available.
 #10 0x0000560956d79884 in zend_call_function ()
 No symbol table info available.
 #11 0x0000560956c85794 in ?? ()
 No symbol table info available.
 #12 0x0000560956d7976d in zend_call_function ()
 No symbol table info available.
 #13 0x0000560956d79e52 in zend_lookup_class_ex ()
 No symbol table info available.
 #14 0x0000560956d7a773 in zend_fetch_class_by_name ()
 No symbol table info available.
 #15 0x0000560956dee5b7 in ?? ()
 No symbol table info available.
 #16 0x0000560956e07ef4 in execute_ex ()
 No symbol table info available.
 #17 0x0000560956d79884 in zend_call_function ()
 No symbol table info available.
 #18 0x0000560956d79b6c in _call_user_function_ex ()
 No symbol table info available.
 #19 0x0000560956cbe89d in ?? ()
 No symbol table info available.
 #20 0x0000560956d991da in zend_hash_apply ()
 No symbol table info available.
 #21 0x0000560956cc227e in php_call_shutdown_functions ()
 No symbol table info available.
 #22 0x0000560956d258a5 in php_request_shutdown ()
 No symbol table info available.
 #23 0x0000560956bf0e83 in ?? ()
 No symbol table info available.
 #24 0x00007fe7b1a06d90 in __libc_start_call_main (main=main@entry=0x560956befec0, argc=argc@entry=4, argv=argv@entry=0x7ffcaef1cd28) at ../sysdeps/nptl/libc_start_call_main.h:58

ddtrace and ddappsec have been installed for months now, but this issue has only popped up since the latest version was deployed. I have no explanation as to why it's slowly gotten worse over time however.
It's occurring over many different codebases (mostly Wordpress based, but totally different sites with very little in common).
And it's occurring over multiple different identical servers.
No other changes have been made to these servers for months, beyond keeping ddtrace and ddappsec up to date.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions