benfred / py-spy

Sampling profiler for Python programs
MIT License
12.13k stars 401 forks source link

Fix finding BSS sections #624

Closed benfred closed 8 months ago

benfred commented 8 months ago

There can be multiple NOBITS sections in an ELF binary - and we were taking the first one as being the BSS section. In certain cases this doesn't work (including the latest python 3.12 binary in conda) - since there can be '.tbss' or '.sbss' sections instead.

Fix by performing an additional filter step using the section name.