Your message dated Thu, 22 Oct 2009 04:02:48 +0000
with message-id <[email protected]>
and subject line Bug#546619: fixed in strace 4.5.19-1
has caused the Debian Bug report #546619,
regarding strace for hppa is critically broken
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
546619: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546619
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: strace
version: 4.5.18-1
Severity: grave
Architecture: hppa
Tags: Patch

Strace is *unusable* on hppa.

This bug supercedes bug #437928, updates the patches listed there, and
fixes the most recent issues.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437928

Problems:
* Traced process function descriptors are accessed causing faults.
* More than maximum number of syscall arguments accessed causing upeek failures.
* Missing syscalls.
* Incorrect processing of some IPC syscalls.

Please apply the attached patch to fix all of these issues.

It is critical that strace be fixed, the debian-porters are attempting
to track down buildd instability issues and without a working strace
this makes it difficult.

Cheers,
Carlos.
From: Carlos O'Donell <[email protected]>

Miscellaneous hppa fixes

Add missing syscalls, handle IPC syscalls correctly,
avoid manipulationg function pointers, and handle
syscall arguments correctly.

This patch is based on work by Kyle McMartin and 
Helge Deller.

	* ipc.c (sys_shmat): hppa does not have a kernel 
	multiplexer for IPC.
	* linux/hppa/syscallend.h: Add missing syscalls.
	* signal.c (sys_sigaction): Avoid manipulating
	function pointers.
	(sys_rt_sigaction): Likewise.

Signed-off-by: Carlos O'Donell <[email protected]>
---

diff -urN strace-4.5.18_orig/ipc.c strace-4.5.18/ipc.c
--- strace-4.5.18_orig/ipc.c	2007-01-15 15:25:52.000000000 -0500
+++ strace-4.5.18/ipc.c	2009-09-13 21:58:31.000000000 -0400
@@ -387,7 +387,8 @@
 		}
 		if (syserror(tcp))
 			return 0;
-#ifdef LINUX
+/* HPPA does not use an IPC multiplexer.  */
+#ifdef LINUX && !defined(HPPA) 
 		if (umove(tcp, tcp->u_arg[2], &raddr) < 0)
 			return RVAL_NONE;
 		tcp->u_rval = raddr;
diff -urN strace-4.5.18_orig/linux/hppa/syscallent.h strace-4.5.18/linux/hppa/syscallent.h
--- strace-4.5.18_orig/linux/hppa/syscallent.h	2008-07-17 21:23:49.000000000 -0400
+++ strace-4.5.18/linux/hppa/syscallent.h	2009-09-13 22:06:20.000000000 -0400
@@ -197,10 +197,10 @@
 	{ 4,	TI,	sys_msgrcv,		"msgrcv"		}, /* 189 */
 	{ 4,	TI,	sys_msgget,		"msgget"		}, /* 190 */
 	{ 4,	TI,	sys_msgctl,		"msgctl"		}, /* 191 */
-	{ 4,	TI,	sys_shmat,		"shmat"			}, /* 192 */
-	{ 4,	TI,	sys_shmdt,		"shmdt"			}, /* 193 */
-	{ 4,	TI,	sys_shmget,		"shmget"		}, /* 194 */
-	{ 4,	TI,	sys_shmctl,		"shmctl"		}, /* 195 */
+	{ 3,	TI,	sys_shmat,		"shmat"			}, /* 192 */
+	{ 1,	TI,	sys_shmdt,		"shmdt"			}, /* 193 */
+	{ 3,	TI,	sys_shmget,		"shmget"		}, /* 194 */
+	{ 3,	TI,	sys_shmctl,		"shmctl"		}, /* 195 */
 	{ 5,	0,	sys_getpmsg,		"getpmsg"		}, /* 196 */
 	{ 5,	0,	sys_putpmsg,		"putpmsg"		}, /* 197 */
 	{ 2,	TF,	sys_lstat64,		"lstat64"		}, /* 198 */
@@ -302,4 +302,25 @@
 	{ 4,	TD,	printargs,		"vmsplice"		}, /* 294 */
 	{ 6,	0,	sys_move_pages,		"move_pages"		}, /* 295 */
 	{ 3,	0,	sys_getcpu,		"getcpu"		}, /* 296 */
-	{ 5,	TD,	sys_epoll_pwait,	"epoll_pwait"		}, /* 297 */
+	{ 6,	TD,	sys_epoll_pwait,	"epoll_pwait"		}, /* 297 */
+	{ 3,	TF,	sys_statfs64,		"statfs64"		}, /* 298 */
+	{ 3,	TD,	sys_fstatfs64,		"fstatfs64"		}, /* 299 */
+	{ 4,	0,	printargs,		"kexec_load"		}, /* 300 */
+	{ 4,	TD|TF,	sys_utimensat,		"utimensat"		}, /* 301 */
+	{ 3,	TD,	printargs,		"signalfd"		}, /* 302 */
+	{ 4,	TD,	printargs,		"timerfd"		}, /* 303 */
+	{ 1,	TD,	sys_eventfd,		"eventfd"		}, /* 304 */
+	{ 6,	TF,	sys_fallocate,		"fallocate"		}, /* 305 */
+	{ 2,	TD,	sys_timerfd_create,	"timerfd_create"	}, /* 306 */
+	{ 4,	TD,	sys_timerfd_settime,	"timerfd_settime"	}, /* 307 */
+	{ 2,	TD,	sys_timerfd_gettime,	"timerfd_gettime"	}, /* 308 */
+	{ 4,	TD|TS,	printargs,		"signalfd4"		}, /* 309 */
+	{ 2,	TD,	printargs,		"eventfd2"		}, /* 310 */
+	{ 1,	0,	printargs,		"epoll_create1"		}, /* 311 */
+	{ 3,	TD,	printargs,		"dup3"			}, /* 312 */
+	{ 2,	TD,	printargs,		"pipe2"			}, /* 313 */
+	{ 1,	TD,	printargs,		"inotify_init1"		}, /* 314 */
+	{ 5,	TD,	printargs,		"preadv"		}, /* 315 */
+	{ 5,	TD,	printargs,		"pwritev"		}, /* 316 */
+	{ 4,	TP|TS,	printargs,		"rt_tgsigqueueinfo"	}, /* 317 */
+	{ 5,	0,	printargs,		"perf_counter_open"	}, /* 318 */
diff -urN strace-4.5.18_orig/signal.c strace-4.5.18/signal.c
--- strace-4.5.18_orig/signal.c	2008-08-19 21:59:40.000000000 -0400
+++ strace-4.5.18/signal.c	2009-09-13 22:00:50.000000000 -0400
@@ -1120,11 +1120,19 @@
 	else if (umove(tcp, addr, &sa) < 0)
 		tprintf("{...}");
 	else {
-		if (sa.SA_HANDLER == SIG_ERR)
+ 		/* Architectures using function pointers, like
+ 		 * hppa, may need to manipulate the function pointer
+ 		 * to compute the result of a comparison. However,
+ 		 * the SA_HANDLER function pointer exists only in 
+ 		 * the address space of the traced process, and can't
+ 		 * be manipulated by strace. In order to prevent the 
+ 		 * compiler from generating code to manipulate 
+ 		 * SA_HANDLER we cast the function pointers to long. */
+		if ((long)sa.SA_HANDLER == (long)SIG_ERR)
 			tprintf("{SIG_ERR, ");
-		else if (sa.SA_HANDLER == SIG_DFL)
+		else if ((long)sa.SA_HANDLER == (long)SIG_DFL)
 			tprintf("{SIG_DFL, ");
-		else if (sa.SA_HANDLER == SIG_DFL) {
+		else if ((long)sa.SA_HANDLER == (long)SIG_DFL) {
 #ifndef USE_PROCFS
 			if (tcp->u_arg[0] == SIGTRAP) {
 				tcp->flags |= TCB_SIGTRAPPED;
@@ -1883,11 +1891,19 @@
 	else if (umove(tcp, addr, &sa) < 0)
 		tprintf("{...}");
 	else {
-		if (sa.__sigaction_handler.__sa_handler == SIG_ERR)
+ 		/* Architectures using function pointers, like
+ 		 * hppa, may need to manipulate the function pointer
+ 		 * to compute the result of a comparison. However,
+ 		 * the SA_HANDLER function pointer exists only in 
+ 		 * the address space of the traced process, and can't
+ 		 * be manipulated by strace. In order to prevent the 
+		 * compiler from generating code to manipulate 
+	 	 * SA_HANDLER we cast the function pointers to long. */
+		if ((long)sa.__sigaction_handler.__sa_handler == (long)SIG_ERR)
 			tprintf("{SIG_ERR, ");
-		else if (sa.__sigaction_handler.__sa_handler == SIG_DFL)
+		else if ((long)sa.__sigaction_handler.__sa_handler == (long)SIG_DFL)
 			tprintf("{SIG_DFL, ");
-		else if (sa.__sigaction_handler.__sa_handler == SIG_DFL)
+		else if ((long)sa.__sigaction_handler.__sa_handler == (long)SIG_DFL)
 			tprintf("{SIG_IGN, ");
 		else
 			tprintf("{%#lx, ",
diff -urN strace-4.5.18_orig/syscall.c strace-4.5.18/syscall.c
--- strace-4.5.18_orig/syscall.c	2008-08-24 23:16:26.000000000 -0400
+++ strace-4.5.18/syscall.c	2009-09-13 22:02:24.000000000 -0400
@@ -2095,13 +2095,19 @@
 #elif defined (HPPA)
 	{
 		int i;
-
+ 		long args[] = { PT_GR26-4*0, PT_GR26-4*1,
+ 				PT_GR26-4*2, PT_GR26-4*3,
+ 				PT_GR26-4*4, PT_GR26-4*5 };
+ 		
+ 		/* How many arguments does this syscall have?  */
 		if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1)
+ 			/* Syscall is known, and number of arguments is known.  */
 			tcp->u_nargs = sysent[tcp->scno].nargs;
 		else
-     	        	tcp->u_nargs = MAX_ARGS;
+ 			/* Unknown syscall, assume maximum number of arguments.  */
+ 			tcp->u_nargs = sizeof(args)/sizeof(args[0]);
 		for (i = 0; i < tcp->u_nargs; i++) {
-			if (upeek(pid, PT_GR26-4*i, &tcp->u_arg[i]) < 0)
+			if (upeek(pid, args[i], &tcp->u_arg[i]) < 0)
 				return -1;
 		}
 	}

--- End Message ---
--- Begin Message ---
Source: strace
Source-Version: 4.5.19-1

We believe that the bug you reported is fixed in the latest version of
strace, which is due to be installed in the Debian FTP archive:

strace-udeb_4.5.19-1_amd64.udeb
  to pool/main/s/strace/strace-udeb_4.5.19-1_amd64.udeb
strace_4.5.19-1.dsc
  to pool/main/s/strace/strace_4.5.19-1.dsc
strace_4.5.19-1.tar.gz
  to pool/main/s/strace/strace_4.5.19-1.tar.gz
strace_4.5.19-1_amd64.deb
  to pool/main/s/strace/strace_4.5.19-1_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Frederik Schüler <[email protected]> (supplier of updated strace package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 05 Oct 2009 22:39:54 +0200
Source: strace
Binary: strace strace64 strace-udeb
Architecture: source amd64
Version: 4.5.19-1
Distribution: unstable
Urgency: low
Maintainer: Frederik Schüler <[email protected]>
Changed-By: Frederik Schüler <[email protected]>
Description: 
 strace     - A system call tracer
 strace-udeb - A system call tracer (udeb)
 strace64   - A system call tracer for 64bit binaries
Closes: 37665 437928 503124 509499 520084 521458 535564 546619
Changes: 
 strace (4.5.19-1) unstable; urgency=low
 .
   [ Dmitry V. Levin ]
   * New upstream release.
     + Fixed FTBFS on armel, closes: #520084, #535564
     + Marked sendfile(2) as a network syscall, closes: #509499
     + Fixed syscall numbers for tee and sync_file_range, closes: #503124
     + Changed strace to exit/kill with traced process
       exitcode/signal, closes: #37665
 .
   [ Frederik Schüler ]
   * Move myself from uploaders to maintainers, and drop Roland from the list,
     closes: #521458
   * Apply hppa fixes, thanks to Carlos O'Donell <[email protected]>
     and Helge Deller <[email protected]> for the fixes, closes: #546619, #437928
   * Update standards-version to 3.8.1.
Checksums-Sha1: 
 b16e2c2246136809dbc270846c8824de99c4bd51 986 strace_4.5.19-1.dsc
 17f63cad6d22c691c118fdb335e3f9f753c36e65 712372 strace_4.5.19-1.tar.gz
 a73c47d8defd016ff42ed092b17c4f2047b8ae90 127654 strace_4.5.19-1_amd64.deb
 dc899f76c23760c4590b1fa75f0d06d45a27d4b6 97796 strace-udeb_4.5.19-1_amd64.udeb
Checksums-Sha256: 
 8f96b1717f08359e1ec53fd9b432855cac32270e6f4b281fb1ebfbe57c7095e5 986 
strace_4.5.19-1.dsc
 012f7980e53118b6cc82306a6a2b623fa635a27031fb3185a213f3d13a98af80 712372 
strace_4.5.19-1.tar.gz
 03e91f98440d2686df0ea8c79e35df2a94c290e3b097d31db002a7d6c4304650 127654 
strace_4.5.19-1_amd64.deb
 bff5f3ce82228c78a2de20d1f09e0c63000338030f82ed626ab562fdbc0bffdb 97796 
strace-udeb_4.5.19-1_amd64.udeb
Files: 
 b6b5f3fbca41f1b96d508f3f53ad00b1 986 utils standard strace_4.5.19-1.dsc
 b7800dd667300f3e3a9bc216efc1d4d8 712372 utils standard strace_4.5.19-1.tar.gz
 67aff79fc99cdb27ba858140c5e08ca2 127654 utils standard 
strace_4.5.19-1_amd64.deb
 25760a3fb329b8e12dd2af3b7eff8a04 97796 debian-installer extra 
strace-udeb_4.5.19-1_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkrfyHAACgkQ6n7So0GVSSCAcgCgh4S8pzW/JUNlVJZ6JQEcN/1P
7dUAmwT030jGhEdr9tgxvsfjo9CA3Loi
=yr50
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to