iced-rs/iced

Miscompilation issue / problem with perf - addr2line: could not read first record

Fogapod opened this issue · 0 comments

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

I tried recording perf data for my program and it fails at perf script stage. I am not sure if this might be rustc or linux/perf issue but I only have it with iced. I later confirmed same behaviour on clock and websocket examples.

Steps to reproduce:

$ cd examples/clock

$ CARGO_PROFILE_RELEASE_DEBUG=true CARGO_PROFILE_RELEASE_STRIP=false cargo build --release
    Finished release [optimized + debuginfo] target(s) in 28.81s

$ perf record --call-graph dwarf -- ../../target/release/clock
[ perf record: Woken up 21 times to write data ]
[ perf record: Captured and wrote 8.437 MB perf.data (1025 samples) ]

$ perf script | inferno-collapse-perf > stacks.folded
addr2line /home/eugene/.debug/.build-id/62/bb8c63e30c190e024807d25ce0aeeaa64078f2/elf: could not read first record
addr2line /home/eugene/.debug/.build-id/62/bb8c63e30c190e024807d25ce0aeeaa64078f2/elf: could not read first record
addr2line /home/eugene/.debug/.build-id/62/bb8c63e30c190e024807d25ce0aeeaa64078f2/elf: could not read first record

$ file /home/eugene/.debug/.build-id/62/bb8c63e30c190e024807d25ce0aeeaa64078f2/elf
/home/eugene/.debug/.build-id/62/bb8c63e30c190e024807d25ce0aeeaa64078f2/elf: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 4.4.0, BuildID[sha1]=62bb8c63e30c190e024807d25ce0aeeaa64078f2, with debug_info, not stripped

perf script loops forever with this addr2line error.

Environment:

OS: up to date Arch Linux
CPU: AMD Ryzen 9 5950X
rust: rustc 1.77.2 (25ef9e3d8 2024-04-09)
iced: both master and latest release

Some things I tried:

  • this happens on both debug and release
  • removing target/ and ~/.debug does not help
  • fn main() { loop {} } does not trigger error
  • this happens both with and without mold linker
  • this happens without any extra rustc flags like cpu-target=native

What is the expected behavior?

perf script to complete successfully

Version

master

Operating System

Linux

Do you have any log output?

No response