Skip to content

[BUG] Datadog-agent crashes with SIGSEGV #40416

@mwiesenbauer

Description

@mwiesenbauer

Datadog agent crashes with SIGSEGV with a recent version of systemd. A different instance with systemd v252 and the same agent version works fine.

Agent Environment

Agent 7.69.4 - Commit: 9bd1f3e - Serialization version: v5.0.158 - Go version: go1.24.6

configuration:

collect_ec2_tags: true
config_providers:
-   name: docker
    polling: true
listeners:
-   name: docker
log_level: WARN
logs_config:
    container_collect_all: true
logs_enabled: true
process_config:
    enabled: 'true'
    scrub_args: true

use_dogstatsd: true
dogstatsd_origin_detection: true
dogstatsd_socket: /var/run/datadog/dsd.socket
dogstatsd_port: 8125
bind_host: 127.0.0.1

Describe what happened:

Agent crashes with SIGSEGV and a very long stack trace and enters a restart loop.

agent[784790]: SIGSEGV: segmentation violation
agent[784790]: PC=0x2aa5d38 m=4 sigcode=1 addr=0x6ac1
agent[784790]: signal arrived during cgo execution
agent[784790]: goroutine 663 gp=0x40014f6540 m=4 mp=0x40000a5808 [syscall]:
agent[784790]: runtime.cgocall(0x2bb7f8c, 0x4001492cb8)
agent[784790]:         runtime/cgocall.go:167 +0x44 fp=0x4001492c80 sp=0x4001492c40 pc=0x4a9384
agent[784790]: github.com/coreos/go-systemd/sdjournal._Cfunc_my_sd_journal_enumerate_data(0xffff41662f48, 0xffff50003ce0, 0x4001284710, 0x40017ba2a8)
agent[784790]:         _cgo_gotypes.go:200 +0x34 fp=0x4001492cb0 sp=0x4001492c80 pc=0x1efdee4
agent[784790]: github.com/coreos/go-systemd/sdjournal.(*Journal).GetEntry.func6(...)
agent[784790]:         github.com/coreos/[email protected]/sdjournal/journal.go:770
agent[784790]: github.com/coreos/go-systemd/sdjournal.(*Journal).GetEntry(0x4001c23cb0)
agent[784790]:         github.com/coreos/[email protected]/sdjournal/journal.go:770 +0x6e4 fp=0x4001492e70 sp=0x4001492cb0 pc=0x1effea4
agent[784790]: github.com/DataDog/datadog-agent/pkg/logs/tailers/journald.(*Tailer).tail(0x40013aeb40)
agent[784790]:         github.com/DataDog/datadog-agent/pkg/logs/tailers/journald/tailer.go:282 +0x10c fp=0x4001492fb0 sp=0x4001492e70 pc=0x1f0274c
agent[784790]: github.com/DataDog/datadog-agent/pkg/logs/tailers/journald.(*Tailer).Start.gowrap2()
agent[784790]:         github.com/DataDog/datadog-agent/pkg/logs/tailers/journald/tailer.go:101 +0x28 fp=0x4001492fd0 sp=0x4001492fb0 pc=0x1f01908
agent[784790]: runtime.goexit({})
agent[784790]:         runtime/asm_arm64.s:1223 +0x4 fp=0x4001492fd0 sp=0x4001492fd0 pc=0x4b5904
agent[784790]: created by github.com/DataDog/datadog-agent/pkg/logs/tailers/journald.(*Tailer).Start in goroutine 442
agent[784790]:         github.com/DataDog/datadog-agent/pkg/logs/tailers/journald/tailer.go:101 +0x304

Describe what you expected:
No crash.

Steps to reproduce the issue:
Enable Log collection. If log collection is disabled, the agent does not crash.

Additional environment details (Operating System, Cloud provider, etc):

Running on an EC2 Instance with Fedora Linux 41 (Cloud Edition) as a sytemd unit.

systemd 256 (256.17-1.fc41)
+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP -GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT +LIBARCHIVE

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