Repository navigation
CPUCache (Linux): skips offline CPUs - #2737
Merged
CarterLi merged 2 commits intoNov 20, 2026
Merged
Conversation
The kernel removes `cpuX/cache/` when a CPU goes offline, so opendir() failed for that CPU and the whole module returned an error. Skip CPUs whose `online` file reads 0; a CPU without an `online` file (usually cpu0) is treated as online, as before. Fixes fastfetch-cli#2736 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CarterLi
reviewed
Nov 19, 2026
| } | ||
|
|
||
| const char* error = parseCpuCache(&path, result, &buffer, &added); | ||
| if (error) { |
Member
There was a problem hiding this comment.
Just remove the early return, I think.
Instead of checking `cpuX/online`, drop the early return: a CPU without a readable `cache/` directory, such as an offline one, is skipped rather than failing the module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Done. I removed the I re-tested with a copy of
One side effect: if no CPU's cache can be read at all, the module now prints nothing instead of an error. I can return an error in that case if you'd prefer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the Linux CPU Cache module failing entirely when any CPU is offline. The kernel removes
cpuX/cache/for an offline CPU, soopendir()failed and the module returned an error instead of the caches of the online CPUs.Related issue (required for new logos for new distros)
Fixes #2736
Changes
src/detection/cpucache/cpucache_linux.c: drop the early return in the CPU loop, as suggested in review. A CPU whosecache/can't be read, such as an offline one, is skipped with anFF_DEBUGline instead of failing the module.CHANGELOG.md: Bugfixes entry under Unreleased.Screenshots
With
cpu3offline (cpu3/online=0, nocpu3/cache/):Checklist
unshare -rmwith a copy of/sys/devices/system/cpubind-mounted over the real one, withcpu3offline as the kernel leaves it.cpu3online gives identical output before and after the fix, as does the real sysfs.ctestpasses 21/21.I used an AI coding assistant (Claude) to help find this bug and prepare the fix, and I reviewed and tested it myself.
🤖 Generated with Claude Code