ISO icon indicating copy to clipboard operation
ISO copied to clipboard

Some 14.0 based ISOs: kp on guz_zstd_decompress

Open probonopd opened this issue 1 year ago • 5 comments

With some 14.0-CURRENT based experimental ISOs, we get a kernel panic:

mdconfig -a -t vnode-o readonly -f /boot/rootfs.uzip
(...)
panic: guz_zstd_decompress: Expected 262144 bytes, got 163840
(...)
KDB: stack backtrace:
(...)

This is the FreeBSD source code in question: https://github.com/freebsd/freebsd-src/blob/627f1555f571b5328637dbfbe441ed89c84db20c/sys/geom/uzip/g_uzip_zstd.c#L81

  • Build 0H55 does not panic
  • Build 0H56 panics (only change was to include a self-built pkg of drm-510-kmod which is not even loaded yet at the stage where the crash happens)
  • Build 0H59 (a mere re-run of 0H56 without any code changes) also panics in the exact same way
  • Build 0H59 (reverted to the same contents as 0H55) does not panic again

Conclusion: It seems like with some contents or with some size of the contents, the mdconfig -a -t vnode-o readonly -f /boot/rootfs.uzip step fails at guz_zstd_decompress.

probonopd avatar Jul 09 '22 11:07 probonopd

  • 0H62 (same package set as 0H56 but built a day later) also panics in the exact same way

probonopd avatar Jul 10 '22 09:07 probonopd

  • 0H64 (same but with 2 MB of random data added) does not panic. Seems like we have found some bug in the zstd uzip generation and/or decompression?

probonopd avatar Jul 10 '22 09:07 probonopd

  • https://github.com/helloSystem/ISO/releases/tag/experimental-14.0-0.8.0_0H75 crashes
  • Rebuild with this change: uncomment dd if=/dev/random of="${uzip}"/random.data bs=1M count=2 in https://github.com/helloSystem/ISO/commit/c0f278e98fe49908ca7024c40ef2de357e7faf1b
  • Resulting https://github.com/helloSystem/ISO/releases/tag/experimental-14.0-0.8.0_0H77 does not crash

So here we have proof that just adding 2 MB of random data to the contents of the uzip prevents the crash.

probonopd avatar Jul 10 '22 11:07 probonopd

This can also happen with, e.g., the Developer ISO.

image

probonopd avatar Jul 14 '22 16:07 probonopd

can add normal Setup OS ? (like a Linux with Calamares ?) and, add support Wi-Fi usb-adapter? - rtl8192eu ? and.. why cannot run .appimage apps ? i just double click on apps, and not run... or, appimage not work here?? in bsd? tested on SMplayer (mpv/mplayer)

n0bzeR avatar Aug 03 '22 03:08 n0bzeR

hello-0.8.0_0H106-FreeBSD-14.0-amd64.iso crashes with guz_zstd_decompress

probonopd avatar Oct 15 '22 13:10 probonopd

Reported upstream: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267082

probonopd avatar Oct 15 '22 14:10 probonopd

Lately, more or less all helloSystem ISOs based on FreeBSD 14.0-CURRENT fail:

image

ping @cemeyer

probonopd avatar Nov 19 '22 16:11 probonopd

With makefs -R 16384 and mkuzip without -s it did not crash but the resulting ISO was noticeably larger. So in the commit above I am trying to increase the cluster size again, but using makefs -R with the same value as the mkuzip -s value.

probonopd avatar Jan 11 '23 21:01 probonopd

Seems to have worked.

So possibly makefs -R and mkuzip -s must always be kept at the same value. If this is the case, then it would be nice if mkuzip would refuse to create files with different -s values.

FreeBSD CURRENT has more checks (asserts) enabled than RELEASE, which may be the reason why the error appeared in 14-CURRENT but not in 13.1-RELEASE.

probonopd avatar Jan 11 '23 22:01 probonopd