pixie icon indicating copy to clipboard operation
pixie copied to clipboard

Perf profiler crashes under ASAN due to unaligned memory access

Open ddelnano opened this issue 4 months ago • 1 comments

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

ddelnano avatar Jul 31 '25 13:07 ddelnano

While I lost the logs, the proc_exit source connector also has the same unaligned memory access.

ddelnano avatar Aug 06 '25 17:08 ddelnano