WizardCorp / WizardPoker

An online free-to-play card game
http://www.wizardcorp.com/wizardpoker
0 stars 0 forks source link

The Gui achievements menu provokes a SEGFAULT #159

Open RobinPetit opened 8 years ago

RobinPetit commented 8 years ago

Issue by RobinPetit Sunday Mar 27, 2016 at 08:22 GMT Originally opened as https://github.com/ulb-infof209/Group5/issues/159


When I click on the achievements button, the program crashes because of a SEGFAULT.

RobinPetit commented 8 years ago

Comment by StanIsAdmin Sunday Mar 27, 2016 at 08:30 GMT


It doesn't on my version, and I just merged & pulled... Can you GDB it ? However, the latest implemented achievements are not displayed.

RobinPetit commented 8 years ago

Comment by RobinPetit Sunday Mar 27, 2016 at 08:36 GMT


Yep, I'll give it a try.

RobinPetit commented 8 years ago

Comment by RobinPetit Sunday Mar 27, 2016 at 11:11 GMT


Here's what gdb outputs:

Program received signal SIGSEGV, Segmentation fault.
0xbfffe93c in ?? ()
(gdb) bt
#0  0xbfffe93c in ?? ()
#1  0xb7ba15d5 in tgui::BoxLayout::insert (this=0x853db94, index=1, widget=std::shared_ptr (count 1, weak 1) 0x858ad84, widgetName=...)
    at /home/poupou/tmp/TGUI-master/src/TGUI/BoxLayout.cpp:35
#2  0xb7ba1801 in tgui::BoxLayout::add (this=0x853db94, widget=std::shared_ptr (count 1, weak 1) 0x858ad84, widgetName=...)
    at /home/poupou/tmp/TGUI-master/src/TGUI/BoxLayout.cpp:60
#3  0xb7ba1884 in tgui::BoxLayout::addSpace (this=0x853db94, ratio=0,100000001) at /home/poupou/tmp/TGUI-master/src/TGUI/BoxLayout.cpp:67
#4  0x081ea16c in GuiAchievementState::GuiAchievementState (this=0x84ce9b8, context=..., __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at /media/Data/Dropbox/Public/scolaire/ULB/INFOF-209/src/client/Gui/states/GuiAchievementState.cpp:54
#5  0x081c1ba2 in void StateStack::push<GuiAchievementState>()::{lambda()#1}::operator()() const (__closure=0x829f758)
    at /media/Data/Dropbox/Public/scolaire/ULB/INFOF-209/include/client/StateStack.hpp:74
#6  0x081c51bb in std::_Function_handler<void (), void StateStack::push<GuiAchievementState>()::{lambda()#1}>::_M_invoke(std::_Any_data const&) (__functor=...)
    at /usr/include/c++/5/functional:1871
#7  0x0816e07f in std::function<void ()>::operator()() const (this=0x829f758) at /usr/include/c++/5/functional:2271
#8  0x0816d416 in StateStack::doPendingChanges (this=0x8283e50) at /media/Data/Dropbox/Public/scolaire/ULB/INFOF-209/src/client/StateStack.cpp:50
#9  0x0816d27e in StateStack::handleInput (this=0x8283e50) at /media/Data/Dropbox/Public/scolaire/ULB/INFOF-209/src/client/StateStack.cpp:20
#10 0x08192a4b in GuiApplication::play (this=0x8283d08) at /media/Data/Dropbox/Public/scolaire/ULB/INFOF-209/src/client/Gui/GuiApplication.cpp:26
#11 0x0815fc59 in main (argc=2, argv=0xbffff2c4) at /media/Data/Dropbox/Public/scolaire/ULB/INFOF-209/src/client/client.cpp:30
(gdb) 
RobinPetit commented 8 years ago

Comment by RobinPetit Sunday Mar 27, 2016 at 11:31 GMT


If I comment this line: _layout->addSpace(0.1f);, then it totally works...

RobinPetit commented 8 years ago

Comment by StanIsAdmin Sunday Mar 27, 2016 at 11:41 GMT


All right, you can remove it then. Not a big deal. Just less pretty.

RobinPetit commented 8 years ago

Comment by RobinPetit Sunday Mar 27, 2016 at 11:54 GMT


That's what I did for now, but that's odd...

RobinPetit commented 8 years ago

Comment by TheoVerhelst Sunday Mar 27, 2016 at 12:03 GMT


When all this project will be finished, it may be a good idea to try to reproduce this bug in a minimal code and report this bug to TGUI, there is no reason that a valid BoxLayout complains about spaces.

RobinPetit commented 8 years ago

Comment by RobinPetit Sunday Mar 27, 2016 at 12:06 GMT


Yep.

RobinPetit commented 8 years ago

Comment by StanIsAdmin Sunday Mar 27, 2016 at 17:20 GMT


Do we remove this line or leave it in ? If we remove it I'll have to change the layout size in order to maintain the widget sizes.

RobinPetit commented 8 years ago

Comment by RobinPetit Sunday Mar 27, 2016 at 17:25 GMT


If we let this like that, I have a segfault systematically so we shouldn't. What should you change then?

RobinPetit commented 8 years ago

Comment by StanIsAdmin Sunday Mar 27, 2016 at 17:42 GMT


I'll change it :) I'll remove the spacing between achievements.