From: John Moser <john.r.moser@gmail.com>
To: gdb@sourceware.org
Subject: ptrace() a stopped process?
Date: Mon, 17 Jul 2006 19:37:00 -0000 [thread overview]
Message-ID: <1153163998.3704.74.camel@localhost> (raw)
[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]
I tried to ptrace() a stopped process and send it SIGCONT; but gdb seems
to die a horrible death of failed assertion at this.
Is it fundamentally possible in Linux 2.6.17 to ptrace() a stopped
process? This is rather important if, say, the process in question
SIGSTOP'd itself as a knee-jerk to detected memory corruption and waited
for a debugger. SIGSTOP will stop all threads in the thread group and
can't be blocked, trapped, or ignored, so it's perfect for this.
Drow pointed out to me that redhat does have a patch for this that never
went in:
http://www.redhat.com/archives/fedora-cvs-commits/2005-October/msg00448.html
I was thinking of using this for spawning a child to spawn gdb and
pausing the parent process when it catches a stack smash
(__stack_chk_fail()) or a heap corruption (glibc double-free() and
malloc() checks), but there are apparently other mechanisms. Still, gdb
dies a horrible death when you try, and if it can get along fine it
should.
--
John Moser <john.r.moser@gmail.com>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 827 bytes --]
next reply other threads:[~2006-07-17 19:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-17 19:37 John Moser [this message]
2006-07-17 21:11 ` Daniel Jacobowitz
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=1153163998.3704.74.camel@localhost \
--to=john.r.moser@gmail.com \
--cc=gdb@sourceware.org \
/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