Phantom nulls in usbdevs.h during 9-STABLE kernel build

J David j.david.lists at gmail.com
Thu Jul 4 16:02:13 UTC 2013


On Thu, Jul 4, 2013 at 9:08 AM, Dimitry Andric <dim at freebsd.org> wrote:

> 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?
>

Based on this suggestion, I wrote a script to sha256 usbdevs.h every 0.25
seconds and did another buildworld.  (Note: I did a third buildworld last
night, between the two I sent yesterday and this one.  It was fine.)

It died with this:

In file included from
/usr/src/sys/modules/usb/quirk/../../../dev/usb/quirk/usb_quirk.c:51:
./usbdevs.h:2487:64: error: null character ignored
[-Werror,-Wnull-character]
#define USB_PRODUCT_LOGITECH_UN53B      0xc032          /* iFeel MouseMan */

^
/usr/src/sys/modules/usb/quirk/../../../dev/usb/quirk/usb_quirk.c:95:2:
error:
      expected ')'
        USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS),
        ^
/usr/src/sys/modules/usb/quirk/../../../dev/usb/quirk/usb_quirk.c:79:32:
note:
      expanded from macro 'USB_QUIRK'
  USB_QUIRK_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, l, h, __VA_ARGS__)
                               ^
<scratch space>:29:1: note: expanded from macro 'USB_PRODUCT_'
USB_PRODUCT_LOGITECH_UN53B
^
./usbdevs.h:2487:65: note: expanded from macro 'USB_PRODUCT_LOGITECH_UN53B'
  .../* iFeel MouseMan */<U+0000>#define       USB_PRODUCT_LOGITECH_WMPAD...
                                 ^
/usr/src/sys/modules/usb/quirk/../../../dev/usb/quirk/usb_quirk.c:76:25:
note:
      expanded from macro 'USB_QUIRK_VP'
  { .vid = (v), .pid = (p), .lo_rev = (l), .hi_rev = (h), \
                        ^
/usr/src/sys/modules/usb/quirk/../../../dev/usb/quirk/usb_quirk.c:95:2:
note:
      to match this '('
        USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS),
        ^
/usr/src/sys/modules/usb/quirk/../../../dev/usb/quirk/usb_quirk.c:79:3:
note:
      expanded from macro 'USB_QUIRK'
  USB_QUIRK_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, l, h, __VA_ARGS__)
  ^
/usr/src/sys/modules/usb/quirk/../../../dev/usb/quirk/usb_quirk.c:76:24:
note:
      expanded from macro 'USB_QUIRK_VP'
  { .vid = (v), .pid = (p), .lo_rev = (l), .hi_rev = (h), \
                       ^
2 errors generated.
*** [usb_quirk.o] Error code 1

My script says usbdevs.h was generated early on in the build process (with
the same SHA256 value as the one that previously worked) and did not report
any subsequent changes during the build and failure.

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.


As before, I don't see any nulls in the actual file:

00000070  6f 75 73 65 20 2a 2f 0a  23 64 65 66 69 6e 65 09  |ouse
*/.#define.|
00000080  55 53 42 5f 50 52 4f 44  55 43 54 5f 4c 4f 47 49
 |USB_PRODUCT_LOGI|
00000090  54 45 43 48 5f 55 4e 35  33 42 09 30 78 63 30 33
 |TECH_UN53B.0xc03|
000000a0  32 09 09 2f 2a 20 69 46  65 65 6c 20 4d 6f 75 73  |2../* iFeel
Mous|
000000b0  65 4d 61 6e 20 2a 2f 0a  23 64 65 66 69 6e 65 09  |eMan
*/.#define.|
000000c0  55 53 42 5f 50 52 4f 44  55 43 54 5f 4c 4f 47 49
 |USB_PRODUCT_LOGI|
000000d0  54 45 43 48 5f 57 4d 50  41 44 09 30 78 63 32 30
 |TECH_WMPAD.0xc20|


>  But did you
> mean you also saw it with gcc?
>

Yes, I am pretty sure we have seen this with gcc as well because one of the
first machines that started doing this doesn't have the CLANG options in
make.conf.  I will try to reproduce that to be absolutely sure, but that
may take several hours.

Thanks!


More information about the freebsd-stable mailing list