You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let elf = fs::read(&kernel_path)?;let object =
KernelObject::parse(&elf).map_err(...)?;
However, I asked around (after having worked on hermit-os/uhyve#725) as to how I could prevent the "use-after-free" warning that prevented me from storing the object object in the UhyveVm struct - and the problem seems to be that we depend on references that get "destroyed" soon afterwards:
The text was updated successfully, but these errors were encountered:
n0toose
changed the title
Implement FromStr for KernelObject
Implement FromStr / something that allows storing byte slices / yoke for KernelObject
Jul 24, 2024
We can keep this issue open for the future, but currently there is nothing we can do. I'd suggest keeping only the Vec around and reparsing it if necessary. The overhead should not be too bad.
In Uhyve, parsing ahead of time should also become unnecessary once C applications become relocatable.
Currently,
KernelObject
could be used like this:However, I asked around (after having worked on hermit-os/uhyve#725) as to how I could prevent the "use-after-free" warning that prevented me from storing the
object
object in the UhyveVm struct - and the problem seems to be that we depend on references that get "destroyed" soon afterwards:hermit-entry/src/elf.rs
Lines 32 to 35 in 5c87198
A potential solution could be implementing something similar to the following trait: https://doc.rust-lang.org/std/str/trait.FromStr.html
The text was updated successfully, but these errors were encountered: