On Fri, Jun 02, 2023 at 06:39:32PM +0200, Paul de Weerd wrote:
> Hi all,
> 
> On my APUs I'm seeing "Process (pid 1) got signal 31" just before the
> init starts /etc/rc.  I booted single user and see it there too:
> 
> > softraid0 at root
> > scsibus3 at softraid0: 256 targets
> > root on sd0a (425cdd38685451a6.a) swap on sd0b dump on sd0b
> > Process (pid 1) got signal 31
> > Enter pathname of shell or RETURN for sh: 
> 
> Searching the internet reveals this is a recurring theme amongst APU2
> owners (there's a few dmesg's in various OpenBSD mailinglist archives
> that have this, all the ones I checked are for APU2's).
> 
> The message comes from kern/kern_sig.c:
> 
>                         if (pr->ps_pid <= 1) {
> #ifdef DIAGNOSTIC
>                                 /*
>                                  * Are you sure you want to ignore SIGSEGV
>                                  * in init? XXX
>                                  */
>                                 printf("Process (pid %d) got signal"
>                                     " %d\n", pr->ps_pid, signum);
> #endif
>                                 break;          /* == ignore */
>                         }
> 
> (and conf/GENERIC defines DIAGNOSTIC).  I'm curious why I (and others)
> see this on APU2, but not on other systems.  I'm guessing it's the
> kernel sending this signal to init to power down, but I don't
> understand why or where.  Is there a way to identify the source of the
> signal?
> 
> Sending the signal from userland has the documented effect of powering
> down the machine (of course).

The problem here is that this signal is sent before init installed its
signal handlers. So this is ultra early.
Now I think there are two places where this can be triggered:
dev/acpi/acpi.c:                prsignal(initprocess, SIGUSR2);
dev/acpi/acpitz.c:              prsignal(initprocess, SIGUSR2);

I would add some debug printf() in both places and see which one triggers.

-- 
:wq Claudio

Reply via email to