On Sat, Dec 19, 2020 at 07:33:42AM +0000, James Cook wrote:
> > Suggestions are welcome. In the meantime I am slowly trying to debug
> > this myself, mostly as a learning exercise. I've successfully built my
> > own bsd.rd (using the instructions on the release(8) man page) with the
> > intention of adding some debug output to narrow down where it's
> > getting stuck, but I don't know my way around the kernel code.
> 
> Minor progress: I have determined that the kernel gets at least as far
> as exec-ing the init process (more precisely, calling sys_execve in
> init_main.c).

I found out init gets stuck calling sleep(2) in setctty in
sbin/init/init.c. (Details below on how I determined that.)

Any idea what could cause a call to sleep to just hang indefinitely?

(I also tried a fresh bsd.rd just downloaded from the snapshots
directory; it still hangs.)


Details about how I determined this:

I inserted yet more logging statements, which can be seen here:
  
https://github.com/falsifian/src/commit/14d111f19872aa0a46426936ade1eedb502047b0

Then on the console I see (transcribed manually):

init: ZZZ in init 2
init: ZZZ in init 3
init: ZZZ in init 4
init: ZZZ transition(1)
init: ZZZ in transition loop: s is 1
init: ZZZ f_single_user
init: ZZZ forking...
init: ZZZ parent: continue
init: ZZZ child: start
init: ZZZ setctty: start; name is /dev/console
init: ZZZ setctty: done calling revoke

The "done calling revoke" line is printed in setctty in init.c just
before the call to sleep(2). It should print "done calling sleep"
after sleep(2), but never does.

-- 
James

Reply via email to