Package: strace
version: 4.5.15-1
Severity: important
Architecture: hppa
Tags: Patch

strace is currently mostly unusable on hppa, because major syscalls aren't 
implemented yet.
The attached patch adds all new hppa syscalls (>=295), like e.g. the statfs64() 
which is used very often.
Without this patch, e.g. "strace df ." won't work at all. 
Example:
[EMAIL PROTECTED]:~/# strace df .
write(1, "Filesystem           1K-blocks  "..., 67Filesystem           
1K-blocks      Used Available Use% Mounted on
) = 67
getcwd("/mnt/sdb4/cvs/strace/debian/strace-4.5.15/build", 4096) = 48
stat64("/mnt/sdb4", {st_mode=0, st_size=0, ...}) = 0
upeek: ptrace(PTRACE_PEEKUSER,12750,4294967292,0): Input/output error


This bug and another shmat() bug is fixed with this patch.
It will only modify strace's behaviour on the hppa architecture.


I've reported the same bugs/patches upstream as well:
- upstream version of strace (syscall table patch):
http://sourceforge.net/tracker/index.php?func=detail&aid=1774308&group_id=2861&atid=302861

- upstream version of strace (shmat() syscall patch):
http://sourceforge.net/tracker/index.php?func=detail&aid=1774313&group_id=2861&atid=302861
--- ./linux/hppa/syscallent.h.org       2006-10-16 03:17:52.000000000 +0200
+++ ./linux/hppa/syscallent.h   2007-08-14 22:07:02.000000000 +0200
@@ -64,7 +64,7 @@
        { 4,    TN,     sys_socketpair,         "socketpair"            }, /* 
56 */
        { 2,    0,      sys_setpgid,            "setpgid"               }, /* 
57 */
        { 4,    TN,     sys_send,               "send"                  }, /* 
58 */
-       { 1,    0,      sys_uname,              "newuname"                      
}, /* 59 */
+       { 1,    0,      sys_uname,              "newuname"              }, /* 
59 */
        { 1,    0,      sys_umask,              "umask"                 }, /* 
60 */
        { 1,    TF,     sys_chroot,             "chroot"                }, /* 
61 */
        { 2,    0,      sys_ustat,              "ustat"                 }, /* 
62 */
@@ -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 */
@@ -222,7 +222,7 @@
        { 5,    0,      printargs,              "get_thread_area"       }, /* 
214 */
        { 2,    0,      sys_io_setup,           "io_setup"              }, /* 
215 */
        { 1,    0,      sys_io_destroy,         "io_destroy"            }, /* 
216 */
-       { 5,    0,      sys_io_getevents,               "io_getevents"          
}, /* 217 */
+       { 5,    0,      sys_io_getevents,       "io_getevents"          }, /* 
217 */
        { 3,    0,      sys_io_submit,          "io_submit"             }, /* 
218 */
        { 4,    0,      sys_io_cancel,          "io_cancel"             }, /* 
219 */
        { 5,    0,      printargs,              "alloc_hugepages"       }, /* 
220 */
@@ -233,11 +233,11 @@
        { 4,    TD,     sys_epoll_ctl,          "epoll_ctl"             }, /* 
225 */
        { 4,    TD,     sys_epoll_wait,         "epoll_wait"            }, /* 
226 */
        { 5,    0,      printargs,              "remap_file_pages"      }, /* 
227 */
-       { 5,    TI,     sys_semtimedop,         "semtimedop"            }, /* 
228 */
+       { 5,    TI,     sys_semtimedop,         "semtimedop"            }, /* 
228 */
        { 5,    0,      printargs,              "mq_open"               }, /* 
229 */
        { 5,    0,      printargs,              "mq_unlink"             }, /* 
230 */
        { 5,    0,      printargs,              "mq_timedsend"          }, /* 
231 */
-       { 5,    0,      printargs,              "mq_timedreceive"               
}, /* 232 */
+       { 5,    0,      printargs,              "mq_timedreceive"       }, /* 
232 */
        { 5,    0,      printargs,              "mq_notify"             }, /* 
233 */
        { 5,    0,      printargs,              "mq_getsetattr"         }, /* 
234 */
        { 4,    0,      printargs,              "waitid"                }, /* 
235 */
@@ -300,3 +300,13 @@
        { 4,    TD,     printargs,              "sync_file_range"       }, /* 
292 */
        { 4,    TD,     printargs,              "tee"                   }, /* 
293 */
        { 4,    TD,     printargs,              "vmsplice"              }, /* 
294 */
+       { 6,    0,      printargs,              "move_pages"            }, /* 
295 */
+       { 3,    0,      printargs,              "getcpu"                }, /* 
296 */
+       { 6,    TD,     printargs,              "epoll_pwait"           }, /* 
297 */
+       { 3,    TF,     sys_statfs64,           "statfs64"              }, /* 
298 */
+       { 3,    TD,     sys_fstatfs64,          "fstatfs64"             }, /* 
299 */
+       { 4,    0,      printargs,              "kexec_load"            }, /* 
300 */
+       { 4,    TD|TF,  printargs,              "utimensat"             }, /* 
301 */
+       { 3,    TD,     printargs,              "signalfd"              }, /* 
302 */
+       { 4,    TD,     printargs,              "timerfd"               }, /* 
303 */
+       { 1,    TD,     printargs,              "eventfd"               }, /* 
304 */
--- ./ipc.c.org 2007-01-15 21:25:52.000000000 +0100
+++ ./ipc.c     2007-08-14 22:07:43.000000000 +0200
@@ -387,7 +387,7 @@
                }
                if (syserror(tcp))
                        return 0;
-#ifdef LINUX
+#if defined(LINUX) && !defined(HPPA)
                if (umove(tcp, tcp->u_arg[2], &raddr) < 0)
                        return RVAL_NONE;
                tcp->u_rval = raddr;

Reply via email to