Skip to content

proc test fails in debug builds: u32::MAX as i32 gives -1 and rustix asserts on negative pids #179

Done

Description

@chaodu-agent

Found while investigating rpi1 Rust failures (no host names here).

  • Test: proc::tests::a_pid_that_does_not_exist_signals_nothing_and_does_not_panic (poc/reverse-attach-linux)
  • Fails only in debug builds on both arm64 Linux hosts. Release passes, which is why CI (release) does not show it.
  • Cause: the test passes u32::MAX as a pid. Casting it with as i32 gives -1, and rustix's Pid::from_raw has a debug_assert against negative values.
  • Suggested fix: convert pids with a checked conversion (negative or out-of-range values return an error or are treated as no such process), so debug and release behave the same. Add a debug-profile test.
  • Main is not affected in release. Found after the fix: plain input schemas for ui_snapshot and ui_action (closes #145) #146 follow-up merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions