Undo Segfault

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Undo Segfault

Eric
Ries,

Another one for you.  This occurs at the tip of your SVN trunk as well as with the release candidate that I am running.  When I do an undo, the very next action moving forward invariably causes Librecad to segfault.  This happened to me several times last night, so I thought I would get you a backtrace on it.  Here is what I have:

#0  0x088d97c2 in ?? ()
#1  0x0809887c in RS_Document::startUndoCycle (this=0x8888e90)
    at src/lib/engine/rs_document.h:135
#2  0x081671f8 in RS_ActionDrawLine::trigger (this=0x887bcf0)
    at src/actions/rs_actiondrawline.cpp:89
#3  0x081677af in RS_ActionDrawLine::coordinateEvent (this=0x887bcf0,
    e=0xbfffe2b4) at src/actions/rs_actiondrawline.cpp:157
#4  0x0816752d in RS_ActionDrawLine::mouseReleaseEvent (this=0x887bcf0,
    e=0xbfffe8e4) at src/actions/rs_actiondrawline.cpp:125
#5  0x081143a0 in RS_EventHandler::mouseReleaseEvent (this=0x8878a28,
    e=0xbfffe8e4) at src/lib/gui/rs_eventhandler.cpp:123
#6  0x08118184 in RS_GraphicView::mouseReleaseEvent (this=0x872fd54,
    e=0xbfffe8e4) at src/lib/gui/rs_graphicview.cpp:338
#7  0x081de7b4 in QG_GraphicView::mouseReleaseEvent (this=0x872fd40,
    e=0xbfffe8e4) at src/ui/qg_graphicview.cpp:337
#8  0xb731813a in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#9  0xb72bfd24 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#10 0xb72c5201 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#11 0xb70550bb in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/libQtCore.so.4
#12 0xb72c0c3b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QW---Type <return> to continue, or q <return> to quit---
idget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/libQtGui.so.4
#13 0xb734a2bc in ?? () from /usr/lib/libQtGui.so.4
#14 0xb7348746 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/libQtGui.so.4
#15 0xb7373b84 in ?? () from /usr/lib/libQtGui.so.4
#16 0xb697caa8 in g_main_context_dispatch ()
   from /lib/i386-linux-gnu/libglib-2.0.so.0
#17 0xb697d270 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#18 0xb697d524 in g_main_context_iteration ()
   from /lib/i386-linux-gnu/libglib-2.0.so.0
#19 0xb708253c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#20 0xb7373775 in ?? () from /usr/lib/libQtGui.so.4
#21 0xb7054289 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#22 0xb7054522 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQtCore.so.4
#23 0xb7058ecc in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#24 0xb72bd8e7 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#25 0x082ad156 in main (argc=1, argv=0xbffff384) at src/main/main.cpp:264

It looks to me like 'u' is corrupted the second time it gets to line 112 in src/lib/engine/rs_undo.cpp.
Reply | Threaded
Open this post in threaded view
|

Re: Undo Segfault

R. van Twisk
Administrator
Eric,

thanks for the report.

Ries

On Jul 3, 2011, at 11:51 AM, Eric [via LibreCAD] wrote:

Ries,

Another one for you.  This occurs at the tip of your SVN trunk as well as with the release candidate that I am running.  When I do an undo, the very next action moving forward invariably causes Librecad to segfault.  This happened to me several times last night, so I thought I would get you a backtrace on it.  Here is what I have:

#0  0x088d97c2 in ?? ()
#1  0x0809887c in RS_Document::startUndoCycle (this=0x8888e90)
    at src/lib/engine/rs_document.h:135
#2  0x081671f8 in RS_ActionDrawLine::trigger (this=0x887bcf0)
    at src/actions/rs_actiondrawline.cpp:89
#3  0x081677af in RS_ActionDrawLine::coordinateEvent (this=0x887bcf0,
    e=0xbfffe2b4) at src/actions/rs_actiondrawline.cpp:157
#4  0x0816752d in RS_ActionDrawLine::mouseReleaseEvent (this=0x887bcf0,
    e=0xbfffe8e4) at src/actions/rs_actiondrawline.cpp:125
#5  0x081143a0 in RS_EventHandler::mouseReleaseEvent (this=0x8878a28,
    e=0xbfffe8e4) at src/lib/gui/rs_eventhandler.cpp:123
#6  0x08118184 in RS_GraphicView::mouseReleaseEvent (this=0x872fd54,
    e=0xbfffe8e4) at src/lib/gui/rs_graphicview.cpp:338
#7  0x081de7b4 in QG_GraphicView::mouseReleaseEvent (this=0x872fd40,
    e=0xbfffe8e4) at src/ui/qg_graphicview.cpp:337
#8  0xb731813a in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#9  0xb72bfd24 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#10 0xb72c5201 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/libQtGui.so.4
#11 0xb70550bb in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/libQtCore.so.4
#12 0xb72c0c3b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QW---Type <return> to continue, or q <return> to quit---
idget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/libQtGui.so.4
#13 0xb734a2bc in ?? () from /usr/lib/libQtGui.so.4
#14 0xb7348746 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/libQtGui.so.4
#15 0xb7373b84 in ?? () from /usr/lib/libQtGui.so.4
#16 0xb697caa8 in g_main_context_dispatch ()
   from /lib/i386-linux-gnu/libglib-2.0.so.0
#17 0xb697d270 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#18 0xb697d524 in g_main_context_iteration ()
   from /lib/i386-linux-gnu/libglib-2.0.so.0
#19 0xb708253c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#20 0xb7373775 in ?? () from /usr/lib/libQtGui.so.4
#21 0xb7054289 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#22 0xb7054522 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/libQtCore.so.4
#23 0xb7058ecc in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#24 0xb72bd8e7 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#25 0x082ad156 in main (argc=1, argv=0xbffff384) at src/main/main.cpp:264

It looks to me like 'u' is corrupted the second time it gets to line 112 in src/lib/engine/rs_undo.cpp.



If you reply to this email, your message will be added to the discussion below:
http://librecad.1049103.n5.nabble.com/Undo-Segfault-tp4547570p4547570.html
To start a new topic under LibreCAD, email [hidden email]
To unsubscribe from LibreCAD, click here.

Reply | Threaded
Open this post in threaded view
|

Re: Undo Segfault

Rallaz
I have found the bug in my commit  dffcc33cec204ace9280 (11-06-2011), send a pull request.

Eric:
could you test more exhaustively if it is corrected?

Rallaz

PS this is the patch:

             do {
                 if (!( l->undoables.isEmpty()) )
                     u = l->undoables.first();
+                else
+                   u = NULL;
                 if (u!=NULL) {
                     // Remove the pointer from _all_ cycles:
                                         for (int i = 0; i < undoList.size(); ++i) {
Reply | Threaded
Open this post in threaded view
|

Re: Undo Segfault

Eric
It looks like it works.  I tried various permutations of undo and redo with no bad effects.  Thanks for the quick turnaround, that one was a bit annoying :).

Eric
Reply | Threaded
Open this post in threaded view
|

Re: Undo Segfault

R. van Twisk
Administrator
Thanks Rallaz for taking care of this from me!

Ries
On Jul 5, 2011, at 5:27 PM, Eric [via LibreCAD] wrote:

It looks like it works.  I tried various permutations of undo and redo with no bad effects.  Thanks for the quick turnaround, that one was a bit annoying :).

Eric



If you reply to this email, your message will be added to the discussion below:
http://librecad.1049103.n5.nabble.com/Undo-Segfault-tp4547570p4555006.html
To start a new topic under LibreCAD, email [hidden email]
To unsubscribe from LibreCAD, click here.

Reply | Threaded
Open this post in threaded view
|

Re: Undo Segfault

Rallaz
2011/7/6 R. van Twisk [via LibreCAD]
<[hidden email]>:
> Thanks Rallaz for taking care of this from me!
> Ries

No problem,
The fault is mine and also the solution ;)

Rallaz