-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: Invalid heap pointer error in init() on Windows only using Go 1.4.2 #10026
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
probably related to issue #9125. |
Interesting. Also, I forgot to add that this doesn't reproduce with Go 1.3.3 in the same Windows environment. |
Since GC found a value of 0x9 in a field it thinks should be a pointer, it The initial goroutine stack size seems to have decreased between 1.3.3 and On Fri, Feb 27, 2015 at 11:33 AM, Leo Kim notifications@github.com wrote:
|
Is there a way to increase stack size easily (e.g. runtime flag, compile-time setting)? Just curious if @FrankReh's intuition is correct, if it's worth it. |
I don't understand how the size of the default goroutine stack could have
affect this.
Passing a pointer to C will make that escape, so it shouldn't live on
stack, unless you
pass a pointer as uintptr to C code, which is already broken code.
|
Digging a little further, I think this error comes from one of the 3rd party libraries being initted - gowin32. The use of this function is the likely culprit: I don't know what |
That MAKEINTRESOURCE function is definitely not OK on Go 1.4+.
Essentially, it stores a uint16 value as a pointer to uint16, which mostly
probably
is an invalid pointer to the GC.
|
My understanding from talking to someone working on gowin32: There's an analog macro in the Win32 API, gowin32 will have to break how its |
@leothekim your understanding is correct. gowin32 authors have to change their code if they wont it to work with current (ad future) versions of Go. |
We are seeing this error on Windows 2008r2 64-bit when running our tests:
The error points to a regexp in a 3rd-party dep, but AFAICT that's a red-herring. I'm able to reproduce the same error with a small number of files found here: https://github.com/leothekim/Invalid-Heap-Pointer-Go-1.4.2-Windows-amd64. The same code does not error on Mac OS X. Setting
GODEBUG=invalidptr=0
gets rid of the error on Windows.Curiously, none of the files depends on each other - they just live in the same package. Even more curiously, the error disappears if I removing one of them and run
go test
or the built executable. This suggests something to do with importing the 3rd-party deps impacting how init() methods are evaluating, likely with allocating more memory for somethingorotherhandwave.This also seems related to a number of issues I've seen here with a similar error, though I'm a complete golang n00b, and even less of a Windows person, so I'm not quite sure how to proceed. Still, I hope providing some code that reproduces this is helpful in getting to the bottom of this.
The text was updated successfully, but these errors were encountered: