[Bug 2047450] Re: tail emits no output for sysfs files when using large page kernels
dann frazier
2047450 at bugs.launchpad.net
Sat Jan 20 21:35:06 UTC 2024
= jammy verification =
ubuntu at hinyari:~$ getconf PAGESIZE
65536
ubuntu at hinyari:~$ tail /sys/kernel/profiling
ubuntu at hinyari:~$ sudo apt install coreutils -t jammy-proposed
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be upgraded:
coreutils
1 upgraded, 0 newly installed, 0 to remove and 42 not upgraded.
Need to get 1397 kB of archives.
After this operation, 8192 B of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy-proposed/main arm64 coreutils arm64 8.32-4.1ubuntu1.1 [1397 kB]
Fetched 1397 kB in 1s (2153 kB/s)
(Reading database ... 83707 files and directories currently installed.)
Preparing to unpack .../coreutils_8.32-4.1ubuntu1.1_arm64.deb ...
Unpacking coreutils (8.32-4.1ubuntu1.1) over (8.32-4.1ubuntu1) ...
Setting up coreutils (8.32-4.1ubuntu1.1) ...
Processing triggers for install-info (6.8-4build1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning candidates...
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
Failed to check for processor microcode upgrades.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
ubuntu at hinyari:~$ tail /sys/kernel/profiling
0
** Tags removed: verification-needed verification-needed-jammy
** Tags added: verification-done verification-done-jammy
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/2047450
Title:
tail emits no output for sysfs files when using large page kernels
Status in coreutils package in Ubuntu:
Fix Released
Status in coreutils source package in Jammy:
Fix Committed
Status in coreutils source package in Lunar:
Won't Fix
Status in coreutils source package in Mantic:
Fix Committed
Status in coreutils source package in Noble:
Fix Released
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/profiling file, if it exists. That case would fail with an unfixed coreutils package as shown below:
= When booted on a 4K kernel =
ubuntu at gunyolk:~$ tail /sys/kernel/profiling
0
= When booted on a 64K kernel =
ubuntu at gunyolk:~$ tail /sys/kernel/profiling
ubuntu at 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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2047450/+subscriptions
More information about the foundations-bugs
mailing list