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

Prevent hypercall handling from panicking #631

Open
jounathaen opened this issue Jan 31, 2024 · 4 comments
Open

Prevent hypercall handling from panicking #631

jounathaen opened this issue Jan 31, 2024 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@jounathaen
Copy link
Member

A panic in the hypercall causes uhyve to hang indefinitely, as only the specific CPU thread will panic, and all other threads are still waiting for the barrier in

barrier.wait();
to pass, which never happens as the thread that could activate it has paniced. We should remove any unwrap() or expect() in the code that is called by run.

@charlottestinson
Copy link
Contributor

Hello!

My partners and I are a team of three students currently studying Virtualization at the University of Texas at Austin. Part of our coursework is contributing to open-source repos like this. We are wondering if this issue is still open and available for contribution? If so, we would love to take a chance to work on this because it seems very interesting to us! If approved, we may be contributing to some other issues as well.

Thank you so much!

@jounathaen
Copy link
Member Author

Sure, this would be much appreciated. If you need any help/advice, just post here. 🙂

@mkroening
Copy link
Member

We should remove any unwrap() or expect() in the code that is called by run.

While that would be nice, I don't think we can and should remove all possible panics from the vCPUs comprehensively. I think it would be better to catch_unwind at a high level to then exit the application to resolve this issue. Better error handling is always good, of course, but that does not always mean less panicking, in my opinion.

@jounathaen
Copy link
Member Author

jounathaen commented Apr 7, 2024

True, but I think (without deeper looking into it) we actually have three cases here:

  • Simple to fix unwraps that can be mitigated
  • Errors in the hypervisor, which probably would be solved best by catch_unwind
  • Errors resulting from erroneous hypercalls, that should be reported back to the kernel to be handled there. (this likely requires changes in uhyve-interface and the kernel)

So I think if any of these cases is at least partially tackled by @charlottestinson, it would be an improvement.

@jounathaen jounathaen added the help wanted Extra attention is needed label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants