469,646 Members | 1,322 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

is it possible to find which process dumped core

su
to find which process dumped core at the promt we give

$ file core.28424

core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11),
Intel 80386, version 1 (SYSV), from 'soffice.bin'

from this command we know 'soffice.bin' process dumped core. Now can i
do the same using python i.e. finding which process dumped core? if so
how can i do it?

Jun 5 '06 #1
5 3701
su wrote:
from this command we know 'soffice.bin' process dumped core. Now can i
do the same using python i.e. finding which process dumped core? if so
how can i do it?


You're best bet would be to run the 'file' program using the subprocess
module and parse the output that it generates.

Regards
Sreeram

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEhDmlrgn0plK5qqURArtFAKCUUzN7dV7TUGNkKLYS7Y Zt9GUTTACgwHnJ
TwAuGNBjKWiXTZsPbjpOPFI=
=7CU7
-----END PGP SIGNATURE-----

Jun 5 '06 #2
su wrote:
to find which process dumped core at the promt we give

$ file core.28424

core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11),
Intel 80386, version 1 (SYSV), from 'soffice.bin'

from this command we know 'soffice.bin' process dumped core. Now can i
do the same using python i.e. finding which process dumped core? if so
how can i do it?

Unfortunately, without some debugging, all you are likely to find is
that /usr/bin/python (or some other interpreter executable) dumped core.

You'd have to poke around inside the core image to find out which file
was being executed when the interpreter failed.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Love me, love my blog http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Jun 5 '06 #3
su wrote:
to find which process dumped core at the promt we give

$ file core.28424

core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11),
Intel 80386, version 1 (SYSV), from 'soffice.bin'

from this command we know 'soffice.bin' process dumped core. Now can i
do the same using python i.e. finding which process dumped core? if so
how can i do it?


Parse a core file like the file command does?

Jun 5 '06 #4
Steve Holden wrote:
su wrote:
to find which process dumped core at the promt we give

$ file core.28424

core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11),
Intel 80386, version 1 (SYSV), from 'soffice.bin'

from this command we know 'soffice.bin' process dumped core. Now can i
do the same using python i.e. finding which process dumped core? if so
how can i do it?

Unfortunately, without some debugging, all you are likely to find is
that /usr/bin/python (or some other interpreter executable) dumped core.

You'd have to poke around inside the core image to find out which file
was being executed when the interpreter failed.


I think he didn't want to analyze a Python core dump.

su: look into /usr/share/file/magic or whatever it's called on your box
to see where "file" looks for the executable name.

Georg
Jun 5 '06 #5
if your core is from a python program you can check what file/function
was running

use this gdb macro:

define pbt
set $i = 0
set $j = 0
while $i < 1000
select $i
if $eip >= &PyEval_EvalFrame
if $eip < &PyEval_EvalCodeEx
echo c frame #
p $i
echo py frame #
p $j
set $j = $j+1
x/s ((PyStringObject*)f->f_code->co_filename)->ob_sval
x/s ((PyStringObject*)f->f_code->co_name)->ob_sval
echo line #
p f->f_lineno
end
end
set $i = $i+1
end
end
document pbt
show python backtrace
macro by yairchu based on pyframe macro by jeremy hylton
end

works on python2.4 here but not 100% sure it will always work. it has
some nasty hack.
you can also see where each of the threads was by choosing the wanted
thread in gdb
I'll post my useful gdb macros to the web sometime soon

Jun 6 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by N.S. du Toit | last post: by
5 posts views Thread by yogesh_anand | last post: by
29 posts views Thread by DanielJohnson | last post: by
4 posts views Thread by yossi.kreinin | last post: by
14 posts views Thread by randysimes | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.