Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uhyve hangs if -v (verbose flag) is not used #763

Open
n0toose opened this issue Sep 23, 2024 · 2 comments
Open

Uhyve hangs if -v (verbose flag) is not used #763

n0toose opened this issue Sep 23, 2024 · 2 comments

Comments

@n0toose
Copy link
Member

n0toose commented Sep 23, 2024

Running Uhyve directly (this does not happen with cargo run) seems to cause the process to hang indefinitely without a (graceful) exit:

$ ./target/debug/uhyve ./data/x86_64/hello_world
frequencies: 1331
CPU frequencies are not all equal
$ ./target/debug/uhyve ./data/x86_64/hello_world --pit --thp --ksm -m 2000MiB
frequencies: 2124
CPU frequencies are not all equal

However, running...

$ ./target/debug/uhyve ./data/x86_64/hello_world -v
$ ./target/debug/uhyve ./data/x86_64/rusty_demo -v

seems to work just fine. Using cargo run also works.

Affects 0222ff7, have not managed to bisect where this has seemingly stopped happening yet. Host OS is Ubuntu 24.04.1 LTS x86_64 with 6.8.0-44-generic.

@n0toose n0toose changed the title Uhyve hangs if -v is not used Uhyve hangs if -v (verbose flag) is not used Sep 23, 2024
n0toose added a commit to n0toose/uhyve that referenced this issue Sep 23, 2024
Inspired by a PEBKAC from yours truly.

Related: hermit-os#763 (hermit-os#763)
@n0toose
Copy link
Member Author

n0toose commented Sep 23, 2024

(I had set the flag to 1 on a previous operating system, forgot to do so again. I assumed that my environment must've broken things somehow - but not in the way that I expected. Perhaps this could explain why the error wasn't caught earlier.)

Possibly related:

@n0toose
Copy link
Member Author

n0toose commented Sep 23, 2024

If I'm not wrong, gdb/pwndbg "thinks" that a bunch of barrier.wait()'s have piled up and are keeping the program from exiting.

log.txt

A working (borderline nonsensical) theory is that the kernel tries to inform Uhyve that it should shut down, but it doesn't (why?/how? probably wrong), therefore, it halts indefinitely:

https://github.com/hermit-os/kernel/blob/e608471f42d7b79f871fbe6d60a8b30e50043aef/src/syscalls/interfaces/uhyve.rs#L161-L169

Therefore, the Vcpu never halts, the VM never exits, and Uhyve won't get stopped.

process::exit(run_uhyve())


This also applies to the WIP v2 version of uhyve-interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant