From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10842 invoked by alias); 17 Jul 2006 19:28:08 -0000 Received: (qmail 10833 invoked by uid 22791); 17 Jul 2006 19:28:08 -0000 X-Spam-Check-By: sourceware.org Received: from wx-out-0102.google.com (HELO wx-out-0102.google.com) (66.249.82.200) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Jul 2006 19:28:03 +0000 Received: by wx-out-0102.google.com with SMTP id t10so729383wxc for ; Mon, 17 Jul 2006 12:28:01 -0700 (PDT) Received: by 10.70.123.5 with SMTP id v5mr3350735wxc; Mon, 17 Jul 2006 12:28:01 -0700 (PDT) Received: from ?192.168.1.51? ( [68.33.112.13]) by mx.gmail.com with ESMTP id i38sm8003908wxd.2006.07.17.12.28.00; Mon, 17 Jul 2006 12:28:00 -0700 (PDT) Subject: ptrace() a stopped process? From: John Moser To: gdb@sourceware.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-6MigJCD63uDEsTyLO0Z5" Date: Mon, 17 Jul 2006 19:37:00 -0000 Message-Id: <1153163998.3704.74.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.7.4 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00118.txt.bz2 --=-6MigJCD63uDEsTyLO0Z5 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-length: 1016 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. --=20 John Moser --=-6MigJCD63uDEsTyLO0Z5 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part Content-length: 827 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iQIVAwUARLvi3Qs1xW0HCTEFAQKnBRAAkKfh0o4a0B9VQmFYMpo+fVjknXuji77i WZHDa7Zdqnq+ctCgK+oduZ1uA14/KtLF4HktbeibLWAPuk3NMETa+DNJoBN1dzGe VhgGO2kvYaah661FPQjHRh8MwrEwrhaZljBlhzotJt+Oh4ExUCc9Gb7LTdtMBOGM 368Ru92pTCo99LKYoZSMcKrCM3urxka7ZJdVpuVmDuRRF9wijUUqbbKIPgsD8ow7 F4oiG6f4Cq7+9/SM+7lrmn+hg3DfiYiFm8E0tkvfe0FU9Kasd2xBi3PL9HMXbxaL 6WlxYj9evwhp04ax5gxSrcDDa6C+zUmbiPhkmaZcL5m0SxkVB+T4a6jvHEdrgDdx ESYgmilssXEyOWpJepcVa72eUojf6wkx59OcNiN72mKGqkxmpifke1GuKrpNg2p2 /W6ROD9b8IwiOlKBo4Ku2z4rt0Lx+HZ7+faacPc40YQyNTTvNzU6b3VgFPQW/U90 HmrxO8PnQFk7yKmzBSHaN1kldOJPDc5NnvgVuX1H2SqQd+uL9pHOWGhppKuZ6JzF Y/l84W1L2wAg8zPnw1yOrvI1+g7MWBTaXjbBobGcpxchRI5RhjuMAktHTDlIgbUc 5IqqViTCfmepVLIlt/uTxs7nCVlD5zcEZBDl0eh62wn7rQ168gqOwwqsHKjVM9wa u8fjnSyIXG0= =+rdv -----END PGP SIGNATURE----- --=-6MigJCD63uDEsTyLO0Z5--