Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Marquess <Paul.Marquess@owmobility.com>
To: Dmitry Samersoff <dms@samersoff.net>,
	vijay nag <vijunag@gmail.com>,
	"gdb@sourceware.org" <gdb@sourceware.org>
Subject: RE: collecting data from a coring process
Date: Mon, 05 Sep 2016 11:10:00 -0000	[thread overview]
Message-ID: <CY1PR0501MB117800AACB41115C303EB9D495E60@CY1PR0501MB1178.namprd05.prod.outlook.com> (raw)
In-Reply-To: <87b59611-f5d1-628d-fd41-85ce6c6eb50b@samersoff.net>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1830 bytes --]

From: Dmitry Samersoff [mailto:dms@samersoff.net] 

> Paul,
> 
> >> 1) Why not dump the information that you are looking for into a file 
> >> in the process signal handler ?
> >
> > Would love to, but I have no idea what state the process is in once 
> > the SEGV has been triggered.
> 
> If you use altstack and avoid malloc you can dump bunch of information from the signal handler more or less safely.
> 
> e.g.
> 
> http://hg.openjdk.java.net/jdk9/hs/hotspot/file/tip/src/share/vm/utilities/vmError.cpp

Thanks, will take a look at that. When you say "more or less safely", I'm reading that as saying there will be issues with it.  :-)

I know we've had problems with signal handlers causing problems, thus my preference to find a way to have the signal handler code do as little as possible and get all the data collection handled at arm's length by gdb.  

> >>> My first thought was to add a script in 
> >>> /proc/sys/kernel/core_pattern to catch the process as it is coring. 
> >>> Then I get gdb to attach to the PID of the process that is about to 
> >>> core. Unfortunately, when I tried that, gdb gives me this error
> 
> One of possible solution is:
> 
> 1. Change /proc/sys/kernel/core_pattern to have all coredumps from your app in a separate directory, something like /var/dumps/%e/core.%p
> 
> 2. Have a cron job that looks over this directory and run gdb <exe image name> <core_name> < gdb_script > core.%p.out on demand.

That is exactly what I'm doing at the moment. Trouble is I soon will not allow a core file to be written -- the process is reaching a size where I cannot allow it to be out of action for the amount of time it takes to write that to disk. 

Paul

P.S. Sorry for the delay in following up. Had no internet access for about 10 days.
\x16º&ÖëzÛ«ŸŽv÷yb²Ö«r\x18\x1d

  reply	other threads:[~2016-09-05 11:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26  9:06 Paul Marquess
2016-08-26 12:01 ` vijay nag
2016-08-26 12:33   ` Paul Marquess
2016-08-28  7:48     ` Dmitry Samersoff
2016-09-05 11:10       ` Paul Marquess [this message]
2016-09-05 22:17         ` Samuel Bronson
2016-09-05 23:19           ` Paul Marquess
     [not found]             ` <CAJYzjmf0a2Dd8XbOQaO3937Bcab1AW9gVp=r3mKSgUq_27G8ow@mail.gmail.com>
2016-09-06 16:41               ` Paul Marquess
2016-09-07 19:22                 ` Samuel Bronson
2016-09-07 22:10                   ` Paul Marquess
     [not found]         ` <d327752e-89f6-c5a3-6d72-4789b106e1f6@samersoff.net>
2016-09-08 17:12           ` Paul Marquess
2016-09-01  4:23     ` David Niklas
2016-09-05 10:59       ` Paul Marquess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY1PR0501MB117800AACB41115C303EB9D495E60@CY1PR0501MB1178.namprd05.prod.outlook.com \
    --to=paul.marquess@owmobility.com \
    --cc=dms@samersoff.net \
    --cc=gdb@sourceware.org \
    --cc=vijunag@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox