iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
22.96k stars 1.06k forks source link

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

Open Fogapod opened 4 weeks ago

Fogapod commented 4 weeks ago

Is there an existing issue for this?

Is this issue related to iced?

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:

What is the expected behavior?

perf script to complete successfully

Version

master

Operating System

Linux

Do you have any log output?

No response