From: Samuel Bronson <naesten@gmail.com>
To: Paul Marquess <Paul.Marquess@owmobility.com>
Cc: 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: Wed, 07 Sep 2016 19:22:00 -0000 [thread overview]
Message-ID: <CAJYzjmfgpaE66XKMy0v1fLRqSkahKqwZ7-YTyHZfwkekXD3oCw@mail.gmail.com> (raw)
In-Reply-To: <CY1PR0501MB117850CB88D6675A3162551395F90@CY1PR0501MB1178.namprd05.prod.outlook.com>
On Tue, Sep 6, 2016 at 12:40 PM, Paul Marquess
<Paul.Marquess@owmobility.com> wrote:
> From: Samuel Bronson [mailto:naesten@gmail.com]
>
>
>> On Mon, Sep 5, 2016 at 7:19 PM, Paul Marquess <Paul.Marquess@owmobility.com> wrote:
>> > From: Samuel Bronson [mailto:naesten@gmail.com]
>> >
>> >> On Mon, Sep 5, 2016 at 7:09 AM, Paul Marquess <Paul.Marquess@owmobility.com> wrote:
>> >> > 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.
>> >> [...]
>> >> > 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.
>> >>
>> >> You could just spawn (and wait for) your GDB-launching script from
>> >> the signal handler; then, the process & stack will still be around for GDB. I think this is even legal!
>> >
>> > That's one of the approaches I'm thinking of. I need to check if the fork/exec & wait use malloc.
>>
>> I think it should suffice for them to be "async-signal-safe "? It looks like signal(7) documents which functions several
>> versions of POSIX require to be async-signal-safe, and it looks like there are two versions of exec*() on there as well
>> as fork() and wait(). Which is basically what I meant by "I think this is even legal!" :-).
>
> I agree that "async-signal-safe " is something that needs to be considered, but it isn't the only thing. I've seen plenty of cores where corruption of a data structure inside malloc itself was the trigger for the SEGV. That's why I need to be sure that any code executed in the signal handler isn't going to blow up.
Hmm. I had not really considered that it might technically be
possible to have an async-signal-safe implementation of malloc(), and
was therefore operating under the assumption that it was impossible
for an async-signal-safe function to rely on malloc(). So, that
leaves a few questions:
1. Would it actually be a problem for an sync-signal-safe
implementation of malloc() to be called in this scenario?
2. Is such an implementation even possible?
3. Are you willing to take the chance that anyone would actually
ship one AND dare to use it in any of POSIX's mandated
async-signal-safe functions?
(Also, it has come to my attention that s*printf() are actually
functions which are not on the list -- somehow, the nature of their
task had gotten them past my radar -- so it's presumably simplest to
have the helper script get the parent PID on its own, rather than
passing it on the command line as I had initially imagined.)
next prev parent reply other threads:[~2016-09-07 19:22 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
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 [this message]
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=CAJYzjmfgpaE66XKMy0v1fLRqSkahKqwZ7-YTyHZfwkekXD3oCw@mail.gmail.com \
--to=naesten@gmail.com \
--cc=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