Failing misc/check-installed-headers-c with new kernel headers.

Message ID 30a12210-dbcc-f92f-ad59-2b1c5ad10136@redhat.com
State Dropped
Headers

Commit Message

Carlos O'Donell Jan. 16, 2019, 9:10 p.m. UTC
  In the latest Fedora Rawhide weekly glibc rebase I'm seeing
a failure across all arches.

This:
BUILDSTDERR: FAIL: misc/check-installed-headers-c

With this specific output:
BUILDSTDERR: :: sys/sysctl.h
BUILDSTDERR: ::::
BUILDSTDERR: *** Obsolete types detected:
BUILDSTDERR: /usr/include/linux/sysctl.h:       KERN_PANIC_PRINT=78, /* ulong: bitmask to print system info on panic */
BUILDSTDERR: :::: -D_DEFAULT_SOURCE=1
BUILDSTDERR: :::: -D_GNU_SOURCE=1
BUILDSTDERR: :::: -D_XOPEN_SOURCE=700
BUILDSTDERR: :::: -std=c89
BUILDSTDERR: :::: -std=c89 -D_DEFAULT_SOURCE=1
BUILDSTDERR: :::: -std=c89 -D_GNU_SOURCE=1
BUILDSTDERR: :::: -std=c89 -D_XOPEN_SOURCE=700
BUILDSTDERR: :::: -std=gnu89
BUILDSTDERR: :::: -std=gnu89 -D_DEFAULT_SOURCE=1
BUILDSTDERR: :::: -std=gnu89 -D_GNU_SOURCE=1
BUILDSTDERR: :::: -std=gnu89 -D_XOPEN_SOURCE=700
BUILDSTDERR: :::: -std=c11
BUILDSTDERR: :::: -std=c11 -D_DEFAULT_SOURCE=1
BUILDSTDERR: :::: -std=c11 -D_GNU_SOURCE=1
BUILDSTDERR: :::: -std=c11 -D_XOPEN_SOURCE=700
BUILDSTDERR: :::: -std=gnu11
BUILDSTDERR: :::: -std=gnu11 -D_DEFAULT_SOURCE=1
BUILDSTDERR: :::: -std=gnu11 -D_GNU_SOURCE=1
BUILDSTDERR: :::: -std=gnu11 -D_XOPEN_SOURCE=700

This is a false positive from the regexp used to search for obsolete types.

Commit 81c9d43f94870 is the upstream kernel commit that triggers this:

---

Thoughts?
  

Comments

Zack Weinberg Jan. 19, 2019, 4:44 p.m. UTC | #1
On Wed, Jan 16, 2019 at 4:11 PM Carlos O'Donell <carlos@redhat.com> wrote:
>
> In the latest Fedora Rawhide weekly glibc rebase I'm seeing
> a failure across all arches.
...
> BUILDSTDERR: *** Obsolete types detected:
> BUILDSTDERR: /usr/include/linux/sysctl.h:       KERN_PANIC_PRINT=78, /* ulong: bitmask to print system info on panic */
...
> This is a false positive from the regexp used to search for obsolete types.

I propose to fix this by separating the obsolete-typedefs test to a
new program, implemented in Python, which lexes C accurately enough
that it won't get false positives on the contents of strings and
comments.  It will also not look at headers that aren't under our
control.  Patch shortly.

zw
  

Patch

diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
index d71013fffaf6..87aa2a6d9125 100644
--- a/include/uapi/linux/sysctl.h
+++ b/include/uapi/linux/sysctl.h
@@ -153,6 +153,7 @@  enum
        KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
        KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
        KERN_PANIC_ON_WARN=77, /* int: call panic() in WARN() functions */
+       KERN_PANIC_PRINT=78, /* ulong: bitmask to print system info on panic */
 };
 
 
---

The obsolete type is shorthand in a comment.

Should we expand the regexp in some way to ignore text within single-line
comments that we can easily detect?

Or is the accepted fix something like this (untested)? Seems a shame not to check
sysctl.h. However use of legacy types seem fairly rare these days.

diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
index 8e7beffd82..1742c2bf20 100644
--- a/scripts/check-installed-headers.sh
+++ b/scripts/check-installed-headers.sh
@@ -127,6 +127,12 @@  EOF
                 ;;
             esac
             ;;
+
+       # linux/sysctl.h is unsupported for all arches because it contains
+       # a comment with 'ulong' as shorthand for a type.
+       (sys/sysctl.h)
+           continue;;
+
     esac
 
     echo :: "$header"