473,408 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 4014
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: N.S. du Toit | last post by:
Just having a bit of trouble programming with C under FreeBSD 5.1 using the gcc compiler. I'm a bit new to C so my apologies if the answer to my question appear obvious :) Basically I've...
0
by: dboileau | last post by:
Can anyone help me out with this error, I am trying to compile mysql with gcc 3.4.6 (Compiled from source) using CC=gcc CFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa" \ CXX=gcc CXXFLAGS="-O3...
5
by: yogesh_anand | last post by:
Application Process core dumped which has following core stack.Any body knows meaning of t_splay () and _malloc_unlocked (). and under what condition they r trigger? --- called from signal...
29
by: DanielJohnson | last post by:
I wrote this small program to reverse each word in the string. For example: "I love You" should print as "I evoL uoY". I get Segmentation Fault (core dumped) error upon running the program. It...
4
by: yossi.kreinin | last post by:
Hi! Is there a way to save the state of a Python process for later inspection with a debugger? One way to do this is to dump core, but is the result usable for debugging with pdb (it can be...
1
by: madhuskk | last post by:
Hi, When I am trying to run Cognos setup in IBM AIX 5.3, the following error is displaying: IOT - Abort trap (Core Dumped) Please inform me the reason for this error.
1
by: henrymania | last post by:
Am writing a code for database backup....by backupservlet is as given below i get the following exception
9
by: xiao | last post by:
It always dumped when I tried to run it... But it compiles OK. What I want to do is to do a test: Read information from a .dat file and then write it to another file. The original DAT file is...
14
by: randysimes | last post by:
I am writing a Stack template. The stack is declared as an array. ; ... } I have several functions in this class template, Pop() //removes last item of stack, Push() //pushes an item to the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.