#328 Stage segmentation fault on unsubscribing interfaces

trunk
open
stage (111)
5
2012-12-16
2010-04-20
Daniel Dube
No

Stage crashes every time I unsubscribe an interface. Neither the type of the interface nor the type of the client seems to influence this behavior.

This bug can be reproduced by starting player with the worlds/simple.cfg configuration of stage. Now subscribe and then unsubscribe an interface. This causes a segmentation fault of the stage module on my system.

I'm using an Ubuntu 9.10. I reproduced this problem with stage version 3.2.2 and revision 8014. I also tested playerv, c++ and c player clients.

Gdb backtrace:
#0 0xb784e430 in __kernel_vsyscall ()
(gdb) bt
#0 0xb784e430 in __kernel_vsyscall ()
#1 0xb659e4d1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb65a1932 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb65d4ee5 in ?? () from /lib/tls/i686/cmov/libc.so.6
#4 0xb65deff1 in ?? () from /lib/tls/i686/cmov/libc.so.6
#5 0xb65e06f2 in ?? () from /lib/tls/i686/cmov/libc.so.6
#6 0xb65e37cd in free () from /lib/tls/i686/cmov/libc.so.6
#7 0xb3fc887e in ?? () from /usr/lib/dri/i965_dri.so
#8 0xb3fbc781 in brw_draw_prims () from /usr/lib/dri/i965_dri.so
#9 0xb40813ba in ?? () from /usr/lib/dri/i965_dri.so
#10 0xb3fa9f0f in intelBitmap () from /usr/lib/dri/i965_dri.so
#11 0xb4122c30 in _mesa_Bitmap () from /usr/lib/dri/i965_dri.so
#12 0xb401531f in ?? () from /usr/lib/dri/i965_dri.so
#13 0xb4015519 in _mesa_CallLists () from /usr/lib/dri/i965_dri.so
#14 0xb407860e in ?? () from /usr/lib/dri/i965_dri.so
#15 0xb42debec in gl_draw(char const*, int) () from /usr/lib/libfltk_gl.so.1.1
#16 0xb42dec6e in gl_draw(char const*) () from /usr/lib/libfltk_gl.so.1.1
#17 0xb447602f in Stg::Gl::draw_string (x=-8, y=0, z=0, str=0xbf9e5b0c "-8") at /home/dube/Projects/Rabot/Extlib/stage/libstage/gl.cc:69
#18 0xb44cab6d in Stg::Canvas::DrawGlobalGrid (this=0x8a5b438) at /home/dube/Projects/Rabot/Extlib/stage/libstage/canvas.cc:615
#19 0xb44cbece in Stg::Canvas::renderFrame (this=0x8a5b438) at /home/dube/Projects/Rabot/Extlib/stage/libstage/canvas.cc:897
#20 0xb44ce1f4 in Stg::Canvas::resize (this=0x8a5b438, X=-1080139776, Y=-1080140280, W=-1272671381, H=145070680) at /home/dube/Projects/Rabot/Extlib/stage/libstage/canvas.cc:1286
#21 0xb42d9a9a in Fl_Gl_Window::flush() () from /usr/lib/libfltk_gl.so.1.1
#22 0xb424a88b in Fl::flush() () from /usr/lib/libfltk.so.1.1
#23 0xb424ab11 in Fl::wait(double) () from /usr/lib/libfltk.so.1.1
#24 0xb424ac43 in Fl::wait() () from /usr/lib/libfltk.so.1.1
#25 0xb4525d10 in StgDriver::Update (this=0x8a56060) at /home/dube/Projects/Rabot/Extlib/stage/libstageplugin/p_driver.cc:592
#26 0xb74fa77b in DeviceTable::UpdateDevices (this=0x8a4b0a0) at /home/dube/Projects/Rabot/Extlib/player/libplayercore/devicetable.cc:255
#27 0x0804a7de in main (argc=2, argv=0xbf9e6194) at /home/dube/Projects/Rabot/Extlib/player/server/server.cc:350

Discussion

  • ben

    ben - 2010-05-03

    I don't know if it is the same bug.
    In world.cc .
    A event can be added to the event_queue . The model is then removed from the world.
    The model is not removed from the event queue. Thus on the ev.mod would cause seg fault.

        if\( ev.mod->subs > 0 \) // no subscriptions means the event is discarded
          ev.mod->Update\(\); // update the model
    

    When the model is removed instances in the event queue must be removed or something else needs to be used.

    Don't know how they would want this one fixed. It would be rather intrusive to fix it.

     
  • ben

    ben - 2010-05-03

    There is a pop from an empty queue . But I know how to reset the event handlers after a disconnected. I got rid of the exception this is also causing another bug.

     
  • Nobody/Anonymous

    I too have encountered this problem, and have found a workaround.

    When creating the Stage driver in your .CFG file (the bit of code where you attach the position2d interfaces, etc.), put:

    alwayson 1

    I'm suspecting that this flag tells Stage to not pop the interface from the queue when being unsubscribed, which, in turn, obviates the pop from the empty queue.

    Hope this helps in the mean time.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks