Page 1 of 1

Kernel Panic on `zpool import` with 2.0.1 and Big Sur 11.4

PostPosted: Sun Jun 06, 2021 7:44 pm
by jordancurve
I get a panic with 2.0.1 and Big Sur 11.4 on an Intel iMac (Retina 5K, 27-inch, Late 2014) as soon as I run `zpool import -a`. Panic log: https://pastebin.com/LY4LcQqb . I reported this on IRC, and people suggested I try `zpool import -o readonly=on -a`. That doesn't panic, and it gives me readonly access to my data, which is nice.

Re: Kernel Panic on `zpool import` with 2.0.1 and Big Sur 11

PostPosted: Fri Jun 18, 2021 5:22 pm
by jordancurve
Planning to downgrade to Catalina to see if that helps.

Re: Kernel Panic on `zpool import` with 2.0.1 and Big Sur 11

PostPosted: Mon Jun 21, 2021 3:58 pm
by lundman
This is the scrub process that is going too deep into the stack space and overflowing. Readonly disables scrubs, and you can probably stop scrubs with one of the sysctls.

We will try to figure out how to make the stack smaller

Re: Kernel Panic on `zpool import` with 2.0.1 and Big Sur 11

PostPosted: Mon Jun 21, 2021 4:34 pm
by lundman
As a quick fix, how difficult would it be for you to double the kernel stack space and try?

The default is "4" so

sudo nvram boot-args="kernel_stack_pages=8"

But check what the value of "boot-args" is first, and append the new option.

If that is beyond your comfort zone, then just leave it.

Re: Kernel Panic on `zpool import` with 2.0.1 and Big Sur 11

PostPosted: Mon Jun 21, 2021 5:10 pm
by jordancurve
Setting kernel_stack_pages=8 appears to completely fix the issue! I rebooted, ran `zpool import -a`, and I now I seem to have read/write access to my datasets. `zpool status` shows that it's currently scrubbing:

Code: Select all
 state: ONLINE
status: Some supported and requested features are not enabled on the pool.
   The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
   the pool may no longer be accessible by software that does not support
   the features. See zpool-features(5) for details.
  scan: scrub in progress since Sun Jun  6 18:27:14 2021
   629G scanned at 2.78G/s, 10.6G issued at 47.9M/s, 894G total
   0B repaired, 1.18% done, 05:14:47 to go


My current boot-args are: "kernel_stack_pages=8 -v keepsyms=1"

Re: Kernel Panic on `zpool import` with 2.0.1 and Big Sur 11

PostPosted: Mon Jun 21, 2021 6:52 pm
by lundman
Ace, thanks for confirming the problem for us. If you can, keep it using large stacks until we can address the issue.

Re: Kernel Panic on `zpool import` with 2.0.1 and Big Sur 11

PostPosted: Mon Jun 21, 2021 6:54 pm
by lundman
Oh actually, can you show:

sysctl kern.stack_depth_max

Be curious how large it got.

Re: Kernel Panic on `zpool import` with 2.0.1 and Big Sur 11

PostPosted: Mon Jun 21, 2021 7:45 pm
by jordancurve
Thanks for finding this workaround. I'll happily keep my stack depth at 8 as long as necessary.

Code: Select all
$ sysctl kern.stack_depth_max
kern.stack_depth_max: 22368


The scrub finished so I guess that's as deep as it got.