Skip to content

Perf profiler crashes under ASAN due to unaligned memory access #2252

@ddelnano

Description

@ddelnano

Describe the bug
ASAN detects multiple memory safety violations in perf_profile_connector.cc including stack buffer overflow and undefined behavior due to misaligned memory access. The ASAN crash reports that stack_trace_key_t structures require 8-byte alignment but are being accessed at misaligned addresses, causing undefined behavior when reading BPF map data.

To Reproduce
Steps to reproduce the behavior:

  1. Build stirling_wrapper with --config asan
  2. Run stirling_wrapper with default sources (includes PerfProfileConnector)
  3. Let it run for ~2 minutes to allow perf profiler to collect stack traces
  4. Observe ASAN violations and program crash

Expected behavior
The perf profiler should run successfully under ASAN and not exhibit memory safety issues

Screenshots
N/A

Logs
stirling_wrapper_asan_output_fastbuild.txt>

App information (please complete the following information):

  • Pixie version: Development build (commit 1c39c87 from main)
  • K8s cluster version: N/A (running stirling_wrapper standalone)
  • Node Kernel version: Linux 6.14.0-1011-gcp
  • Browser version: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/datacollectorIssues related to Stirling (datacollector)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions