-
Notifications
You must be signed in to change notification settings - Fork 16
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 with"fatal error: invalid pointer found on stack" #4
Comments
I am using Goland. It happens when I click the "Run" button or just |
This issue is handled over at logrus issue sirupsen/logrus#1112 . Thanks for the feedback. I did not realize that this issue was that common until now, sry for that. |
Fix is available in v1.0.3 |
Hi, I work on the Go compiler. In Go 1.14, I added a new compiler option (disabled by default) for detecting misuse of unsafe.Pointer, which I think could have caught this or at least identified the origin of the mistake easier. However, I don't have a Windows computer to easily confirm that hypothesis. Would someone mind testing the unfixed code (i.e., before 71a52a1) with Thanks. |
@mdempsky I did the requested test but did not see a difference: The resulting binary is still crashing. go1.14.2 windows/amd64 Can you point me to the documentation why this is a "misuse of unsafe.Pointer"? I have other projects too and never thought of |
@fkollmann Thanks. Can you run the resulting program and copy/paste the error message here? checkptr is an additional runtime instrumentation feature, like the race detector or memory sanitizer. It doesn't report errors at build time. Sorry for not being clearer about that. The runtime expects any value stored in unsafe.Pointer to be a valid pointer. If you convert an arbitrary integer value (e.g., a Windows handle), it can cause the GC to misbehave. That's why the package is named "unsafe". :) For more details on allowed uses of unsafe.Pointer, please see: https://golang.org/pkg/unsafe/#Pointer |
@mdempsky looks like it works?
Full stack: https://gist.github.com/fkollmann/5a578985e8746323f13e5f2e1bb19892 |
Indeed it does. Thanks for the confirmation! For what it's worth, it looks like "go vet github.com/konsorten/go-windows-terminal-sequences" was warning about this issue too. |
@mdempsky Thanks! I guess this is on me then 😇 . I will add |
Hey, I am using
logrus
logging library. After I calllogrus.Infof()
, it panic. I have no idea what's happen. And this is the output:The text was updated successfully, but these errors were encountered: