-
-
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
Occasional runtime/cgo: misuse of an invalid Handle
panic when using vsock
#131
Comments
Using `make test/run TARGET=TestRunIssue131`, I can reproduce Code-Hex#131 reliably on my M1: Run socat as vsock ssh proxyserver (port=2222) Login with root and no password. localhost login: [ 3.053740] random: crng init done finalizing handler 0x140000a2260 value: 0x100a3b020 panic: runtime/cgo: misuse of an invalid Handle goroutine 17 [running, locked to thread]: runtime/cgo.Handle.Value(...) /usr/local/go/src/runtime/cgo/handle.go:124 github.com/Code-Hex/vz/v3.shouldAcceptNewConnectionHandler(0x14000102000?, 0x0?, 0x14000000001?) /Users/teuf/dev/vz/socket.go:235 +0x11c 2023/07/07 13:49:05 exit status 2 exit status 1 FAIL github.com/Code-Hex/vz/v3 5.220s testing: warning: no tests to run PASS ok github.com/Code-Hex/vz/v3/internal/progress 0.351s [no tests to run] FAIL make: *** [test/run] Error 1
I've managed to reproduce it in this branch: https://github.com/cfergeau/vz/tree/issue_131:
|
Using `make test/run TARGET=TestRunIssue131`, I can reproduce Code-Hex#131 reliably on my M1: Run socat as vsock ssh proxyserver (port=2222) Login with root and no password. localhost login: [ 3.053740] random: crng init done finalizing handler 0x140000a2260 value: 0x100a3b020 panic: runtime/cgo: misuse of an invalid Handle goroutine 17 [running, locked to thread]: runtime/cgo.Handle.Value(...) /usr/local/go/src/runtime/cgo/handle.go:124 github.com/Code-Hex/vz/v3.shouldAcceptNewConnectionHandler(0x14000102000?, 0x0?, 0x14000000001?) /Users/teuf/dev/vz/socket.go:235 +0x11c 2023/07/07 13:49:05 exit status 2 exit status 1 FAIL github.com/Code-Hex/vz/v3 5.220s testing: warning: no tests to run PASS ok github.com/Code-Hex/vz/v3/internal/progress 0.351s [no tests to run] FAIL make: *** [test/run] Error 1
I also see this, it seems like it's timing dependent. I think the problem here is how I think a better way to handle this is to pass the I've made the changes above locally, and it makes the test created by @cfergeau pass (well, actually just time out after 5 minutes of running, but no longer crash with the invalid handle error) I can create a PR with my changes if this seems like a good change, please let me know @Code-Hex |
My changes: main...mpoindexter:vz:fix-invalid-handle-main |
@cfergeau Thanks to create this issue! and I'm sorry for the late. Good catch @mpoindexter !! |
Great to see this fixed! Do you want a PR to add the test case from https://github.com/cfergeau/vz/tree/issue_131 to this repo to prevent future regressions? |
I did not add that test case to my PR since with the fix in place it runs
for a very long time and makes the test suite time out with the fixed code.
I could not think of a suitable thing to use as a unit test since the
behavior appeared to be timing dependent.
…On Wed, Aug 16, 2023 at 1:47 AM Christophe Fergeau ***@***.***> wrote:
Great to see this fixed! Do you want a PR to add the test case from
https://github.com/cfergeau/vz/tree/issue_131 to this repo to prevent
future regressions?
—
Reply to this email directly, view it on GitHub
<#131 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMNCGLRSVRBP6NOCZXU7C3XVSCITANCNFSM6AAAAAAZ4PZFVY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The fix for Code-Hex/vz#131 is not in a tagged Code-Hex/vz release, but this can trigger crashes in vfkit. This commit updates Code-Hex/vz to latest git main to get this fix.
The fix for Code-Hex/vz#131 is not in a tagged Code-Hex/vz release, but this can trigger crashes in vfkit. This commit updates Code-Hex/vz to latest git main to get this fix.
Describe the bug
When using vsock to connect from the VM to the host, I sometimes get a panic:
To Reproduce
I'm afraid I don't have a clear reproducer.
Expected behavior
No panic
Screenshots
If applicable, add screenshots to help explain your problem.
Environment that you use to compile (please complete the following information):
xcodebuild -version | pbcopy
]sw_vers | pbcopy
]arm64
]go version | pbcopy
]Additional context
The fix might be similar to some of the recent fixes in the v3 branch (?)
The text was updated successfully, but these errors were encountered: