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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Alzurana

Pages: [1]
1
Graphics / Re: Application Crash With RenderWindow Instantiation
« on: September 24, 2014, 07:44:43 pm »
Hey there,
well I had the exact same problem and it is caused by a race condition on AMD/ATI cards.
My engine has 3 threads, one main thread, one resource thread and one rendering thread.
Whenever 2 threads tried to create a texture or open a window at the same time I got this exact segmentation fault.
Same stack trace within the SFML, crash in atioglxx.dll
And no SFML error, because the runtime kills this nasty one before it lays any eggs.

So what causes this:
Apparently it's simply caused by 2 threads accessing oGL at the same time, from the same process ID.
It's a race condition, since it's not happening on all systems. I think a unique software/hardware combination causes this. Also, most systems don't crash on a simultaneous access.
You can easily prevent this by securing any call of createTexture and createRenderWindow with a mutex, and I would recommend to do so.
This bug is so unique that AMD probably won't fix it in the near future.

^ So if anyone needs a fix for that, ever.. There you have it!

Have a nice day <3


PS: This was my stack trace
The top function is a typical windows mask, don't get confused by it...
#0  55B55D40 atioglxx!DrvGetProcAddress                ()
#1  6E184ED2 sf::priv::WglContext::createContext       (this=0x7853d8, shared=0x787628, bitsPerPixel=32, settings=...)
#2  6E1842A4 sf::priv::WglContext::WglContext          (this=0x7853d8, shared=0x787628, settings=..., owner=0x784b40, bitsPerPixel=32)
#3  6E181ABC sf::priv::GlContext::create               (settings=..., owner=0x784b40, bitsPerPixel=32)
#4  6E182F92 sf::Window::create                        (this=0x787958, mode=..., title=..., style=5, settings=...)
#5  68ED6346 sf::RenderWindow::RenderWindow            (this=0x787958, mode=..., title=..., style=5, settings=...)
#6  00405BAD _JADE_internal::_cRenderWindow::InitWindow(this=0x783ea4, oNEW_VID_MODE=..., iSTYLE=@0x784304: 5)
#7  00404941 cGraphics::Run                            (this=0x783d60)
#8  0040BA61 _ThreadMainLoop                           (pParam=0x7842ec)
#9  76CD338A KERNEL32!BaseCleanupAppcompatCacheSupport ()
#10 026DFFD4 ??                                        ()
#11 77359F72 ntdll!RtlpNtSetValueKey                   ()
#12 007842EC ??                                        ()
#13 77359F45 ntdll!RtlpNtSetValueKey                   ()
#14 0040BA3C cThread::Run                              (this=0x77359f45 <ntdll!RtlpNtSetValueKey+1432>)
#15 007842EC ??                                        ()
#16 ??       ??                                        ()
 

Pages: [1]