Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on exit on FreeBSD #19

Closed
AMDmi3 opened this issue Feb 1, 2017 · 5 comments
Closed

Crash on exit on FreeBSD #19

AMDmi3 opened this issue Feb 1, 2017 · 5 comments

Comments

@AMDmi3
Copy link
Contributor

AMDmi3 commented Feb 1, 2017

#0  0x0000000801d34ef4 in QOpenGLContext::shareGroup () from /usr/local/lib/libQt5Gui.so.5
#1  0x0000000801fbfd1d in QOpenGLExtensions::flushShared () from /usr/local/lib/libQt5Gui.so.5
#2  0x0000000801fb6b45 in QOpenGLExtensions::flushShared () from /usr/local/lib/libQt5Gui.so.5
#3  0x0000000801f7bbfb in QOpenGLFunctions::initializeOpenGLFunctions () from /usr/local/lib/libQt5Gui.so.5
#4  0x000000000054677f in QOpenGLFunctions::glDeleteProgram (this=0x808db4f88, program=19) at qopenglfunctions.h:1310
#5  0x0000000000542913 in ~MCGLShaderProgram (this=0x808db4f80) at /usr/work/tmp/dustrac/work/DustRacing2D-1.12.0/src/game/MiniCore/Graphics/mcglshaderprogram.cc:128
#6  0x00000000005428c9 in ~MCGLShaderProgram (this=0x808db4f80) at /usr/work/tmp/dustrac/work/DustRacing2D-1.12.0/src/game/MiniCore/Graphics/mcglshaderprogram.cc:127
#7  0x000000000049252c in std::__1::__shared_ptr_pointer<MCGLShaderProgram*, std::__1::default_delete<MCGLShaderProgram>, std::__1::allocator<MCGLShaderProgram> >::__on_zero_shared (this=0x8204209c0) at memory:2431
#8  0x00000008027326ec in std::__1::__shared_weak_count::__release_shared () from /usr/lib/libc++.so.1
#9  0x000000000042610f in ~shared_ptr (this=0x820430e28) at memory:4462
#10 0x0000000000493435 in ~pair (this=0x820430e10) at utility:248
#11 0x00000000004933a3 in std::__1::__hash_table<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<MCGLShaderProgram> >, std::__1::__unordered_map_hasher<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<MCGLShaderProgram> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::__unordered_map_equal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<MCGLShaderProgram> >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<MCGLShaderProgram> > > >::__deallocate (this=0x808ce8b90, __np=0x820430e00) at unordered_map:565
#12 0x00000000004931ad in ~__hash_table (this=0x808ce8b90) at __hash_table:1283
#13 0x000000000048b945 in ~unordered_map (this=0x808ce8b90) at unordered_map:713
#14 0x000000000048b8cf in ~Renderer (this=0x808ce8b40) at /usr/work/tmp/dustrac/work/DustRacing2D-1.12.0/src/game/renderer.cpp:391
#15 0x000000000048b699 in ~Renderer (this=0x808ce8b40) at /usr/work/tmp/dustrac/work/DustRacing2D-1.12.0/src/game/renderer.cpp:390
#16 0x000000000044f9b5 in ~Game (this=0x7fffffffe3d0) at /usr/work/tmp/dustrac/work/DustRacing2D-1.12.0/src/game/game.cpp:363
#17 0x000000000045f19e in main (argc=1, argv=0x7fffffffe8e8) at /usr/work/tmp/dustrac/work/DustRacing2D-1.12.0/src/game/main.cpp:114
@AMDmi3
Copy link
Contributor Author

AMDmi3 commented Feb 1, 2017

Probably incorrect order of OpenGL object destruction.

@devnexen
Copy link
Contributor

devnexen commented Feb 1, 2017

Hi on OpenBSD we got segfault on exit too we had to compile with those cmake flags

-DQOpenGLFunctions=OFF -DNO_GLEW=OFF

hope it helps.

@juzzlin
Copy link
Owner

juzzlin commented Feb 1, 2017

Please test if my commit 75131bb improves the situation on *BSD. I don't know why the game crashes only on *BSD, but I noticed that Renderer leaves the OpenGL context alive and deleting the context led to a crash. I then tuned the deletion procedure, because QOpenGLFunctions::glDeleteProgram() was called after the context had been deleted. The same situation as in AMDmi3's stack trace, I guess. This would also explain why GLEW works.

@juzzlin
Copy link
Owner

juzzlin commented Aug 19, 2017

I'm closing this due to no activity after my fix.

@juzzlin juzzlin closed this as completed Aug 19, 2017
@AMDmi3
Copy link
Contributor Author

AMDmi3 commented Aug 20, 2017

Sorry, I've forgot about this. I'll test soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants