Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

chcpu: a large cpu-list range runs for hours

オープン
#620 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 7 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
rust

調査の方向性

chcpu の CPU リスト処理のエントリポイントから始め、issue に記載されている大きな範囲での動作を再現してください。issue ではソースファイルもテストも指定されておらず、許容される上限値も未解決です。完了の条件は、--enable と --disable の両方で、過大な範囲が、何時間もの反復や過剰な診断出力を伴わずに速やかに拒否されることです。

索引モデルが issue の本文から書いたものです。

説明

chcpu walks every index in a cpu-list range, and the range is bounded only by the integer type, so it is easy to write one that will not finish. On main (7476fce), x86_64, 24 CPUs online:

$ time chcpu --enable 0-400000 >/dev/null 2>&1
real    0m1.658s

$ timeout 60 chcpu --enable 0-4294967295 >/dev/null 2>&1; echo $?
124

That is roughly 241,000 indices per second, so 0-4294967295 needs about five hours.

It is also loud. Every nonexistent index gets its own line on stderr; for the example above, redirected to a file, that is about 130 GB.

--disable takes the same path, and run as root it will offline the CPUs that do exist before it starts working through the ones that do not.

util-linux 2.42.2 rejects the same input immediately:

$ chcpu --enable 0-4294967295
chcpu: invalid CPU number in CPU list: 0-4294967295
$ echo $?
1

I have not worked out what a sensible upper bound would be. There is more than one defensible choice, so it seemed better to raise this than to suggest one. Happy to implement whichever bound gets settled on.

主要言語
Rust
スター
221
フォーク
60
平均マージ
2日 19時間
マージ済み PR(30日)
10

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uutils/util-linux のほかの issue

uutils/util-linux の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。