[PATCH] Fix raw exit_group(2) decoding

Dmitry V. Levin ldv at altlinux.org
Sat Feb 19 00:52:57 UTC 2011


* syscall.c (trace_syscall_entering): Check for sys_exit instead of
SYS_exit to handle exit_group(2) as well as _exit(2).
---
Before the fix:
$ strace -e exit_group -e raw=all /bin/true
exit_group(0 <unfinished ... exit status 0>
After the fix:
$ strace -e exit_group -e raw=all /bin/true
exit_group(0)                           = ?

Also, __NR_exit on x86-64 has the same value as __NR_umask on i386,
so strace -e raw=all would decode 32-bit umask(2) anyway.

 syscall.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/syscall.c b/syscall.c
index 79d3b4a..e66ac0a 100644
--- a/syscall.c
+++ b/syscall.c
@@ -2707,7 +2707,8 @@ trace_syscall_entering(struct tcb *tcp)
 	else
 		tprintf("%s(", sysent[tcp->scno].sys_name);
 	if (tcp->scno >= nsyscalls || tcp->scno < 0 ||
-	    ((qual_flags[tcp->scno] & QUAL_RAW) && tcp->scno != SYS_exit))
+	    ((qual_flags[tcp->scno] & QUAL_RAW) &&
+	     sysent[tcp->scno].sys_func != sys_exit))
 		sys_res = printargs(tcp);
 	else
 		sys_res = (*sysent[tcp->scno].sys_func)(tcp);


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20110219/cbad1c78/attachment.bin>


More information about the Strace-devel mailing list