pystack icon indicating copy to clipboard operation
pystack copied to clipboard

Support running on gz files directly

Open gaborbernat opened this issue 1 year ago • 1 comments

Is there an existing proposal for this?

  • [X] I have searched the existing proposals

Is your feature request related to a problem?

Core dumps are often automatically archived to save disk space (in my case using the .gz) format. However, pystack does not allow running directly on these files, requiring a raw core dump. This means it introduces an extra manual step of unzipping the core dump before I can use pystack to see the stacktrace.

Describe the solution you'd like

pystack should automate this kind of core dump extraction; it could see the file ends with .gz and call gzip unarchive in a temp file, and run against the temp file. This would be a quality of life improvement.

Alternatives you considered

Keep doing the manual method...

gaborbernat avatar Feb 09 '24 16:02 gaborbernat

This sounds reasonable to me. It seems reasonable to check whether a file is or isn't a gzip file (not based on its file extension but based on its contents), and if so to extract it to a temp file. Without checking the code, I'm guessing that we probably need a NamedTemporaryFile and can't get by with just a tempfile.TemporaryFile

godlygeek avatar Feb 13 '24 22:02 godlygeek

Fixed by #171

pablogsal avatar Jun 05 '24 22:06 pablogsal