asterinas / asterinas

Asterinas is a secure, fast, and general-purpose OS kernel, written in Rust and providing Linux-compatible ABI.
https://asterinas.github.io/
Other
846 stars 87 forks source link

Silently failed ktest in OSTD: untracked_map_unmap #1399

Open junyang-zh opened 4 days ago

junyang-zh commented 4 days ago

Describe the bug

https://github.com/asterinas/asterinas/actions/runs/11101937778/job/30840638910#step:6:634

The ktest test_untracked_map_unmap failed, but CI doesn't notice it. The failure is reproducible locally.

To Reproduce

cd ostd && cargo osdk test test_untracked_map_unmap
junyang-zh commented 4 days ago

After bisection, I found the PR introducing it: https://github.com/asterinas/asterinas/pull/1387

It did fail. https://github.com/asterinas/asterinas/actions/runs/11091495929/job/30815674577#step:6:586 But the CI didn't report error for it.

junyang-zh commented 4 days ago

Oh I get it. The page table node as a DynPage would be considered as tracked. when dropping a untracked intermediate page table node it regard untracked mapping as tracked and tries to operate on the physical page. So #1387 indeed fails the test.

The failure path is not likely to appear in normal execution before the introduction of untracked KVA.

1372 should fix it in an elegant way.

EDIT: I think that there's no quick fix. #1372 is the only way.