-
Notifications
You must be signed in to change notification settings - Fork 611
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
(Code-Hex/vz/v3.changeStateOnObserver
)
#1381
Comments
Looks like this happens only on stopping a new instance |
Will check this out |
Debugged this, this is from upstream only. Will raise a ticket in vz. I tried to do some workaround but none worked. |
Yes, looks like that for me too. It also hangs for almost another 3 minutes after the After restarting the instance, I can shut it down normally without a panic, but still get an error from DHCP:
|
|
@dmigwi This issue is about macOS 13 (Ventura) because there is no Virtualization framework support in Lima for earlier macOS version (we only support EFI boot, which was added in Ventura). So if your problem with the |
@jandubois Thanks for letting me know that is issue is not yet resolved since Ventura is the latest Mac Os release. A weird thing that happened when I experienced that crash on my product (desktop app) is my mac was weirdly hot and the fan was humming way louder than usual. This led me to believe something in the background or o.s. level was pushing my CPU to its extreme limit. I tend to believe the golang GC kicked in to clean up memory space it thought wasn't needed anymore since space was kinda being stretched thin then. The communication between golang and cgo is via memory locations inform of integers, so when cgo attempted to resolve the memory location that turned out to reused by something else that crash happened then. Its all documented here: https://golang.design/research/cgo-handle/ My initial hypothesis is that the crash happens when the garbage collector runs and cleans up memory locations its not expected to mess with. I could be wrong on this! |
@dmigwi Please report your issue on the https://github.com/Code-Hex/vz repo if you have additional information to reproduce the problem. This repo is purely about Lima, so we will not be able to help you with your project here, since you seem to be experiencing a separate issue. |
Issue #, if available: *Description of changes:* - always force stop when using Virtualization.framework, potential workaround for lima-vm/lima#1381 (needs more testing) *Testing done:* - local testing - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Justin Alvarez <[email protected]>
Still doesn't seem fixed (macOS 13.3.1, Intel) $ limactl stop vz
INFO[0000] Sending SIGINT to hostagent process 33283
INFO[0000] Waiting for the host agent and the driver processes to shut down
INFO[0000] [hostagent] 2023/04/15 22:39:32 tcpproxy: for incoming conn 127.0.0.1:60602, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: no route to host
INFO[0000] [hostagent] 2023/04/15 22:39:42 tcpproxy: for incoming conn 127.0.0.1:60612, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: connection was refused
INFO[0000] [hostagent] Received SIGINT, shutting down the host agent
INFO[0000] [hostagent] Shutting down the host agent
INFO[0000] [hostagent] Stopping forwarding "/run/lima-guestagent.sock" (guest) to "/Users/suda/.lima/vz/ga.sock" (host)
INFO[0000] [hostagent] Shutting down VZ
ERRO[0000] [hostagent] dhcp: unhandled message type: RELEASE
INFO[0001] [hostagent] panic: runtime/cgo: misuse of an invalid Handle
INFO[0001] [hostagent] goroutine 17 [running, locked to thread]:
INFO[0001] [hostagent] runtime/cgo.Handle.Value(...)
INFO[0001] [hostagent] /usr/local/Cellar/go/1.20.3/libexec/src/runtime/cgo/handle.go:124
INFO[0001] [hostagent] github.com/Code-Hex/vz/v3.changeStateOnObserver(0x0, 0xc000006801?)
INFO[0001] [hostagent] /Users/suda/gopath/pkg/mod/github.com/!code-!hex/vz/[email protected]/virtualization.go:160 +0xb4 |
@AkihiroSuda I tried with multiple create stop and start stop use cases :( Didn't face the issue. |
Yes
Probably because this is a race condition |
This is still happening on v0.15.1. A user reported it abiosoft/colima#691 (comment) and I am also able to reproduce it. |
I can confirm that it is still happening for me:
Version Info:
I do see that there's a problem identified in |
version: e939454
The text was updated successfully, but these errors were encountered: