Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: GenAI reported that walltime is not collecting python stacks in any of our profilers (walltime / Pyperf) When looking into the issue we noticed that the Python executable being used is a PIE (Position Independent Executable) This can be seen in the file output ``` file /proc/2809260/root/packages/xlformers_emu_conda_unified/conda/bin/python3.10 ``` ``` ELF 64-bit LSB **pie** executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/local/fbcode/platform010//lib/ld.so, for GNU/Linux 2.6.18, with debug_info, not stripped ``` Code below handles PIE by treating it as a regular executable but handling the relocation. We detect if this is a PIE by checking two conditions 1) type is `ET_DYN` 2) Dynamic section has the `DF_1_PIE` flag set ``` [root@twshared48896.02.pci2 ~]# readelf --dynamic /proc/651059/root/packages/xlformers_multimodal_conda/conda/bin/python3.10 | grep FLAGS_1 0x000000006ffffffb (FLAGS_1) Flags: NOW PIE ``` More Info: https://fburl.com/moahwrc8 Reviewed By: nslingerland Differential Revision: D66198184 fbshipit-source-id: faf5da2476a1a81a4e2dd0a3d3cf8e4adb8c557c
- Loading branch information