Public bug reported:

/usr/src/linux-headers-5.4.0-187/scripts/kernel-doc has a
syntax/compilation error, which makes the script fail.

To reproduce:
- install linux-headers-5.4.0-187
- run /usr/src/linux-headers-5.4.0-187/scripts/kernel-doc

What should happen:
- should print usage doc

What happens:
- fails with error
```
Global symbol "$args" requires explicit package name (did you forget to declare 
"my $args"?) at /usr/src/linux-headers-5.4.0-187/scripts/kernel-doc line 1089.
Global symbol "$args" requires explicit package name (did you forget to declare 
"my $args"?) at /usr/src/linux-headers-5.4.0-187/scripts/kernel-doc line 1089.
Execution of /usr/src/linux-headers-5.4.0-187/scripts/kernel-doc aborted due to 
compilation errors.
```

Details about the syntax error:
- this is a regression since package linux-headers-5.4.0-182: script 
/usr/src/linux-headers-5.4.0-182/scripts/kernel-doc works OK & prints usage doc
- the error message is a clear representation of the problem : in function 
"dump_struct($$)", "args" has not been declared when used at line 1089

What was I doing that made me notice this?:
- building a DKMS module; the module failed to build on this kernel version.

Why do I care?
- I had to patch the script in linux-headers in order to build a DKMS module.  
It's clearly a bug in the kernel-doc script (being an undeclared variable), not 
a bug in the DKMS module.  I'm keen not to have to patch 
linux-headers-<$future-version> in order to support the deployment of the DKMS 
module in my organisation.

How do I think this happened?
- looking at current kernel source:
- - "my $args" declared at 
https://github.com/torvalds/linux/blob/master/scripts/kernel-doc#L1160
- - "$members =~ s/(?:__)?DECLARE_FLEX_ARRAY\s*\($args,\s*$args\)/$1 
$2\[\]/gos;" referenced at 
https://github.com/torvalds/linux/blob/master/scripts/kernel-doc#L1172
- I suspect that the usage line was cherry-picked, but the refactor to use 
$args hadn't been merged
- i.e. something like 
https://github.com/torvalds/linux/commit/3080ea5553cc909b000d1f1d964a9041962f2c5b
 was cherry-picked, but relied on a refactor in 
https://github.com/torvalds/linux/commit/e86bdb24375a810ea7993d64ed406a803db71225

How to fix?
- the simple fix would be remove lines 1088 & 1089, i.e. revert to 
linux-headers-5.4.0-182
- add a check that this script is valid, run for future builds (given that it's 
not otherwise covered)

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2072145

Title:
  scripts/kernel-doc undeclared variable

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2072145/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to