bytecodealliance / rustix

Safe Rust bindings to POSIX-ish APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`proc_self_status` fails on second invocation

niluxv opened this issue · comments

When calling proc_self_status a twice, it errors the second time with error

Os { code: 95, kind: Uncategorized, message: "Operation not supported" }

reliably on both back-ends (testing on linux).

This seems to have regressed from rustix version 0.38.14 to 0.38.15. Maybe related to #859?

proc_self_maps and proc_self_pagemap are also affected but proc_self_fd is not. Also cross-usage is affected (e.g. first proc_self_maps and then proc_self_pagemap).

Example

{
    let fd1 = rustix::procfs::proc_self_status().expect("error 1");
    // close `fd1` again on drop
}
let fd2 = rustix::procfs::proc_self_status().expect("error 2");
// panic:
// error 2: Os { code: 95, kind: Uncategorized, message: "Operation not supported" }

And cross-usage:

{
    let fd1 = rustix::procfs::proc_self_maps().expect("error 1");
    // close `fd1` again on drop
}
let fd2 = rustix::procfs::proc_self_pagemap().expect("error 2");
// panic:
// error 2: Os { code: 95, kind: Uncategorized, message: "Operation not supported" }

Environment

  • kernel: linux 6.5.0-14-generic
  • OS: ubuntu 23.10
  • rustix versions: >= 0.38.15

This is now released in rustix 0.38.31.