[PATCH] Ignore errors if a thread is killed

Andreas Schwab schwab at redhat.com
Wed Nov 11 12:59:16 UTC 2009


In general, if a thread is forcefully killed strace should not panic.

Andreas.

>From 46ed50d56909843420b0a0cb1360a500ce421d52 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab at redhat.com>
Date: Wed, 11 Nov 2009 13:54:04 +0100
Subject: [PATCH] Ignore errors if a thread is killed

* util.c (clearbpt): Ignore ESRCH error.
---
 util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/util.c b/util.c
index a471590..78b1427 100644
--- a/util.c
+++ b/util.c
@@ -1710,7 +1710,7 @@ struct tcb *tcp;
 	    || restore_arg0 (tcp, &state, tcp->inst[0]) < 0
 	    || restore_arg1 (tcp, &state, tcp->inst[1]) < 0
 	    || arg_finish_change (tcp, &state))
-		return -1;
+		if (errno != ESRCH) return -1;
 	tcp->flags &= ~TCB_BPTSET;
 	return 0;
 }
-- 
1.6.5.2


-- 
Andreas Schwab, schwab at redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."




More information about the Strace-devel mailing list