resource-agents 1:4.16.0-3ubuntu1 autopkgtests fail on questing [dd direct write flag]
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| rust-coreutils |
New
|
Unknown
|
|||
| coreutils-from (Ubuntu) |
Won't Fix
|
Critical
|
Unassigned | ||
| resource-agents (Ubuntu) |
Triaged
|
High
|
Unassigned | ||
| rust-coreutils (Ubuntu) |
Triaged
|
Critical
|
Unassigned | ||
Bug Description
dep8 tests for resource-agents are failing, blocking several packages:
https:/
1165s Starting '[33mFilesyste
1165s Setting agent environment: export OCF_RESKEY_
1165s Setting agent environment: export OCF_RESKEY_
1165s Setting agent environment: export OCF_RESKEY_
1167s Running agent: ./Filesystem start
1168s Setting agent environment: export OCF_CHECK_LEVEL=10
1168s Running agent: ./Filesystem monitor
1169s Checking return value: [31mFAILED[0m. The return value '[34mOCF_
1169s cat: /tmp/.ocft_runlog: No such file or directory (os error 2)
| description: | updated |
| tags: | added: update-excuse |
| tags: | added: server-todo |
| Changed in resource-agents (Ubuntu): | |
| assignee: | nobody → Renan Rodrigo (rr) |
| Changed in coreutils-from (Ubuntu): | |
| status: | New → Confirmed |
| importance: | Undecided → Critical |
| milestone: | none → ubuntu-25.10 |
| summary: |
- resource-agents 1:4.16.0-3ubuntu1 autopkgtests fail on questing + resource-agents 1:4.16.0-3ubuntu1 autopkgtests fail on questing [dd + direct write flag] |
| Changed in coreutils-from (Ubuntu): | |
| status: | Confirmed → Won't Fix |
| Changed in rust-coreutils (Ubuntu): | |
| status: | New → Triaged |
| Changed in rust-coreutils: | |
| status: | Unknown → New |
Looking at the error, the problem lies in the Filesystem agent. There are some monitoring functions being tested, and the one which fails is a check which reads the starting bytes of a device.
This is done using `dd`. This is the exact command executed in the test:
dd if=/dev/loop0 iflag=direct bs=4k count=1 2>&1 >/dev/null
The first smell is: this passes with `coreutils- from-gnu` , but fails with `coreutils- from-uutils` with:
`dd: IO error: Invalid input`
strace shows that dd can't read from the FD:
`read(3, 0x5d3c457b94a0, 4096) = -1 EINVAL (Invalid argument)`
It seems the rust coreutils can't deal with the `direct` flag appropriately [1]. The implementation of O_DIRECT seems different than the one in the GNU version - and it seems to lack buffer alignment, which is needed for direct reads.
In the resource-agents side, a workaround would be removing the iflag from the `dd` call. However, the commit which introduces the flag (tens of years ago) states: "Reading from the device in O_DIRECT mode is imperative to bypass caches.", so that's not acceptable for the monitoring functionality.
So this needs to be looked at in the coreutils side. I am adding bug tasks.
For the package migrations blocked on this bug, I suggest adding hints so they get in. As a last resort, migration-reference is also a workaround for now.
Mind that many other packages (or at least package tests) also call/depend on the `direct` iflag, and are potentially affected by this coreutils bug.
---
Steps to reproduce:
1. Launch a questing VM with coreutils- from-uutils
2. Create a file which will be mapped to loop0:
$ sudo dd if=/dev/zero of=/example bs=1 count=0 seek=16M
Make sure to not create it in a tmpfs, as this is a different scenario - also not supported in the rust coreutils[1]
3. Map loop0 to the file:
$ sudo losetup /dev/loop0 /example
4. Try to read the data without using the `direct` iflag, see it works:
sudo dd if=/dev/loop0 bs=4k count=1
5. Try to read the data using the `direct` iflag, see it fails:
sudo dd if=/dev/loop0 iflag=direct bs=4k count=1
6. Launch a questing VM with coreutils-from-gnu
7. Repeat steps 2 to 4
8. Repeat step 5, but this time it works
--- /users. rust-lang. org/t/how- does-rust- use-directio/ 93210
[1] https:/