Snake! Application Exception

General discussion about Visopsys. We'll create more specific forums if the number of posts justifies that.
Post Reply
User avatar
MJT
Posts: 5
Joined: Fri Oct 28, 2011 10:19 pm

Snake! Application Exception

Post by MJT » Thu Nov 17, 2011 6:49 pm

Hey! :D I was playing on your "Snake!" video game inside of your Visopsys operating system and it suddenly crashed when I reached the score of "0196." Another window appeared in front of it with the title of "Application Exception" and the message of "Process "gui thread" caused a page fault exception at application address 00000000." I hope that you don't mind me reporting it to you on here. :) If you would like me to do some more testing on it, then please just let me know. ;)
Michael J. Thomas

User avatar
andymc
Posts: 476
Joined: Tue Nov 16, 2010 7:20 pm

Re: Snake! Application Exception

Post by andymc » Sat Nov 19, 2011 1:43 am

Thanks very much for a report. That sounds like a tricky one, since the fault didn't actually occur in the app you were using. The GUI thread mostly takes care of turning raw user inputs (mouse movements, keyboard presses etc) into window system events. Those are put into queues where they can be collected by the applications that own the relevant window where the event occurred. It can be difficult to reproduce these kinds of crashes, since they're very asynchronous and fairly non-deterministic! It would be very helpful if you could determine a script of 'steps' to make it happen, but it doesn't sound like that would be easy to do in this case.

User avatar
MJT
Posts: 5
Joined: Fri Oct 28, 2011 10:19 pm

Re: Snake! Application Exception

Post by MJT » Tue Nov 22, 2011 5:36 am

Thank you very much for your really nice reply to my bug report regarding your "Snake!" video game, Andrew. :D I'm really sorry that it's not a problem that I'll easily be able to replicate for you, but I'll most certainly give it a go. :) I was just wondering as to whether or not that it could possibly be a race condition in the queuing system of the window events code?
Michael J. Thomas

User avatar
andymc
Posts: 476
Joined: Tue Nov 16, 2010 7:20 pm

Re: Snake! Application Exception

Post by andymc » Tue Nov 22, 2011 10:32 am

That's possible Michael,

When a mouse or keyboard interrupt arrives, the driver puts the event data into a stream (FIFO) which is later read by the GUI thread, which dispatches the event (to the appropriate button, window, etc). The data goes into the stream in an interrupt context, in which it's not possible to hold a lock on the stream. However, the stream is not read by the GUI thread unless there's enough data there to comprise at least one complete event, so it should be safe, but I'll take another look to try and figure out whether there's a synchronization problem there.

Andy

User avatar
MJT
Posts: 5
Joined: Fri Oct 28, 2011 10:19 pm

Re: Snake! Application Exception

Post by MJT » Fri Nov 25, 2011 11:40 am

Thank you very much for your really nice reply to me, Andrew. :D I wish you all of the best with fixing the problem, and if there's anything that I can do to help you, then please just let me know. :)
Michael J. Thomas

Post Reply