-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: bad pointer! #8848
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
Labels
Milestone
Comments
The variable is converted ti pid later: pid := int(uintptr(unsafe.Pointer(o))) Also now I am puzzled with this code: var o *syscall.Overlapped for { err := syscall.GetQueuedCompletionStatus(iocp, &code, &key, &o, syscall.INFINITE) Why do we pass **syscall.Overlapped to GQCS? Shouldn't it be *syscall.Overlapped? |
http://msdn.microsoft.com/en-gb/library/windows/desktop/aa364986(v=vs.85).aspx suggests that it's meant as a pointer reference. |
This should do it. right? There's still the unfortunate situation of GQCS being able to write both a pointer and a value to memory. Could/should we change the overlapped arg to be *uintptr? diff -r 17ba03832124 driver/driver_windows.go --- a/driver/driver_windows.go Sat Sep 13 09:10:35 2014 -0700 +++ b/driver/driver_windows.go Thu Oct 02 13:47:15 2014 +0100 @@ -94,9 +94,10 @@ // Read Job notifications about new "child" processes and collect them in childProcesses. go func() { var code, key uint32 - var o *syscall.Overlapped + var o uintptr + oa := (**syscall.Overlapped)(unsafe.Pointer(&o)) for { - err := syscall.GetQueuedCompletionStatus(iocp, &code, &key, &o, syscall.INFINITE) + err := syscall.GetQueuedCompletionStatus(iocp, &code, &key, oa, syscall.INFINITE) if err != nil { log.Printf("GetQueuedCompletionStatus failed: %v", err) return @@ -105,7 +106,7 @@ panic("Invalid GetQueuedCompletionStatus key parameter") } if code == JOB_OBJECT_MSG_NEW_PROCESS { - pid := int(uintptr(unsafe.Pointer(o))) + pid := int(o) if pid == syscall.Getpid() { continue } |
CL https://golang.org/cl/152860043 mentions this issue. |
omunroe-com
pushed a commit
to omunroe-com/gogoobnchmrks
that referenced
this issue
Nov 12, 2018
Fixes golang/go#8848. LGTM=daniel.morsing, alex.brainman R=alex.brainman, daniel.morsing CC=golang-codereviews https://golang.org/cl/152860043
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: