-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
panic: runtime/cgo: misuse of an invalid Handle #119
Comments
@ryancurrah Thanks! |
mmm, minimal reproduction seems hard... |
I can try to reproduce as well. How are you doing it? |
I'm trying to make a minimal reproduction like below in issues_test.go func TestIssue119(t *testing.T) {
container := newVirtualizationMachine(t,
func(vmc *vz.VirtualMachineConfiguration) error {
return setupConsoleConfig(vmc)
},
)
sshSession := container.NewSession(t)
defer sshSession.Close()
vm := container.VirtualMachine
if got := vm.State(); vz.VirtualMachineStateRunning != got {
container.Close()
t.Fatalf("want state %v but got %v", vz.VirtualMachineStateRunning, got)
}
done := make(chan struct{})
go func() {
defer close(done)
for {
select {
case newState := <-vm.StateChangedNotify():
if newState == vz.VirtualMachineStateStopped {
return
}
}
}
}()
sshSession.Run("poweroff")
for i := 0; i < 10; i++ {
runtime.GC()
time.Sleep(time.Second)
}
<-done
} |
OK, I can make a reproduction! Thanks. |
Nice! I just opened my laptop to see if I could try as well. |
@ryancurrah Oops, if you look closely at your stack trace, you see an error in Maybe, the reason is happened Go's Re-create the reproduction code 😢 |
It could be reproduced 7d2aa2f |
@ryancurrah I've released v3.0.4 |
@Code-Hex you're the best. Thank you! |
@Code-Hex
|
Describe the bug
This issue relates to lima-vm/lima#1299. When the VM is unresponsive, stopping it causes a panic.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Stop to succeed or error out but not panic.
Screenshots
lima.ha.stderr.log
Environment that you use to compile (please complete the following information):
Lima
v0.14.2
github.com/Code-Hex/vz/v3
v3.0.2
14.1
macos-12
arm64
go1.19
Additional context
Where the panic happened this comment is in the
vz
library.https://github.com/Code-Hex/vz/blob/main/virtualization.go#L152-L154
The text was updated successfully, but these errors were encountered: