Skip to content

[Bug]: Stack buffer overflow crash in do_macos_mach_smi on Apple Silicon #22552

@artem

Description

@artem

Bug description

Netdata crashes immediately upon startup. The crash is caused by a stack buffer overflow.

Relevant log output:

"exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
"termination" : {"flags":0,"code":6,"namespace":"SIGNAL","indicator":"Abort trap: 6","byProc":"netdata","byPid":72719},
"asi" : {"libsystem_c.dylib":["stack buffer overflow"]},

...

"id":29393209,"name":"P[macos]","threadState":{ ... },
"frames":[{"imageOffset":38376,"symbol":"__pthread_kill","symbolLocation":8,"imageIndex":89},
{"imageOffset":26840,"symbol":"pthread_kill","symbolLocation":296,"imageIndex":92},
{"imageOffset":493288,"symbol":"__abort","symbolLocation":152,"imageIndex":93},
{"imageOffset":493504,"symbol":"__stack_chk_fail","symbolLocation":96,"imageIndex":93},
{"imageOffset":8366736,"symbol":"do_macos_mach_smi","symbolLocation":2628,"imageIndex":0},
{"imageOffset":8348624,"symbol":"macos_main","symbolLocation":368,"imageIndex":0},
{"imageOffset":8961364,"symbol":"nd_thread_starting_point","symbolLocation":556,"imageIndex":0},
{"imageOffset":27736,"symbol":"_pthread_start","symbolLocation":136,"imageIndex":92},
{"imageOffset":7196,"symbol":"thread_start","symbolLocation":8,"imageIndex":92}]}

Expected behavior

The daemon does not crash

Steps to reproduce

/opt/homebrew/opt/netdata/sbin/netdata -D

Installation method

other

System info

Darwin  25.5.0 Darwin Kernel Version 25.5.0: Mon Apr 27 20:41:06 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T6030 arm64
ProductName:            macOS
ProductVersion:         26.5
BuildVersion:           25F71

Netdata build info

Packaging:
    Netdata Version ____________________________________________ : v2.10.3
    Installation Type __________________________________________ : custom
    Package Architecture _______________________________________ : unknown
    Package Distro _____________________________________________ : unknown
    Configure Options __________________________________________ : cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_STANDARD=11 -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=' -fexceptions -fno-omit-frame-pointer -funwind-tables -fasynchronous-unwind-tables' -DCMAKE_CXX_FLAGS='  -fexceptions -fno-omit-frame-pointer -funwind-tables -fasynchronous-unwind-tables' -DCMAKE_COMPILE_DEFINITIONS='' -DCMAKE_EXE_LINKER_FLAGS=' -fexceptions -rdynamic' -DCMAKE_SHARED_LINKER_FLAGS=''
Default Directories:
    User Configurations ________________________________________ : /opt/homebrew/etc/netdata
    Stock Configurations _______________________________________ : /opt/homebrew/Cellar/netdata/2.10.3_1/lib/netdata/conf.d
    Ephemeral Databases (metrics data, metadata) _______________ : /opt/homebrew/var/cache/netdata
    Permanent Databases ________________________________________ : /opt/homebrew/var/lib/netdata
    Plugins ____________________________________________________ : /opt/homebrew/Cellar/netdata/2.10.3_1/libexec/netdata/plugins.d
    Static Web Files ___________________________________________ : /opt/homebrew/Cellar/netdata/2.10.3_1/share/netdata/web
    Log Files __________________________________________________ : /opt/homebrew/var/log/netdata
    Lock Files _________________________________________________ : /opt/homebrew/var/lib/netdata/lock
    Home _______________________________________________________ : /opt/homebrew/var/lib/netdata
Operating System:
    Kernel _____________________________________________________ : Darwin
    Kernel Version _____________________________________________ : 25.5.0
    Operating System ___________________________________________ : macOS
    Operating System ID ________________________________________ : macOS
    Operating System ID Like ___________________________________ : macOS
    Operating System Version ___________________________________ : 26.5
    Operating System Version ID ________________________________ : none
    Detection __________________________________________________ : sw_vers
Hardware:
    CPU Cores __________________________________________________ : 12
    CPU Frequency ______________________________________________ : unknown
    RAM Bytes __________________________________________________ : 38654705664
    Disk Capacity ______________________________________________ : 994662584320
    CPU Architecture ___________________________________________ : arm64
    Virtualization Technology __________________________________ : unknown
    Virtualization Detection ___________________________________ : none
Container:
    Container __________________________________________________ : unknown
    Container Detection ________________________________________ : none
    Container Orchestrator _____________________________________ : none
    Container Operating System _________________________________ : none
    Container Operating System ID ______________________________ : none
    Container Operating System ID Like _________________________ : none
    Container Operating System Version _________________________ : none
    Container Operating System Version ID ______________________ : none
    Container Operating System Detection _______________________ : none
Features:
    Built For __________________________________________________ : MacOS
    Netdata Cloud ______________________________________________ : YES
    Health (trigger alerts and send notifications) _____________ : YES
    Streaming (stream metrics to parent Netdata servers) _______ : YES
    Back-filling (of higher database tiers) ____________________ : YES
    Replication (fill the gaps of parent Netdata servers) ______ : YES
    Streaming and Replication Compression ______________________ : YES (zstd lz4 gzip)
    Contexts (index all active and archived metrics) ___________ : YES
    Tiering (multiple dbs with different metrics resolution) ___ : YES (5)
    Machine Learning ___________________________________________ : YES
    Memory Allocator ___________________________________________ : system
Database Engines:
    dbengine (compression) _____________________________________ : YES (zstd lz4)
    alloc ______________________________________________________ : YES
    ram ________________________________________________________ : YES
    none _______________________________________________________ : YES
Connectivity Capabilities:
    ACLK (Agent-Cloud Link: MQTT over WebSockets over TLS) _____ : YES
    static (Netdata internal web server) _______________________ : YES
    WebRTC (experimental) ______________________________________ : NO
    Native HTTPS (TLS Support) _________________________________ : YES
    TLS Host Verification ______________________________________ : YES
Libraries:
    LZ4 (extremely fast lossless compression algorithm) ________ : YES
    ZSTD (fast, lossless compression algorithm) ________________ : YES
    zlib (lossless data-compression library) ___________________ : YES
    Brotli (generic-purpose lossless compression algorithm) ____ : NO
    protobuf (platform-neutral data serialization protocol) ____ : YES (system)
    OpenSSL (cryptography) _____________________________________ : YES
    libdatachannel (stand-alone WebRTC data channels) __________ : NO
    JSON-C (lightweight JSON manipulation) _____________________ : YES
    libcap (Linux capabilities system operations) ______________ : NO
    libcrypto (cryptographic functions) ________________________ : YES
    libyaml (library for parsing and emitting YAML) ____________ : YES
    libmnl (library for working with netfilter) ________________ : NO
    stacktraces (library for getting stack traces) _____________ : unknown
Plugins:
    apps (monitor processes) ___________________________________ : YES
    cgroups (monitor containers and VMs) _______________________ : NO
    cgroup-network (associate interfaces to CGROUPS) ___________ : NO
    proc (monitor Linux systems) _______________________________ : NO
    tc (monitor Linux network QoS) _____________________________ : NO
    diskspace (monitor Linux mount points) _____________________ : NO
    freebsd (monitor FreeBSD systems) __________________________ : NO
    macos (monitor MacOS systems) ______________________________ : YES
    windows (monitor Windows systems) __________________________ : NO
    statsd (collect custom application metrics) ________________ : YES
    timex (check system clock synchronization) _________________ : YES
    idlejitter (check system latency and jitter) _______________ : YES
    bash (support shell data collection jobs - charts.d) _______ : YES
    debugfs (kernel debugging metrics) _________________________ : NO
    cups (monitor printers and print jobs) _____________________ : YES
    ebpf (monitor system calls) ________________________________ : NO
    freeipmi (monitor enterprise server H/W) ___________________ : NO
    network-viewer (monitor TCP/UDP IPv4/6 sockets) ____________ : NO
    systemd-journal (monitor journal logs) _____________________ : NO
    windows-events (monitor Windows events) ____________________ : NO
    nfacct (gather netfilter accounting) _______________________ : NO
    perf (collect kernel performance events) ___________________ : NO
    slabinfo (monitor kernel object caching) ___________________ : NO
    Xen ________________________________________________________ : NO
    Xen VBD Error Tracking _____________________________________ : NO
Exporters:
    AWS Kinesis ________________________________________________ : NO
    GCP PubSub _________________________________________________ : NO
    MongoDB ____________________________________________________ : NO
    Prometheus (OpenMetrics) Exporter __________________________ : YES
    Prometheus Remote Write ____________________________________ : YES
    Graphite ___________________________________________________ : YES
    Graphite HTTP / HTTPS ______________________________________ : YES
    JSON _______________________________________________________ : YES
    JSON HTTP / HTTPS __________________________________________ : YES
    OpenTSDB ___________________________________________________ : YES
    OpenTSDB HTTP / HTTPS ______________________________________ : YES
    All Metrics API ____________________________________________ : YES
    Shell (use metrics in shell scripts) _______________________ : YES
Debug/Developer Features:
    Trace All Netdata Allocations (with charts) ________________ : NO
    Developer Mode (more runtime checks, slower) _______________ : NO
Runtime Information:
    Profile ____________________________________________________ : standalone
    Stream Parent (accept data from Children) __________________ : NO
    Stream Child (send data to a Parent) _______________________ : NO
    Total System Memory ________________________________________ : 38654705664
    Available System Memory ____________________________________ : 16529096704

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageIssues which need to be manually labelledos/macosmacOS os related issues

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions