-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: TestCallbackPanic internal lockOSThread error #47382
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
Comments
Hi, I think this may be normal?
asmcgocall will switch to g0 ? Sorry for the processing in panic in g0. I'm not sure. But since there is no defer unlockOSThread(), when panic returns to the defer of TestCallbackPanic, unlockOSThread is not executed. Further, runtime.LockedOSThread() will return true and t.Fatal will be triggered func lockedOSThread() bool {
gp := getg()
return gp.lockedm != 0 && gp.m.lockedg != 0
} defer func() {
s := recover()
……
if !runtime.LockedOSThread() {
t.Fatal("lost lock on OS thread after panic")
}
}() and then
The check was triggered again, resulting in a second print if _g_.m.lockedInt != 0 {
print("invalid m->lockedInt = ", _g_.m.lockedInt, "\n")
throw("internal lockOSThread error")
} Before the modification, due to the existence of defer, unlockOSThread will be executed after panic But according to CL316650, maybe this is acceptable? |
@WangLeonard Thanks for the investigation. Yes, your analysis matches what I originally wanted to point out. The CL 336550 would be nice to unify all syscalls into |
Looks like nothing needs to do here. See a great explanation here. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
While debugging CL 336550, a strage test case faulure because of a defer statement.
The syscall_Syscall6:
go/src/runtime/syscall_windows.go
Lines 483 to 495 in 0914646
Change as follow:
A similar CL 316650 may have a similar issue but does observe any panic yet.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: