-
Notifications
You must be signed in to change notification settings - Fork 322
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
Access Violation exception randomly crashes program #47
Comments
Here
GetMessage is being called with a
This exception seems to be triggering at PC The code here looks as follows: var msg win.MSG
for fb.hWnd != 0 {
switch win.GetMessage(&msg, 0, 0, 0) { where type MSG struct {
HWnd HWND
Message uint32
WParam uintptr
LParam uintptr
Time uint32
Pt POINT
} and Since cc @alexbrainman @kjk does my analysis make sense? Have you seen anything like this before? |
@tmm1 Very solid analysis. If you can reproduce this I would recommend running under windbg (https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools) to debug this. Convert debug info to .pdb using https://github.com/kjk/cv2pdb Windbg would allow you to poke the state of the app when crash happens. The first thing I would check is if this is called from main thread (main goroutine). If not, all bets are off. You can also test 32bit vs. 64bit builds. I've seen 32bit be more stable. |
Thanks. I'm not able to reproduce readily, but will enable WER to capture a dump the next time it happens. I'm fairly certain all the GUI code is locked to the main thread. |
How do you know that msg is allocated on stack and does not escape to the heap? I do not know what Go version you use, but I would use whatever flags appropriate to see if msg escapes to the heap. Other than that, I don't see any problems in your reasoning. Alex |
Oops, I was reading it like C code. I saw these crashes on go1.9.4, but have since upgraded to go1.10.1 to see if I can reproduce again. You're right that I have no idea whether it is on the heap or the stack. I'll try compiling with gcflags to see what the compiler decides to do with that variable. Either way, the golang GC should be keeping it alive right? So there must be some sort of heap/stack corruption happening somewhere? |
I tried |
I have seen my walk apps crashing randomly like this, but haven't been able to find the cause. |
@lxn If you have crash stacks from any of them, please share as it will help find any commonalities that could point towards the root cause. |
Another thing I would recommend is looking into a list of DLLs loaded into process. On Windows other software likes to inject itself into every running process and sometimes this software is buggy. If you look at list of dlls loaded into a process, you can see if any .dll looks like it's non-system. It's a long shot but I've seen this happen. Chrome goes as far as blocking such injections (see https://www.chromium.org/Home/third-party-developers or https://blog.chromium.org/2017/11/reducing-chrome-crashes-caused-by-third.html) |
I do not know where your source is, so I tried one of my programs:
So my Alex |
I'm still seeing this happen about once a month.
@aclements Do you think any of your fixes for golang/go#21382 would have an effect here? |
I'm still seeing this happen in go1.12
|
Possibly a dupe of lxn/walk#483 and fixed in lxn/walk#493 |
Recently I experienced a crash in my lxn/walk based program on two different machines running Windows 10.
The text was updated successfully, but these errors were encountered: