Bug 957001 - xmoto-0.5.10-3.fc18 crashes on "Fradera - Snowing ride" level
Summary: xmoto-0.5.10-3.fc18 crashes on "Fradera - Snowing ride" level
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: xmoto
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-26 07:45 UTC by Conrad Meyer
Modified: 2013-05-17 03:24 UTC (History)
1 user (show)

Fixed In Version: xmoto-0.5.10-7.fc18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-05-15 17:29:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to xmoto RPM sources to fix NULL deref (4.53 KB, patch)
2013-05-04 15:34 UTC, Conrad Meyer
no flags Details | Diff
patch to fix null de-ref (4.52 KB, text/plain)
2013-05-04 15:37 UTC, Conrad Meyer
no flags Details
Just the patch! (2.00 KB, patch)
2013-05-07 15:46 UTC, Conrad Meyer
no flags Details | Diff

Description Conrad Meyer 2013-04-26 07:45:38 UTC
Crash is reliable, repro is as simple as opening the level. Here's the C++ bt from GDB with full debuginfo installed:

Program received signal SIGSEGV, Segmentation fault.
ElementHandler<Block>::_removeColElementFromCells (this=this@entry=0x1172660, pColElem=pColElem@entry=0x0)
    at Collision.cpp:1087
1087	  }
(gdb) bt
#0  ElementHandler<Block>::_removeColElementFromCells (this=this@entry=0x1172660, pColElem=pColElem@entry=0x0)
    at Collision.cpp:1087
#1  0x00000000006335b7 in moveElement (pColElem=0x0, this=0x1172660) at Collision.cpp:924
#2  CollisionSystem::moveDynBlock (this=0x1172560, id=<optimized out>) at Collision.cpp:798
#3  0x00000000006364c4 in SDynamicBlockMove::performMove (this=0x1165ef0, v_motoGame=0x11724e0, i_nbCents=1)
    at ScriptDynamicObjects.cpp:281
#4  0x0000000000636b8f in SDynamicObject::nextState (this=0x1165ef0, v_motoGame=<optimized out>, i_nbCents=1)
    at ScriptDynamicObjects.cpp:58
#5  0x000000000069ba61 in Scene::nextStateScriptDynamicObjects (this=this@entry=0x11724e0, 
    i_nbCents=i_nbCents@entry=1) at xmscene/Scene.cpp:1237
#6  0x000000000069f64d in Scene::updateLevel (this=0x11724e0, timeStep=1, i_frameRecorder=0x294bb90, 
    i_eventRecorder=0x294bb90, i_fast=false, i_allowParticules=<optimized out>, i_updateDiedPlayers=true)
    at xmscene/Scene.cpp:369
#7  0x0000000000490731 in StateScene::update (this=0x3378320) at states/StateScene.cpp:216
#8  0x000000000059ab46 in StatePlayingLocal::update (this=0x3378320) at states/StatePlayingLocal.cpp:165
#9  0x000000000047ef1d in StateManager::update (this=0xe513c0) at states/StateManager.cpp:306
#10 0x0000000000643db0 in GameApp::run_loop (this=this@entry=0xb6c9f0) at GameInit.cpp:816
#11 0x00000000006497ce in GameApp::run (this=0xb6c9f0, nNumArgs=nNumArgs@entry=1, 
    ppcArgs=ppcArgs@entry=0x7fffffffde88) at GameInit.cpp:159
#12 0x00000000004104cd in main (nNumArgs=1, ppcArgs=0x7fffffffde88) at GameInit.cpp:120

I'll poke around upstream and see if there's anything. In the mean time if I can do anything to help track it down, let me know.

Comment 1 Conrad Meyer 2013-04-26 07:47:02 UTC
NULL ptr deref:

1085	    /* remove cell from ColElem*/
1086	    pColElem->gridCells.clear();
1087	  }
(gdb) p pColElem
$1 = (ColElement<Block> *) 0x0

Looking backwards for cause...

Comment 2 Conrad Meyer 2013-04-26 07:48:10 UTC
796	  void CollisionSystem::moveDynBlock(Block* id)
797	  {
798	    m_dynBlocksHandler.moveElement(id->getColElement());
799	  }

id->getColElement() is NULL at this point.

Comment 3 Conrad Meyer 2013-04-26 07:50:42 UTC
(gdb) p *m_block
$7 = {m_id = "block0", m_texture = "snow",

The block with NULL m_collisionElement in frame 3.

Comment 4 Conrad Meyer 2013-04-26 07:55:53 UTC
No matching upstream bug that I can find.

Comment 5 Gwyn Ciesla 2013-04-26 11:32:21 UTC
Trying to reproduce, but I can't find that level, how do you navigate to it?

Comment 6 Conrad Meyer 2013-04-26 16:48:27 UTC
I go to "All levels", enter "snowing" in the search box, and it's the only one. It was (probably) downloaded as an player-created level from the internet by Xmoto's autodownloader... let me try to find it.

Comment 7 Conrad Meyer 2013-04-26 16:48:58 UTC
Here it is:
http://xmoto.tuxfamily.org/pages/thumbnail.php?id_level=1538

Comment 8 Gwyn Ciesla 2013-05-01 20:55:51 UTC
This appears to be a level-specific bug due to a feature xmoto no longer supports.

http://forum.xmoto.tuxfamily.org/viewtopic.php?f=48&t=3259

Since it's not a level shipped in the default install, that forum thread is probably the best place to have this resolved, since I have no way to publish a fix for the level.

Comment 9 Conrad Meyer 2013-05-02 05:21:30 UTC
Still, just because it's unsupported doesn't mean it should segfault ;-). Let me see if I can come up with some sort of reasonable patch...

Comment 10 Gwyn Ciesla 2013-05-02 11:14:15 UTC
I agree.  If you can fix the level, send it upstream.  If you can patch xmoto to let it run this level without breaking anything, I'll be happy to include it as well as send it upstream.

Comment 11 Conrad Meyer 2013-05-03 01:06:36 UTC
Looks like levels are simple XML files with some embedded Lua for level scripting, and then a bunch of vertexes describing shapes (+ textures along edges). I wonder what feature became deprecated...

Comment 12 Conrad Meyer 2013-05-03 01:19:22 UTC
None of the APIs used in the script seem deprecated[0].

The file uses only Game.GetPlayerPosition(), Game.GetBlockPos(), Game.SetDynamicBlockTranslation(), and Game.SetBlockPos(). All of these are documented in the scripted levels wiki.

[0]: http://wiki.xmoto.tuxfamily.org/index.php?title=Scripted_levels

Comment 13 Conrad Meyer 2013-05-04 15:34:18 UTC
Created attachment 743522 [details]
Patch to xmoto RPM sources to fix NULL deref

Ok, reopening because I have a patch for you. This one is more of a bandaid than a real fix -- the 'snowing' effect is broken. A real fix might forward-port whatever feature(s) is/are missing. TODO ;).

Comment 14 Conrad Meyer 2013-05-04 15:37:04 UTC
Created attachment 743523 [details]
patch to fix null de-ref

Oh goddamnit, bugzilla ate my patch. Attaching as text...

Comment 15 Gwyn Ciesla 2013-05-07 14:41:40 UTC
BZ still seems to be munging things.  Can you attach just the .diff as a .patch?  I can probably recreate it but I want to be sure I get it right.

Comment 16 Conrad Meyer 2013-05-07 15:44:45 UTC
It seems fine to me. It's a git format-patch, apply with 'git apply'. I'll attach just the .diff as well...

Comment 17 Conrad Meyer 2013-05-07 15:46:06 UTC
Created attachment 744794 [details]
Just the patch!

Comment 18 Gwyn Ciesla 2013-05-07 16:09:51 UTC
Ah, I'd never used one of those before.  Thanks. :)

Anyway, that looks good, your patch is a much more successful version of what I'd attempted.  I'll send this upstream, and get builds out for rawhide->f18.

Comment 19 Fedora Update System 2013-05-07 16:37:13 UTC
xmoto-0.5.10-7.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/xmoto-0.5.10-7.fc19

Comment 20 Fedora Update System 2013-05-07 16:37:23 UTC
xmoto-0.5.10-7.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/xmoto-0.5.10-7.fc18

Comment 21 Conrad Meyer 2013-05-07 18:43:13 UTC
(In reply to comment #18)
> Ah, I'd never used one of those before.  Thanks. :)
> 
> Anyway, that looks good, your patch is a much more successful version of
> what I'd attempted.  I'll send this upstream, and get builds out for
> rawhide->f18.

Awesome. It would be great if we could find out what changed since the level was created and fix either it or the game, but I don't think I'm going to investigate that on my own -- I'll wait to hear back from someone on the forum. I'm looking forward to F-19 GA, but I'm on F-18 for now -- give me a minute and I can give karma to the update(s) =).

Comment 22 Fedora Update System 2013-05-07 20:46:03 UTC
Package xmoto-0.5.10-7.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing xmoto-0.5.10-7.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-7604/xmoto-0.5.10-7.fc19
then log in and leave karma (feedback).

Comment 23 Fedora Update System 2013-05-15 17:29:18 UTC
xmoto-0.5.10-7.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2013-05-17 03:24:42 UTC
xmoto-0.5.10-7.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.