benfred / py-spy

Sampling profiler for Python programs
MIT License
12.53k stars 414 forks source link

Fix panic when virtual memory maps are empty #509

Closed benfred closed 2 years ago

benfred commented 2 years ago

In https://github.com/benfred/py-spy/issues/503, there are reports that py-spy panics - with the stack trace indicating that its trying to load up a process with no virtual memory maps.

Fix by handling the case where maps are empty, to return an Err rather than panicking