The code produces an illegal call to `statx()`.
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
I have no idea what is doing it, but coreutils produces an illegal call to statx() shortly after startup (so all commands are affected).
Examples:
[gmllaptop]: strace -f date 2>&1 | grep "NULL.*AT_STATX_SYNC_AS_STAT"
statx(0, NULL, AT_STATX_SYNC_AS_STAT, STATX_ALL, NULL) = -1 EFAULT (Bad address)
[gmllaptop]: strace -f ls 2>&1 | grep "NULL.*AT_STATX_SYNC_AS_STAT"
statx(0, NULL, AT_STATX_SYNC_AS_STAT, STATX_ALL, NULL) = -1 EFAULT (Bad address)
As the man page for statx() says:
EFAULT pathname or statxbuf is NULL or points to a location outside the
process's accessible address space.
You shouldn't be calling statx() with a second arg of NULL.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with strace on date and ls, and inspect the statx() calls matching NULL and AT_STATX_SYNC_AS_STAT. Trace the shared startup path that produces the call, then verify that both commands no longer issue statx() with a NULL pathname and that their normal behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100