LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Kernel Static Analyzers Spewing errors (https://www.linuxquestions.org/questions/linux-kernel-70/kernel-static-analyzers-spewing-errors-4175597825/)

business_kid 01-19-2017 12:18 PM

Kernel Static Analyzers Spewing errors
 
I have Slackware-14.2, the Slackware-14.2 kernel source, which is unmodified Linus' tree, and I'm having symbol issues building external modules for virtualbox. Everything has been reinstalled, entire system & kernel upgraded, but the same problems persist.

I want to know: Is my box a mess, or is the kernel a mess?

I tried the kernel Static Analysers and got crazy results. 'make help' lists the static analysers as
Code:

Static analysers
  checkstack      - Generate a list of stack hogs
  namespacecheck  - Name space analysis on compiled kernel
  versioncheck    - Sanity check on version.h usage
  includecheck    - Check for duplicate included header files
  export_report  - List the usages of all exported symbols
  headers_check  - Sanity check on exported headers
  headerdep      - Detect inclusion cycles in headers
  coccicheck      - Check with Coccinelle.

From the kernel source I ran each one of those static analysers in the format
Code:

make checkstack 2 > checkstack.err 1 > /dev/null
That catches errors, and dumps non erroneous output to the WOM (Write Only Memory :-). I won't drown you in detail, but look at the SIZE of these .err files which are error messages
Code:

bash-4.3# ls -lh *.err
-rw-r--r-- 1 root root    0 Jan 19 16:36 checkstack.err
-rw-r--r-- 1 root root  19K Jan 19 16:37 export_report.err
-rw-r--r-- 1 root root    0 Jan 19 16:38 headerdep.err
-rw-r--r-- 1 root root  20K Jan 19 15:28 includecheck.err
-rw-r--r-- 1 root root 141K Jan 19 17:51 namespacecheck.err
-rw-r--r-- 1 root root    0 Jan 19 17:53 versioncheck.err

make headerdep actually is the worst performer, although it doesn't show there. The output is in this format
Code:

./include/acpi/acpi.h:63: warning: recursive header inclusion
In file included from linux/mmzone.h,
                from linux/memory_hotplug.h:4
                from linux/mmzone.h:735 <-- here
                from linux/topology.h:32
                from linux/gfp.h:8
                from linux/percpu-refcount.h:52
                from linux/cgroup-defs.h:16
                from linux/sched.h:61
                from linux/kasan.h:16
                from linux/slab.h:107
                from acpi/platform/aclinux.h:82
                from acpi/platform/acenv.h:174

There are 1342 instances of the word 'here' but they're in /dev/null, and I hardly be thanked for pasting them. Make headerdep produces ~1MB of output. The code to get this figure was
Code:

make headerdep |grep -c here
BTW, I don't have Coccinelle installed, so that check is pointless.

Any ideas or comparisons welcome.

business_kid 01-21-2017 09:19 AM

Can nobody call this?

business_kid 01-23-2017 11:37 AM

I think I have the answer. BOTH the kernel & my box are in a mess.

I say my box because I made a little progress with that. I say the kernel because it's own static analysers are saying it's a POS (Am I allowed to say that on a linux forum? :-)


All times are GMT -5. The time now is 05:17 PM.