pystack icon indicating copy to clipboard operation
pystack copied to clipboard

Consider printing out error code and message when failing to open a coredump file

Open gillmylady opened this issue 9 months ago • 0 comments

Is there an existing proposal for this?

  • [x] I have searched the existing proposals

Is your feature request related to a problem?

First, I'm happy using PyStack, kudos to the team!

I have an issue when using "pystack core" feature. For example,

(venv) my-box1 [ ~ ]$ pystack core /var/lib/systemd/coredump/core.inchart.42086.63a8a64cc96043f397c16e4a3e4b7f5e.3748542.1743519347000000 /export/apps/python/3.10/bin/python3
💀 Engine error: Failed to open ELF file /var/lib/systemd/coredump/core.inchart.42086.63a8a64cc96043f397c16e4a3e4b7f5e.3748542.1743519347000000 💀

The related code is here.

Since it might have various reasons when failing to open a file, eg, invalid permission, ~~file not found~~, etc. It would be great if the errno and/or generic_category could be shown in the console, so that users can find out the reason immediately. Thank you for considering this enhancement!

Describe the solution you'd like

(venv) my-box1 [ ~ ]$ pystack core /var/lib/systemd/coredump/core.inchart.42086.63a8a64cc96043f397c16e4a3e4b7f5e.3748542.1743519347000000 /export/apps/python/3.10/bin/python3
💀 Engine error: Failed to open ELF file /var/lib/systemd/coredump/core.inchart.42086.63a8a64cc96043f397c16e4a3e4b7f5e.3748542.1743519347000000. Error code: 13 - Permission denied 💀

Alternatives you considered

No response

gillmylady avatar Apr 01 '25 15:04 gillmylady