bytecodealliance / userfaultfd-rs

Rust bindings for the Linux userfaultfd functionality
Apache License 2.0
43 stars 22 forks source link

Fix failure in Github action #58

Closed bchalios closed 1 year ago

bchalios commented 1 year ago

It looks as if when we opened #56 ubuntu-latest Github Actions runner image did not ship a kernel that was >= 6.1. So, the code that created the userfault file descriptor did not use the ioctl to /dev/userfaultfd path and it always succeeded (using the userfaultfd syscall).

It seems that at some point afterwards ubuntu-latest came with an update kernel (6.2) and it triggered the /dev/userfaultfd path. As a result, the test fails on main and subsequent PRs (#57) because the Github actions job runs as the user runner which doesn't have access to read/write /dev/userfaultfd.

This PR fixes this situation doing two things:

  1. It runs the tests both in ubuntu-latest, with kernel 6.2 and ubuntu-20.04, with kernel 5.15 to exercise both paths.
  2. In the case of ubuntu-latest, we add an extra step that gives to user runner read/write access to /dev/userfaultfd file.
bchalios commented 1 year ago

There's a weird dependency blocking this from merging. I guess it's about what steps need to pass before allowing it to merge. There's not a build job any more because of the matrix. But I can't fix that, I don't seem to have access to this part of the settings.

pchickey commented 1 year ago

i turned branch protection off temporarily, I'll fix it for real when I have more time later today.