]> granicus.if.org Git - strace/commitdiff
Dying suddenly with abort() is rude, avoid if possible
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 8 Feb 2013 14:34:46 +0000 (15:34 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 8 Feb 2013 14:34:46 +0000 (15:34 +0100)
* file.c (sys_utime): Don't call abort() if wordsize is strange.
Instead, warn user about it.
* desc.c (printflock): Use the same message string as in sys_utime.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
desc.c
file.c

diff --git a/desc.c b/desc.c
index e75ed4f3bb17ec47b3f7be5ca9a725d32c4a4037..9870e9cb5a8e24b8c727be6610ea3cf15fde5c82 100644 (file)
--- a/desc.c
+++ b/desc.c
@@ -267,7 +267,7 @@ printflock(struct tcb *tcp, long addr, int getlk)
                        fl.l_pid = fl32.l_pid;
                } else {
                        /* let people know we have a problem here */
-                       tprintf("{ <decode error: unsupported wordsize %d> }",
+                       tprintf("<decode error: unsupported wordsize %d>",
                                current_wordsize);
                        return;
                }
diff --git a/file.c b/file.c
index 1cd8d3c0b9aa6cad789605ca27e3d822a066a582..151fc31cde74a6c347eb806d0698534c62ba8e2f 100644 (file)
--- a/file.c
+++ b/file.c
@@ -2121,12 +2121,15 @@ sys_utime(struct tcb *tcp)
        union {
                long utl[2];
                int uti[2];
+               long paranoia_for_huge_wordsize[4];
        } u;
-       unsigned wordsize = current_wordsize;
+       unsigned wordsize;
 
        if (entering(tcp)) {
                printpath(tcp, tcp->u_arg[0]);
                tprints(", ");
+
+               wordsize = current_wordsize;
                if (!tcp->u_arg[1])
                        tprints("NULL");
                else if (!verbose(tcp))
@@ -2142,7 +2145,8 @@ sys_utime(struct tcb *tcp)
                        tprintf(" %s]", sprinttime(u.uti[1]));
                }
                else
-                       abort();
+                       tprintf("<decode error: unsupported wordsize %d>",
+                               wordsize);
        }
        return 0;
 }