[Kde-games-devel] Review Request: Attempt to fix null pointer issue in Game::map.

Albert Astals Cid aacid at kde.org
Tue Aug 14 18:58:08 UTC 2012



> On Aug. 7, 2012, 9:42 p.m., Albert Astals Cid wrote:
> > Do you have a sequence of actions that show the need for this if protection? i.e. what do i have to do so that the game crashes without this patch? Or is it all purely theorical?
> 
> Michael Reeves wrote:
>     The call of GameView::gameOver inside  GameView::startNewGame is reproducable.
>     1)setup a game with no human players the game must end without stopping to wait for input.
>     2)from the new game dialog quickly hit return, return, cntrl+N
>     
>     You may have to do this few times to get the crash. The window of opportunity for this to happen is very small. It will most likely be GameView::gameOver that triggers the crash. I can provide a stack trace for this if needed as I can reliably reproduce GameView::gameOver inside GameView::startNewGame on unpatched code. GameView::startNewGame could theorically happpen as well thanks to these lines in localGame.cpp:
>     
>     ./localgame.cpp:34:        qApp->processEvents();  // Really important : ignoring this will not apply the change soon enough
>     ./localgame.cpp:43:        qApp->processEvents();  // Really important : ignoring this will not apply the change soon enough
>     
>     Oddly my stack trace now looks like the one in the bug but still only happens in unpatched code.

I've actually fixed the two crashes (they were kind of independent) myself

If you want you can have a look at http://websvn.kde.org/?view=revision&revision=1310667 and http://websvn.kde.org/?view=revision&revision=1310670

As an exercise you can revert those commits and then run konquest on valgrind and you'll see the wrong memory accesses being mentioned.

I think you can discard this review request now (unless you can still reproduce some of the crahers with code from the 4.9 branch)


- Albert


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/7013/#review10914
-----------------------------------------------------------


On Aug. 6, 2012, 7:05 p.m., Michael Reeves wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/7013/
> -----------------------------------------------------------
> 
> (Updated Aug. 6, 2012, 7:05 p.m.)
> 
> 
> Review request for KDE Games.
> 
> 
> Description
> -------
> 
> Attempt to fix crash due to null Map pointer. Prevents calling GameView::startNewGame or GameView::gameOver before GameView is fully ready the cause of my variant.
> 
> 
> This addresses bug 296290.
>     https://bugs.kde.org/show_bug.cgi?id=296290
> 
> 
> Diffs
> -----
> 
>   /branches/KDE/4.8/kdegames/konquest/gameview.h 1308596 
>   /branches/KDE/4.8/kdegames/konquest/gameview.cc 1308596 
> 
> Diff: http://svn.reviewboard.kde.org/r/7013/diff/
> 
> 
> Testing
> -------
> 
> It fixes a related variant I was able to produce on my machine. I am unable to reproduce the bug as reported. Attempted to work around issue based on the stack traces alone.
> 
> 
> Thanks,
> 
> Michael Reeves
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20120814/dacda649/attachment.html>


More information about the kde-games-devel mailing list