KDAB / hotspot

The Linux perf GUI for performance analysis.
4.16k stars 257 forks source link

Crash in perfparser #533

Closed GitMensch closed 1 year ago

GitMensch commented 1 year ago

Describe the bug perfparser trying to handle a bad file for quite some time, then aborting

Feature announced in header but not present: PerfHeader::OSRELEASE
Feature announced in header but not present: PerfHeader::ARCH
Feature announced in header but not present: PerfHeader::CPUDESC
Feature announced in header but not present: PerfHeader::TOTAL_MEM
Feature announced in header but not present: PerfHeader::EVENT_DESC
Feature announced in header but not present: PerfHeader::NUMA_TOPOLOGY
Feature announced in header but not present: PerfHeader::CACHE
Feature announced in header but not present: PerfHeader::MEM_TOPOLOGY
Feature announced in header but not present: PerfHeader::BPF_BTF
Feature announced in header but not present: PerfHeader::CPU_PMU_CAPS
feature not properly read PerfHeader::COMPRESSED 2807290 20
feature not properly read PerfHeader::CPUID 2807273 155757281
unhandled feature PerfHeader::BPF_PROG_INFO 2807289
feature not properly read PerfHeader::NRCPUS 2807251 8
feature not properly read PerfHeader::VERSION 2807243 155757281
unhandled feature PerfHeader::SAMPLE_TIME 2807288
feature not properly read PerfHeader::HOSTNAME 1364 6156420690771225244
Excessively long string 3013029764
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
hotspot.perfparser: QProcess::Crashed "Process crashed"
"Process crashed"
"The hotspot-perfparser binary exited with code 6 (invalid perf data file)."

To Reproduce That's likely not well reproducible... This is what I've done:

  1. using sudo perf record -o perf.data.hotspot-filter --call-graph dwarf,4096 --aio -z --sample-cpu --mmap-pages 16M -p 2807243 on an hotspot process which stayed very long on "filter", resulting file with 155,757,281 bytes
  2. sudo /tmp/hotspot-v1.4.1-192-g73c5701-x86_64.AppImage perf.data.hotspot-filter
  3. see some minutes wait time
  4. get messages and error on console
  5. hotspot reporting that "The hotspot-perfparser binary exited with code 6 (invalid perf data file)."

Expected behavior Same result that perf report has:

WARNING: The perf.data.hotspot-filter file's data size field is 0 which is unexpected.
Was the 'perf record' command properly terminated?

Less warning messages, no abort.

Version Info (please complete the following information):

milianw commented 1 year ago

do you still have the perf.data file and can share it with us please?

milianw commented 1 year ago

ping?

GitMensch commented 1 year ago

I've tested a bunch of possible recordings (from that date), but didn't found one that resulted in a chrash. I'm closing this and reopening with more information if I see this again.