Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sfml window memory access error on exit  (Read 2284 times)

0 Members and 1 Guest are viewing this topic.

techspy007

  • Newbie
  • *
  • Posts: 3
  • Age-X Development
    • View Profile
    • Google Play Store link
    • Email
sfml window memory access error on exit
« on: June 16, 2016, 05:48:42 pm »
The sfml window seems to have a bug. A blank window without any content runs and exits fine. Drawing anything in the window causes a memory access violation on exit.

This also occurs when running the examples that come bundled with sfml win32 latest stable release from the sfml site.

Other posts claim similar problems but none of them mention that the examples also cause this.
while (!asleep)
{sheep++;}

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: sfml window memory access error on exit
« Reply #1 on: June 16, 2016, 06:02:03 pm »
Start the debug version in a debugger and retrieve the stack trace. To me it sounds more likely like a GPU driver issue or similar.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

techspy007

  • Newbie
  • *
  • Posts: 3
  • Age-X Development
    • View Profile
    • Google Play Store link
    • Email
Re: sfml window memory access error on exit
« Reply #2 on: June 16, 2016, 06:37:28 pm »
Well I ran the examples on my laptop and they seem to run okay. Both gpu cards are Intel though (all these issues because my gtx died on me on Saturday:(  ), but anyways I'm installing different drivers on the desktop and update.

Update #1:
Changed my driver version, it stil persists. Well I'm stumped now.

The pre-built examples report an unhandled exception at a memory address with ntdll.dll.

Well the stack trace crashes when sfml calls the window destructor. The same happens when i have an OpenGl context and close the window. The call to window.Close() causes a similar exception.

I can thats the last call on the stack.
« Last Edit: June 16, 2016, 08:52:50 pm by techspy007 »
while (!asleep)
{sheep++;}

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: sfml window memory access error on exit
« Reply #3 on: June 16, 2016, 09:54:09 pm »
What exact version of SFML are you using? Or where did you download it from?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

techspy007

  • Newbie
  • *
  • Posts: 3
  • Age-X Development
    • View Profile
    • Google Play Store link
    • Email
Re: sfml window memory access error on exit
« Reply #4 on: June 17, 2016, 12:37:03 am »
I am using sfml 2.3.2 32 bit windows build downloaded from the sfml website.

I also compiled sfml locally and the error still occurs. It's somehow linked to sfml's opengl context.

Edit:
From the stacktrace, the way the code is structured is such that the app stil tries to draw even after the exit event. I've moved the event handlers to a custom function, cleaned up the opengl resourses and freed memory then used a C++ exception to jump back to main() and exit.

Hopefully my code wont make Bjarne want to slap me.

Anyone wants the actual code just PM me.
« Last Edit: June 17, 2016, 10:25:13 am by techspy007 »
while (!asleep)
{sheep++;}

 

anything