facebookarchive / BOLT

Binary Optimization and Layout Tool - A linux command-line utility used for optimizing performance of binaries
2.51k stars 177 forks source link

segmentation fault from perf during perf2bolt #277

Closed wonjeon closed 2 years ago

wonjeon commented 2 years ago

perf2bolt was executed in order to convert perf profile to bolt format, the following error occurred. (dylib) is a .so file which is dynamically loaded by the executable (exe file). The perf profile was collected with the script calling the executable.

$ perf2bolt -p perf.data -o perf.fdata (dylib) BOLT-INFO: shared object or position-independent executable detected PERF2BOLT: Starting data aggregation job for perf.data PERF2BOLT: spawning perf job to read branch events PERF2BOLT: spawning perf job to read mem events PERF2BOLT: spawning perf job to read process events PERF2BOLT: spawning perf job to read task events BOLT-INFO: Target architecture: x86_64 BOLT-INFO: BOLT version: 88c70afe9d388ad430cc150cc158641701397f70 BOLT-INFO: first alloc address is 0x0 BOLT-INFO: creating new program header table at address 0x400000, offset 0x400000 BOLT-INFO: enabling relocation mode BOLT-INFO: enabling strict relocation mode for aggregation purposes BOLT-INFO: pre-processing profile using perf data aggregator BOLT-WARNING: build-id will not be checked because we could not read one from input binary PERF2BOLT: waiting for perf mmap events collection to finish... PERF-ERROR: /usr/bin/perf: Segmentation fault (core dumped)

Could you let me know how I should approach this issue? Thank you.

wonjeon commented 2 years ago

Figured out the issue by executing 'perf' inside the script to get a correct profiling data. Closed the issue.