Date: Fri, 7 Jan 2022 03:49:51 -0800 From: Mark Millard <marklmi@yahoo.com> To: freebsd-current <freebsd-current@freebsd.org> Subject: FYI: An example type of UBSAN failure during kyua test -k /usr/tests/Kyuafile Message-ID: <CE7EFE82-DDE5-43A5-B02D-1C5F39F20AE2@yahoo.com> References: <CE7EFE82-DDE5-43A5-B02D-1C5F39F20AE2.ref@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Having done a buildworld with both WITH_ASAN=3D and WITH_UBSAN=3D after finding what to control to allow the build, I installed it in a directory tree for chroot use and have "kyua test -k /usr/tests/Kyuafile" running. I see evidence of various examples of one type of undefined behavior: "applying zero offset to null pointer" # more = /usr/obj/DESTDIRs/main-amd64-xSAN-chroot/tmp/kyua.FKD2vh/356/stderr.txt=20= /usr/main-src/lib/libc/stdio/fread.c:133:10: runtime error: applying = zero offset to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior = /usr/main-src/lib/libc/stdio/fread.c:133:10 in=20 /usr/main-src/lib/libc/stdio/fread.c:133:10: runtime error: applying = zero offset to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior = /usr/main-src/lib/libc/stdio/fread.c:133:10 in=20 /usr/main-src/usr.bin/sed/process.c:715:18: runtime error: applying zero = offset to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior = /usr/main-src/usr.bin/sed/process.c:715:18 in=20 /usr/main-src/lib/libc/stdio/fread.c:133:10: runtime error: applying = zero offset to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior = /usr/main-src/lib/libc/stdio/fread.c:133:10 in=20 Fail: stderr not empty --- /dev/null 2022-01-07 10:29:57.182903000 +0000 +++ /tmp/kyua.FKD2vh/356/work/check.Mk9llD/stderr 2022-01-07 = 10:29:57.173100000 +0000 @@ -0,0 +1,2 @@ +/usr/main-src/lib/libc/stdio/fread.c:133:10: runtime error: applying = zero offset to null pointer +SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior = /usr/main-src/lib/libc/stdio/fread.c:133:10 in=20 Files left in work directory after failure: mntpt, mounterr In general the lib/libc/stdio/fread.c:133:10 example seems to be in a place that would make it fairly common. usr.bin/sed/process.c:715:18 is more limited: just sed use. =3D=3D=3D Mark Millard marklmi at yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CE7EFE82-DDE5-43A5-B02D-1C5F39F20AE2>