Skip to content

diagnose: a line reading "blacklistamdgpu" is treated as blacklisting amdgpu #506

Open

Description

@rominf

Current behavior

line_blacklists_amdgpu strips the blacklist prefix and then trims leading whitespace, so it never requires any whitespace between the directive and the module name:

line_blacklists_amdgpu("blacklistamdgpu") -> true

modprobe does not treat that line as a directive, so nothing is blacklisted — but rocm diagnose reports amdgpu_blacklisted_in for that file.

Expected behavior

Matches the contract the function's own doc comment states, ^\s*blacklist\s+amdgpu\b, where \s+ requires at least one whitespace character.

Steps to reproduce

Put a line reading exactly blacklistamdgpu in a file under /etc/modprobe.d/ and run rocm diagnose.

Consequence

The diagnosis points at a non-cause. A user is told to un-blacklist a module that was never blacklisted, while whatever actually prevented the driver loading goes unreported.

Possible solution

Require whitespace after the directive. The doc comment one line above already states the intended grammar; the code is the side that disagrees.

Environment

  • Built from main. Pure text parsing, platform-independent.

Additional context

Found by property-testing the modprobe grammar — the property asserted that a line only reports a blacklist when it matches the documented shape. Pre-existing; unrelated to any in-flight change, which is why it is filed separately rather than folded into one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions