juzzlin / DustRacing2D

Dust Racing 2D is a traditional top-down car racing game including a level editor.
http://juzzlin.github.io/DustRacing2D/index.html
GNU General Public License v3.0
301 stars 67 forks source link

2.1.1 segfaults when trying to start a race #120

Closed AMDmi3 closed 3 years ago

AMDmi3 commented 3 years ago

When trying to start a race (pressing Enter on track selection screen) the game segfaults.

(gdb) bt
#0  MCObject::Impl::index (this=0x0) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MiniCore/src/Core/mcobject.cc:239
#1  0x0000000000482446 in MCObject::index (this=0x8056a65f0) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MiniCore/src/Core/mcobject.cc:1041
#2  0x00000000004988bf in MCWorld::removeObjectNow (this=0x80315f6c0, object=...)
    at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MiniCore/src/Core/mcworld.cc:355
#3  0x000000000048384c in MCObject::Impl::removeFromWorldNow (this=0x805794200)
    at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MiniCore/src/Core/mcobject.cc:123
#4  0x000000000048b9fc in MCObject::Impl::~Impl (this=0x805794200) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MiniCore/src/Core/mcobject.cc:541
#5  0x000000000048b9ab in std::__1::default_delete<MCObject::Impl>::operator() (this=0x8056a65f8, __ptr=0x805794200) at /usr/include/c++/v1/memory:2363
#6  0x000000000048b92f in std::__1::unique_ptr<MCObject::Impl, std::__1::default_delete<MCObject::Impl> >::reset (this=0x8056a65f8, __p=0x0) at /usr/include/c++/v1/memory:2618
#7  0x00000000004849d9 in std::__1::unique_ptr<MCObject::Impl, std::__1::default_delete<MCObject::Impl> >::~unique_ptr (this=0x8056a65f8) at /usr/include/c++/v1/memory:2572
#8  0x000000000048271f in MCObject::~MCObject (this=0x8056a65f0) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MiniCore/src/Core/mcobject.cc:1094
#9  0x000000000048274c in MCObject::~MCObject (this=0x8056a65f0) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MiniCore/src/Core/mcobject.cc:1094
#10 0x000000000049b64f in std::__1::default_delete<MCObject>::operator() (this=0x80315f738, __ptr=0x8056a65f0) at /usr/include/c++/v1/memory:2363
#11 0x0000000000499faf in std::__1::unique_ptr<MCObject, std::__1::default_delete<MCObject> >::reset (this=0x80315f738, __p=0x80577c300) at /usr/include/c++/v1/memory:2618
#12 0x0000000000499a3d in std::__1::unique_ptr<MCObject, std::__1::default_delete<MCObject> >::operator= (this=0x80315f738, __u=std::unique_ptr<MCObject> = 0x0)
    at /usr/include/c++/v1/memory:2537
#13 0x0000000000497733 in MCWorld::setDimensions (this=0x80315f6c0, minX=0, maxX=5120, minY=0, maxY=2048, minZ=0, maxZ=1000, metersPerUnit=0.0500000007, addAreaWalls=true, 
    gridSize=128) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MiniCore/src/Core/mcworld.cc:207
#14 0x000000000039faaa in Scene::setWorldDimensions (this=0x8117ce000) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/scene.cpp:469
#15 0x000000000039f854 in Scene::setActiveTrack (this=0x8117ce000, activeTrack=...) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/scene.cpp:439
#16 0x0000000000451953 in TrackSelectionMenu::selectCurrentItem (this=0x812091718)
    at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/menu/trackselectionmenu.cpp:438
#17 0x00000000004f7303 in MTFH::MenuManager::selectCurrentItem (this=0x80f9d8200) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/MTFH/menumanager.cpp:211
#18 0x0000000000344648 in EventHandler::handleMenuKeyPressEvent (this=0x8030ddc20, event=0x7fffffffe3c8)
    at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/eventhandler.cpp:196
#19 0x0000000000344332 in EventHandler::handleKeyPressEvent (this=0x8030ddc20, event=0x7fffffffe3c8)
    at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/eventhandler.cpp:95
#20 0x0000000000393df8 in Renderer::keyPressEvent (this=0x80315f780, event=0x7fffffffe3c8)
    at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/renderer.cpp:352
#21 0x00000008012cb3ca in QWindow::event(QEvent*) () from /usr/local/lib/qt5/libQt5Gui.so.5
#22 0x000000000039386b in Renderer::event (this=0x80315f780, event=0x7fffffffe3c8) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/renderer.cpp:290
#23 0x0000000800c9bc40 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#24 0x0000000800c9d106 in QApplication::notify(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#25 0x000000000031afc3 in Application::notify (this=0x7fffffffe798, receiver=0x80315f780, event=0x7fffffffe3c8)
    at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/application.cpp:34
#26 0x0000000801c4f4bf in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Core.so.5
#27 0x00000008012bbd75 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /usr/local/lib/qt5/libQt5Gui.so.5
#28 0x000000080129ed3b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/lib/qt5/libQt5Gui.so.5
#29 0x00000008054132ff in ?? () from /usr/local/lib/qt5/libQt5XcbQpa.so.5
#30 0x0000000802cd2b9c in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.0
#31 0x0000000802cd2f34 in ?? () from /usr/local/lib/libglib-2.0.so.0
#32 0x0000000802cd2ff6 in g_main_context_iteration () from /usr/local/lib/libglib-2.0.so.0
#33 0x0000000801ca9f50 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/lib/qt5/libQt5Core.so.5
#34 0x0000000801c4b7a7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/lib/qt5/libQt5Core.so.5
#35 0x0000000801c4fb6e in QCoreApplication::exec() () from /usr/local/lib/qt5/libQt5Core.so.5
#36 0x0000000000353091 in Game::run (this=0x7fffffffe788) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/game.cpp:355
#37 0x0000000000363fd9 in main (argc=1, argv=0x7fffffffe908) at /usr/work/usr/ports/games/dustrac/work/DustRacing2D-2.1.1/src/game/main.cpp:62
juzzlin commented 3 years ago

On which platform? Same as https://github.com/juzzlin/DustRacing2D/issues/119 that happens on BSD?

juzzlin commented 3 years ago

I think this particular problem was fixed in ae380b82bfdb89ad4dd96510a69d9057d8029b6a, but then we run into other problems. I cannot reproduce the issue on Linux so that is still open.

AMDmi3 commented 3 years ago

This happens on FreeBSD. Will check the mentioned commit tomorrow.

AMDmi3 commented 3 years ago

Fix confirmed