Open JBetz opened 2 hours ago
I just noticed that the event's timestamp
field is 174255680834700
/ 16r9E7C0FF4CC8C
when it should be 0
. The values for windowID
and code
, however, are correct. So likely this is an issue with how Uint64
is represented in the language I'm calling SDL from (Dolphin Smalltalk, which is 32-bit).
Usually the timestamp has the correct value, though, and I never set it to anything other than 0
. So the weird thing is that it's only sometimes somehow gets a garbage value.
I've added a conditional breakpoint in my application for any case where the timestamp
is not equal to zero, to see whether it gets the garbage value before or during the SDL call.
It looks like it fails to read event+0x40
(64 bytes).
Events must be exactly 128 bytes:
https://github.com/libsdl-org/SDL/blob/8468c372b21b937d7adb340c4725d77c7d87c4d9/include/SDL3/SDL_events.h#L996
Every so often I get an access violation error when trying to push a
SDL_UserEvent
to the event queue. I haven't found a reliable way to reproduce it, but wanted to report in case anyone recognizes the error, or has any advice around potential issues when using this feature in a language with garbage collection. My understanding is that theSDL_Event
is safe to dispose of afterSDL_PushEvent
returns, so I'm not sure what could be going wrong.Here's the topmost SDL call which shows values in the event struct:
Here's the bottommost SDL call:
And here's the assembly in
memcpy
that throws the exception: