tail emits no output for sysfs files when using large page kernels
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
Fix Released
|
Undecided
|
dann frazier | ||
Jammy |
Fix Released
|
Undecided
|
dann frazier | ||
Lunar |
Won't Fix
|
Undecided
|
dann frazier | ||
Mantic |
Fix Released
|
Undecided
|
dann frazier | ||
Noble |
Fix Released
|
Undecided
|
dann frazier |
Bug Description
[Impact]
Ubuntu provides 64K page size kernels for ppc64el (always) and arm64 (optional -64k flavors). When booted on 64K kernels, tail emits no output when tailing a sysfs file. The difference in behavior can be a source for bugs in scripts that use tail, and general user confusion.
[Test Plan]
The upstream fix includes a test case that tails the /sys/kernel/
= When booted on a 4K kernel =
ubuntu@gunyolk:~$ tail /sys/kernel/
0
= When booted on a 64K kernel =
ubuntu@gunyolk:~$ tail /sys/kernel/
ubuntu@gunyolk:~$
Since the upstream test cases are executed at build time, the existing tests and this new test will be used to regression test behavior. This should cover both 4K (!ppc64el) and 64K (ppc64el) cases. We should also do a manual verification on arm64 w/ the 64K kernel since that case is not covered by our builders.
[Where Problems Could Occur]
The biggest risk for a regression I see is due to the side-effect of the fix now allocating a dynamic buffer instead of the stack. An error in logic there could cause a crash or a memory leak in scenarios undetected during testing. I used valgrind when developing the fix to derisk the memory leak scenario.
Changed in coreutils (Ubuntu): | |
assignee: | nobody → dann frazier (dannf) |
Changed in coreutils (Ubuntu Noble): | |
status: | New → In Progress |
Changed in coreutils (Ubuntu Jammy): | |
status: | New → Confirmed |
Changed in coreutils (Ubuntu Lunar): | |
status: | New → Confirmed |
Changed in coreutils (Ubuntu Mantic): | |
status: | New → Confirmed |
assignee: | nobody → dann frazier (dannf) |
Changed in coreutils (Ubuntu Lunar): | |
assignee: | nobody → dann frazier (dannf) |
Changed in coreutils (Ubuntu Jammy): | |
assignee: | nobody → dann frazier (dannf) |
Changed in coreutils (Ubuntu Mantic): | |
status: | Confirmed → In Progress |
Changed in coreutils (Ubuntu Lunar): | |
status: | Confirmed → In Progress |
Changed in coreutils (Ubuntu Jammy): | |
status: | Confirmed → In Progress |
This bug was fixed in the package coreutils - 9.4-2ubuntu2
---------------
coreutils (9.4-2ubuntu2) noble; urgency=medium
* d/p/tail- fix-tailing- sysfs-files- where-PAGE_ SIZE-BUFSIZ. patch:
Fix tailing of sysfs files on systems using a 64K page size.
(LP: #2047450)
-- dann frazier <email address hidden> Tue, 26 Dec 2023 11:25:09 -0700