We are seeing strange problems building the kernel on 9-STABLE. The problem is intermittent and will go away if we build enough times in a row without making any changes. The problem seems to be that the usbdevs.h file (which appears to be automatically generated) gets random NULL bytes in it. This occurs on multiple servers with ECC RAM and ZFS filesystems (sometimes mounted over NFS from separate machines that also have ECC/ZFS), always only in this one file, so it's not faulty RAM or anything like that. We do build with clang and libc++ but we have seen this without those enabled as well. I've enclosed the tail end of two failed build output below. The null interloper appears at a different place in usbdevs.h and while building a different module each time. On the second failure posted below I took a hex dump of the usbdevs.h file. I don't see any NULLs at the target location, which is an empty line. (Just 0a 0a for the empty line.) In fact there are no nulls anywhere in the file. Does anyone have any idea what's going on here? This is an i386 build on 9.1-STABLE r249745, but this problem has existed for us for quite awhile in the 9-STABLE series. Thanks for any advice! First build fails: clang -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -ffreestanding -fstack-protector -Werror /usr/src/sys/dev/sound/usb/uaudio.c In file included from /usr/src/sys/dev/sound/usb/uaudio.c:70: ./usbdevs.h:3567:65: error: null character ignored [-Werror,-Wnull-character] #define USB_PRODUCT_SAMSUNG_YP_U4 0x5092 /* YP-U4 MP3 Player */ ^ 1 error generated. *** [uaudio.o] Error code 1 Stop in /usr/obj/usr/src/sys/MYKERN. *** [buildkernel] Error code 1 Stop in /usr/src. *** [buildkernel] Error code 1 Stop in /usr/src. Second build fails in a different spot, nothing changed, just up-arrowed "make buildkernel" : ===> usb/cue (all) clang -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/MYKERN/opt_global.h -I. -I@ -I@/contrib/altq -fno-common -g -I/usr/obj/usr/src/sys/MYKERN -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -c /usr/src/sys/modules/usb/cue/../../../dev/usb/net/if_cue.c In file included from /usr/src/sys/modules/usb/cue/../../../dev/usb/net/if_cue.c:76: ./usbdevs.h:3549:1: error: null character ignored [-Werror,-Wnull-character] ^ 1 error generated. *** [if_cue.o] Error code 1 Stop in /usr/src/sys/modules/usb/cue. *** [all] Error code 1 Stop in /usr/src/sys/modules/usb. *** [all] Error code 1 Stop in /usr/src/sys/modules. *** [modules-all] Error code 1 Stop in /usr/obj/usr/src/sys/MYKERN. *** [buildkernel] Error code 1 Stop in /usr/src. *** [buildkernel] Error code 1 Stop in /usr/src. Hexdump of relevant section of usbdevs.h for second failure: 00030310 65 66 69 6e 65 09 55 53 42 5f 50 52 4f 44 55 43 |efine.USB_PRODUC| 00030320 54 5f 52 4f 43 4b 46 49 52 45 5f 47 41 4d 45 50 |T_ROCKFIRE_GAMEP| 00030330 41 44 09 30 78 32 30 33 33 09 09 2f 2a 20 67 61 |AD.0x2033../* ga| 00030340 6d 65 70 61 64 20 32 30 33 55 53 42 20 2a 2f 0a |mepad 203USB */.| 00030350 0a 2f 2a 20 52 41 54 4f 43 20 53 79 73 74 65 6d |./* RATOC System| 00030360 73 20 70 72 6f 64 75 63 74 73 20 2a 2f 0a 23 64 |s products */.#d| 00030370 65 66 69 6e 65 09 55 53 42 5f 50 52 4f 44 55 43 |efine.USB_PRODUC| 00030380 54 5f 52 41 54 4f 43 5f 52 45 58 55 53 42 36 30 |T_RATOC_REXUSB60|
Dimitry Andric
2013-Jul-04 13:08 UTC
Phantom nulls in usbdevs.h during 9-STABLE kernel build
On Jul 4, 2013, at 04:43, J David <j.david.lists at gmail.com> wrote:> We are seeing strange problems building the kernel on 9-STABLE. The > problem is intermittent and will go away if we build enough times in a row > without making any changes. > > > The problem seems to be that the usbdevs.h file (which appears to be > automatically generated) gets random NULL bytes in it....> On the second failure posted below I took a hex dump of the usbdevs.h file. > I don't see any NULLs at the target location, which is an empty line. > (Just 0a 0a for the empty line.) In fact there are no nulls anywhere in > the file.So the actual file does *not* have any NUL characters in it? What happens if you run e.g. sha1(1) over it a million times? If there are NUL characters, there might be a bug in the awk script that generates usbdevs.h. If there are no NUL characters, and you get a random failure each time, there might be a bug in clang. But did you mean you also saw it with gcc? -Dimitry