stable/11 regression: SIGSYS in the /bin/sh

Eugene Grosbein eugen at grosbein.net
Thu Jul 27 15:07:13 UTC 2017


Hi!

Very recently stable/11 got a problem somewhere between r321073 and r321459:
/bin/sh crashes with SIGSYS at boot time:

Trying to mount root from ufs:/dev/ada0s1a [ro]...
start_init: trying /sbin/init
ppid 21 (sh), uid 0: exited on signal 12
id 21 comm sh: nosys 42
Jul 27 14:30:23 init: /bin/sh on /etc/rc terminated abnormally, going to single user mode

This is *not* upgrade but complete rebuild of NanoBSD image:
all binaries, libraries and kernel are built from stable/11 sources.

My custom kernel for amd64 has COMPAT_43TTY and COMPAT_FREEBSD32 options
and no other COMPAT_XXX options. It has no COMPAT_FREEBSD10 option too
as this is new installation.

Also, I needed the following patch to make sysctl kern.lognosys
work for non-tty case:

--- sys/kern/subr_prf.c.orig     2017-07-25 15:14:27.236304000 +0700
+++ sys/kern/subr_prf.c  2017-07-27 21:05:55.912042000 +0700
@@ -958,6 +958,7 @@ number:
                        break;
                }
        }
+       return (retval);
 #undef PCHAR
 }
 
--- sys/kern/kern_sig.c.orig     2017-07-25 15:14:27.232126000 +0700
+++ sys/kern/kern_sig.c  2017-07-27 21:07:58.298440000 +0700
@@ -3596,7 +3596,9 @@
        tdsignal(td, SIGSYS);
        PROC_UNLOCK(p);
        if (kern_lognosys)
-               uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
+               if (!uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
+                   td->td_sa.code))
+                 printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
                    td->td_sa.code);
        return (ENOSYS);
 }


Please take a look.


More information about the freebsd-stable mailing list