nikademus79 / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

[Feature request] Decect if process failed with coredump, and return path to coredump file. #196

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It will be useful to have a Process.get_coredump() instance method.
to get path to coredump file, or rerutn None, if no coredump was created.

Original issue reported on code.google.com by c...@shaftsoft.ru on 11 Aug 2011 at 11:37

GoogleCodeExporter commented 8 years ago
I don't know how to determine this (actually I don't even know whether it's 
possible at all). Do you have any hint? 

Original comment by g.rodola on 19 Aug 2011 at 11:52

GoogleCodeExporter commented 8 years ago
Maybe checking
http://docs.python.org/release/2.6.7/library/os.html?highlight=core#os.WCOREDUMP

or nasty parsing like:
if 'freebsd' in sys.platform:
    cmd = ["sysctl", "-n", "kern.corefile"]
elif 'linux' in sys.platform:
    cmd = ["sysctl", "-n", "kernel.core_pattern"]

or by checking some specific error codes...

Yeah, probably there is no _correct_ way to do this.

Original comment by c...@shaftsoft.ru on 19 Aug 2011 at 12:24

GoogleCodeExporter commented 8 years ago
Yep, I think we can only determine whether a process core dumped or not with 
os.WCOREDUMP but that's all:
http://www.google.com/codesearch#search/&q=os.WCOREDUMP%20lang:python&type=cs
Closing out as WontFix.

Original comment by g.rodola on 19 Aug 2011 at 6:44