-
Notifications
You must be signed in to change notification settings - Fork 34
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
Segfault on Windows 11 in USER32!GetMessageW #507
Comments
This is awesome detective work. I don't really have any useful comments to add. I'm running Edwood on Win and have a growing list of stuff that I need to be fixing. |
Another observation -- this time I captured some register values at the start of the program (via a breakpoint on
Note And then at the time of the crash:
My laptop does have two screens built in and also two GPUs, I wonder if that's somehow related. Will investigate this angle and also |
Ok delve doesn't seem useful for debugging segfaults on windows, I just get this:
A quick search suggested that setting a breakpoint when a signal is received is not yet supported by delve. I thought perhaps I could use gdb to capture the segfault then save a core file for delve to read, but gdb on windows cannot generate core files :S Ok I've managed to get delve to print out the _MSG struct at every invocation of |
Unfortunately, it did not :( Just some WM_MOUSEMOVE messages:
I'm a bit at a loss. I haven't had to move windows between screens or switch between battery/AC power to trigger the crash, sometimes it happens just a few minutes after opening edwood |
I'm seeing a regular segfault on Win11. It seems to happen when edwood does not have focus and the mouse pointer passes over it, but I don't have a solid reproducer yet.
I'm not really expecting any help solving this one, I'm mainly filing the issue so I have a place to keep notes. From what I've gathered so far it looks like this might actually be an exp/shiny bug, however I couldn't find an issue tracker for that project.
Without further ado, the crash looks like this from gdb's perspective (I also need to look into delve):
Ie. we're in exp/shiny's win32 message loop which looks very standard:
It's hard to see how edwood could influence this codepath, unless shiny somehow leaks a pointer into the _MSG struct into its event handlers.
Digging deeper into the native side of the core:
On the shiny side we have:
which plumbs into the standard library runtime/syscall_windows.go:
From what I can tell from reading
sys_windows_amd64.s
andos_windows.go
,asmstdcall()
puts the first argument into the CX register. According to the disassembly USER32!GetMessageW moves RCX into RBX and then tries to access memory near RBX which is responsible for the segfault. ie. this corresponds to the_MSG
struct passed in by shiny. However I've no clue why that would suddenly become inaccessible so I wonder if I've taken a wrong turn somewhere.Anyway that will do for now, it's past my bedtime ;)
The text was updated successfully, but these errors were encountered: