Subaudit/update_pltbind.c contains unreachable code

オープン 初心者向け
#149 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
c

調査の方向性

src/client/subaudit/update_pltbind.c の、213行目付近の has_spindleint の代入と、231-232行目付近の spindleint_none のチェックから始めます。la_activity パスを追跡し、enum の代入によって cache と redirect_interceptions() の分岐に到達可能になることを確認してください。状態処理が意図された動作と一致し、到達不能コードと LD_PRELOAD の検索が繰り返される問題が解消されれば完了です。

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

説明

Priority: Low

Spindle has two interception paths: the standard LD_AUDIT path (used on x86_64 and aarch64) and the SubAudit path (OPT_SUBAUDIT) which has only remaining use case of ppc64le.

Bug: spindleint_none is an unreachable enum state.

https://github.com/llnl/Spindle/blob/0380a7cce78a4d654b839af9c191e671dab7ef14/src/client/subaudit/update_pltbind.c#L213
Sets has_spindleint to either spindleint_present or spindleint_unset, but
https://github.com/llnl/Spindle/blob/0380a7cce78a4d654b839af9c191e671dab7ef14/src/client/subaudit/update_pltbind.c#L231-L232
checks for spindleint_none.

Because has_spindleint is never set to spindleint_none, two things follow:

  1. getenv("LD_PRELOAD") + strstr is called on every la_activity event for the lifetime of the process, rather than being cached after the first check.
  2. The redirect_interceptions() call at line 231 is unreachable dead code — spindleint_none is defined in the enum and has a consumer, but is never assigned.

Fix:

has_spindleint = ld_preload && strstr(ld_preload, "libspindleint.so") ? spindleint_present : spindleint_none;

Potential follow-up:

  • Confirm whether redirect_interceptions() / spindleint_none represents intentional design or can be removed.
主要言語
C
スター
110
フォーク
35
平均マージ
1日 3時間
マージ済み PR(30日)
10

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

llnl/Spindle のほかの issue

llnl/Spindle の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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