Subsurface planner: Crash on delete cylinder

Stefan Fuchs sfuchs at gmx.de
Fri Oct 20 06:57:23 PDT 2017


Am 20.10.2017 um 15:03 schrieb Stefan Fuchs:
> Am 20.10.2017 um 12:17 schrieb Willem Ferguson:
>> On 20/10/2017 11:19, Stefan Fuchs wrote:
>>> That's ugly. I found s.th. similar this morning also when deleting a
>>> cylinder but only in the merged dive I played with.
>>> Could come from my changes. I found already one bug and fixed it
>>> (see PRs) but that was not all - crash still there.
>>
>> Start Subsurface
>>
>> Select file -> New logbook
>>
>> Select Log -> Plan dive
>>
>> Mine starts with a single D12 AIR twinset being defined and a 20 min
>> dive at 15m.
>>
>> Add an AL80 cylinder with EAN50
>>
>> In nth Dive points table change the dive to 60 minutes at 20m
>> (results in awful profile)
>>
>> Delete EAN50 cylinder
>>
>> Crash
>>
> Odd. Usually I'm the one seeing all the crashes with my MXE Windows
> build. But not this one.
> Any new findings?
> Can you provide a screenshot of the full planner window with the setup?
>
> Meanwhile I will try another build flavor and then also Linux.
Ok, I have it in front of me now:
Seems to be nothing were we or I did really change s.th. during the last
days. But for sure what I did is that I implemented a few more triggers
for updates between the cylinder table and everything else in the
planner. That may have revealed an issue.

BT attached below.

>From my limited experience:
Is this s.th. coming from a race condition?
We do check in planner .c update_cylinder_pressure for "if (!cyl)", this
doesn't "fail" and then we crash a few lines later doing
"cyl->gas_used.mliter += gas_used.mliter;"


(gdb) run
Starting program:
/home/stefan/Entwicklung/Subsurface/subsurface/build/subsurface
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe58a0700 (LWP 14117)]
[New Thread 0x7fffd9c4b700 (LWP 14118)]
[New Thread 0x7fffd944a700 (LWP 14119)]
[New Thread 0x7fffd895b700 (LWP 14120)]
[New Thread 0x7fffcb694700 (LWP 14121)]
[New Thread 0x7fffc8bc1700 (LWP 14122)]
[New Thread 0x7fffc10b8700 (LWP 14123)]

Thread 1 "subsurface" received signal SIGSEGV, Segmentation fault.
0x000000000077586b in update_cylinder_pressure (d=0xc94080
<displayed_dive>, old_depth=0, new_depth=15000, duration=49,
    sac=20000, cyl=0xbc0cd8, in_deco=false) at
/home/stefan/Entwicklung/Subsurface/subsurface/core/planner.c:243
243        cyl->gas_used.mliter += gas_used.mliter;
(gdb) bt
#0  0x000000000077586b in update_cylinder_pressure (d=0xc94080
<displayed_dive>, old_depth=0, new_depth=15000, duration=49,
    sac=20000, cyl=0xbc0cd8, in_deco=false) at
/home/stefan/Entwicklung/Subsurface/subsurface/core/planner.c:243
#1  0x0000000000775d2d in create_dive_from_plan (diveplan=0xcd1580,
dive=0xc94080 <displayed_dive>, track_gas=true)
    at /home/stefan/Entwicklung/Subsurface/subsurface/core/planner.c:349
#2  0x0000000000776ae0 in plan (diveplan=0xcd1580, dive=0xc94080
<displayed_dive>, timestep=60,
    decostoptable=0x7fffffffc440, cached_datap=0x7fffffffc400,
is_planner=true, show_disclaimer=false)
    at /home/stefan/Entwicklung/Subsurface/subsurface/core/planner.c:693
#3  0x0000000000710038 in DivePlannerPointsModel::createTemporaryPlan
(this=0xcd1570)
    at
/home/stefan/Entwicklung/Subsurface/subsurface/qt-models/diveplannermodel.cpp:922
#4  0x00000000006d5869 in ProfileWidget2::plotDive (this=0x1350db0,
d=0x0, force=true)
    at
/home/stefan/Entwicklung/Subsurface/subsurface/profile-widget/profilewidget2.cpp:587
#5  0x00000000006d456b in ProfileWidget2::replot (this=0x1350db0, d=0x0)
    at
/home/stefan/Entwicklung/Subsurface/subsurface/profile-widget/profilewidget2.cpp:397
#6  0x0000000000704cd0 in ProfileWidget2::qt_static_metacall
(_o=0x1350db0, _c=QMetaObject::InvokeMetaMethod, _id=17,
    _a=0x7fffffffc970) at
/home/stefan/Entwicklung/Subsurface/subsurface/build/profile-widget/moc_profilewidget2.cpp:236
#7  0x00007ffff546dd2a in QMetaObject::activate(QObject*, int, int,
void**) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff54e9e2c in QAbstractItemModel::dataChanged(QModelIndex
const&, QModelIndex const&, QVector<int> const&) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x000000000070e33b in DivePlannerPointsModel::emitDataChanged
(this=0xcd1570)
    at
/home/stefan/Entwicklung/Subsurface/subsurface/qt-models/diveplannermodel.cpp:419
#10 0x000000000070dd39 in DivePlannerPointsModel::cylinderRenumber
(this=0xcd1570, mapping=0x7fffffffcb00)
    at
/home/stefan/Entwicklung/Subsurface/subsurface/qt-models/diveplannermodel.cpp:363
#11 0x000000000070b20e in CylindersModel::remove (this=0x1485350, index=...)
    at
/home/stefan/Entwicklung/Subsurface/subsurface/qt-models/cylindermodel.cpp:589
#12 0x000000000073b3bc in CylindersModel::qt_static_metacall
(_o=0x1485350, _c=QMetaObject::InvokeMetaMethod, _id=0,
    _a=0x7fffffffccc0) at
/home/stefan/Entwicklung/Subsurface/subsurface/build/qt-models/moc_cylindermodel.cpp:74
#13 0x00007ffff546dd2a in QMetaObject::activate(QObject*, int, int,
void**) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff68e07f5 in QAbstractItemView::clicked(QModelIndex const&) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff68e47d3 in
QAbstractItemView::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff66cafc8 in QWidget::event(QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007ffff67c9b8e in QFrame::event(QEvent*) () from
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007ffff68ef6db in QAbstractItemView::viewportEvent(QEvent*) ()
from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff543f172 in
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff668803c in QApplicationPrivate::notify_helper(QObject*,
QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff668dc19 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff543f38b in QCoreApplication::notifyInternal(QObject*,
QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007ffff668cb32 in QApplicationPrivate::sendMouseEvent(QWidget*,
QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)
() from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff66e55bb in ?? () from
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ffff66e7b7b in ?? () from
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007ffff668805c in QApplicationPrivate::notify_helper(QObject*,
QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#27 0x00007ffff668d516 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007ffff543f38b in QCoreApplication::notifyInternal(QObject*,
QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007ffff5d074e1 in
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)
()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#30 0x00007ffff5d091a5 in
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)
() from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#31 0x00007ffff5cecf08 in
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#32 0x00007fffe7e27200 in ?? () from
/usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#33 0x00007ffff290c197 in g_main_context_dispatch () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007ffff290c3f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007ffff290c49c in g_main_context_iteration () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#36 0x00007ffff54957cf in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#37 0x00007ffff543cb4a in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#38 0x00007ffff5444bec in QCoreApplication::exec() () from
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#39 0x000000000059825b in run_ui () at
/home/stefan/Entwicklung/Subsurface/subsurface/subsurface-desktop-helper.cpp:46
#40 0x0000000000596fe2 in main (argc=1, argv=0x7fffffffde58)
    at
/home/stefan/Entwicklung/Subsurface/subsurface/subsurface-desktop-main.cpp:115
(gdb)



-- 

Stefan Fuchs
E-Mail: sfuchs at gmx.de <mailto:sfuchs at gmx.de>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171020/a8e5f318/attachment.html>


More information about the subsurface mailing list