a failing close() may potentially clobber errno causing ESRCH check fail
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c
- Domain
- operating-systems
Research direction
Start with migrate_pid_to_root_cgroup() in src/process_cpuset.c and trace how the write result and errno are used around close(). Check the relevant tests or build to verify that a write failure reporting ESRCH is treated as success even if close() also fails, while other write failures remain errors.
Written by the indexing model from the issue text.
Description
In src/process_cpuset.c function migrate_pid_to_root_cgroup() there is an errno check for ESRCH that I believe is meant to check errno for a write failure. However, the close() after the write() can potentially also fail and overwrite errno which can lead to the errno != ESRCH check failing and the function returns 0 instead of -1.
do {
w = write(fd, buf, (size_t)n);
} while (w < 0 && errno == EINTR);
close(fd);
/* ESRCH = process already gone; treat as success. */
if (w < 0 && errno != ESRCH)
return -1;
return 0;
- Dominant language
- C
- Stars
- 231
- Forks
- 33
- Avg merge
- 2m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from intel/intel-lpmd
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
intel/intel-lpmd#125 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
intel/intel-lpmd#139 ·
Maintainers usually reply within 1 day
-
Please don't move processes out of cgroupsPossibly taken @0x484558 claimed this 19 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
intel/intel-lpmd#128 · 15 comments ·
Maintainers usually reply within 1 day
-
Native IRQ affinity is not restored after the first cycle in multi-state configurationsPossibly taken @0x484558 claimed this 20 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
intel/intel-lpmd#126 ·
Maintainers usually reply within 1 day
-
MSR reads from parked cores wake the cores unnecessarilyPossibly taken @maciejwieczorretman claimed this 95 days ago. Open
intel/intel-lpmd#122 · 12 comments · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
All issues in intel/intel-lpmd
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenPrinting/cups#1751 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
compile: jv_mem_calloc assertion abort after "too many function parameters" error in a nested functionPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Policy query leaks host primary block (BSL_PrimaryBlock_deinit skipped) on two early-exit pathsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NASA-AMMOS/BSL#355 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
arancormonk/dsd-neo#660 ·
Maintainers usually reply within 1 day