Exception when debugging orxSYSTEM_EVENT_TOUCH

After the recent change for touch events, I am getting accvios when debugging code on my computer that handles the orxSYSTEM_EVENT_TOUCH events. It's a bit intermittent but, for example, it happens when setting breakpoints in the event handling eID == orxSYSTEM_EVENT_TOUCH_END. When I examine the code and then continue the program, I get the access violation.

http://i.imgur.com/WGROK.png

Comments

  • edited May 2012
    More info:

    - Happens with SVN 2938, too
    - Only happens when an event handler is registered for orxEVENT_TYPE_SYSTEM
    - Also happens when game is running and I press Alt+Tab to switch to my Visual Studio program
  • edited May 2012
    Works like a charm here. :/

    If you modify orxBounce.c, adds the already existing handler to the system event + a log made if ID == TOUCH_END + breakpoint, do you get the same result?

    That's what I tried locally and it runs just fine. What's your configuration?

    I don't think it's related to the touch events given your callstack, but probably more to the update to a newer version of GLFW that happened a week or two ago (except you didn't have any reason to put a breakpoint on these events).

    Alt+tabbing shouldn't trigger the event send I see in your callstack but iconification should do it (orxSYSTEM_EVENT_BACKGROUND).

    I'm running win7 64b + visual studio 2008 express + single screen. What's your configuration?
  • edited May 2012
    Ah also, are you running fullscreen or windowed, that could be a difference. You can also try to go back in time with the svn revision just before/after the update to the new GLFW and see if you have the same issue.
  • edited May 2012
    Tried in fullscreen, gets the background send event but no access violation, it's just ugly as visual appears with the the resolution set by orx or not at all and need to blindly press F5, but everything's fine after that. Also I have an ATI video card.
  • edited May 2012
    Win7 x64 / VS 2010 / dual screen. Windowed mode.

    Problem remains :( I will look at the other things you mentioned after work.
  • edited May 2012
    Mmh, that's really weird you break there if your window doesn't get iconified. Can you make sure all your header files/library binary are correctly synced on your project, just in case? :)
  • edited June 2012
    Alrighty, more info.

    - I can reproduce this every single time I start the windowed program and then Alt+Tab to my VS window.

    - I was suspicious of my configuration, too. My project doesn't build Orx (just links with it), but I deleted and fetched SVN again to make sure everything is correct.

    - I was able to isolate the cause to the following line in my event handler. If I comment this, the exception doesn't happen:
    orxVECTOR coords = { payload->stTouch.fX, payload->stTouch.fY, 0 };
    

    The whole function is here: http://pastebin.com/n4vMPedN I commented out all the messy test code to isolate the problem line. Is there something wrong with my event handler?

    - Problem does NOT happen with SVN rev. 2905. But of course not, since I have to comment the offending line to build it in that version!
    - Problem DOES happen with SVN rev. 2941.
  • edited June 2012
    Ah, so if I localize the scope of that assignment to inside the evt->eID == orxSYSTEM_EVENT_TOUCH* conditionals, the crash disappears.

    It seems to have it before that if/else block is illegal. I was under the impression I could put it there and save a few lines at the cost of an unused variable.
  • edited June 2012
    Aaaah, that makes more sense, thanks for the pastebin!

    You access the payload->stTouch for any system event but it only contains data for touch events.
    The part where it clashes is that there's not always a payload in an event! For focus or background/foreground events, there's no payload so you're dereferencing an invalid pointer! :)
  • edited June 2012
    Yep, sorry for bringing up a false alarm. I incorrectly assumed I'd always get a valid (possibly empty) payload and it never bit me until now.
Sign In or Register to comment.