scripts/kernel-doc crashes (undeclared variable)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
linux-kernel-headers (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
/usr/src/
To reproduce:
- install linux-headers-
- run /usr/src/
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/
Global symbol "$args" requires explicit package name (did you forget to declare "my $args"?) at /usr/src/
Execution of /usr/src/
```
Details about the syntax error:
- this is a regression since package linux-headers-
- 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-
How do I think this happened?
- looking at current kernel source:
- - "my $args" declared at https:/
- - "$members =~ s/(?:__
- I suspect that the usage line was cherry-picked, but the refactor to use $args hadn't been merged
- i.e. something like https:/
How to fix?
- the simple fix would be remove lines 1088 & 1089, i.e. revert to linux-headers-
- add a check that this script is valid, run for future builds (given that it's not otherwise covered)
Also affects kernel 5.4.0-189