syslog called werrstr with the error previously saved, but werrstr's first argument is a format, and if the error contained % it can and does cause crashes. just call errstr again to swap it back. it's needed in case the syslog format refers to %r. also call errstr at the right point, after the call to sysname(), which does a system call. Reference: /n/sources/patch/applied/syslog-errstr Date: Sun Jan 20 10:25:51 CET 2013 Signed-off-by: charles.forsyth@gmail.com --- /sys/src/libc/9sys/syslog.c Sun Jan 20 10:25:22 2013 +++ /sys/src/libc/9sys/syslog.c Sun Jan 20 10:25:19 2013 @@ -93,11 +93,11 @@ } ctim = ctime(time(0)); - werrstr(err); p = buf + snprint(buf, sizeof(buf)-1, "%s ", sysname()); strncpy(p, ctim+4, 15); p += 15; *p++ = ' '; + errstr(err, sizeof err); va_start(arg, fmt); p = vseprint(p, buf+sizeof(buf)-1, fmt, arg); va_end(arg);