Segfault and what's cylinder "use" used for in the planner?

Rick Walsh rickmwalsh at gmail.com
Thu Apr 28 01:25:44 PDT 2016


Hi,

I was just looking at the layout of the planner, and realized that I
couldn't find a use for the use field in the available gasses table.

We determine whether or not a segment is closed circuit by whether a
setpoint has been set in the dive planner points table.  It doesn't look
like we actually use the cylinder use value.

Can it be removed?

Furthermore, the only way I could find to set the value is to type in the
number (0-7) corresponding to the enum.  There's no drop-down of options,
and typing the name of the value doesn't work.  There's also a lovely
segfault when I enter the value 8 (or any value greater than 7).  If I
enter a negative number, the text becomes one of the default dive tags.
Yay memory.  Segfault with value 8.

(gdb) bt
#0  0x00007ffff0e5db3a in strlen () from /lib64/libc.so.6
#1  0x00007ffff1a097c0 in QByteArray::QByteArray(char const*, int) () from
/lib64/libQt5Core.so.5
#2  0x00000000006d0105 in gettextFromC::trGettext (this=0xcf5d50, text=0xd1
<error: Cannot access memory at address 0xd1>)
    at /home/rick/src/subsurface/core/gettextfromc.cpp:7
#3  0x000000000065470a in CylindersModel::data (this=0xec1020, index=...,
role=2) at /home/rick/src/subsurface/qt-models/cylindermodel.cpp:138
#4  0x00007ffff4eb2e20 in QStyledItemDelegate::setEditorData(QWidget*,
QModelIndex const&) const () from /lib64/libQt5Widgets.so.5
#5  0x00007ffff4e343c3 in QAbstractItemView::dataChanged(QModelIndex
const&, QModelIndex const&, QVector<int> const&) () from
/lib64/libQt5Widgets.so.5
#6  0x00007ffff4e33378 in QAbstractItemView::qt_static_metacall(QObject*,
QMetaObject::Call, int, void**) () from /lib64/libQt5Widgets.so.5
#7  0x00007ffff1c060a0 in QMetaObject::activate(QObject*, int, int, void**)
() from /lib64/libQt5Core.so.5
#8  0x00007ffff1c7eb8c in QAbstractItemModel::dataChanged(QModelIndex
const&, QModelIndex const&, QVector<int> const&) () from
/lib64/libQt5Core.so.5
#9  0x0000000000655c73 in CylindersModel::setData (this=0xec1020,
index=..., value=..., role=2) at
/home/rick/src/subsurface/qt-models/cylindermodel.cpp:283
#10 0x00007ffff4eb2cb1 in QStyledItemDelegate::setModelData(QWidget*,
QAbstractItemModel*, QModelIndex const&) const () from
/lib64/libQt5Widgets.so.5
#11 0x00007ffff4e32ea2 in QAbstractItemView::commitData(QWidget*) () from
/lib64/libQt5Widgets.so.5
#12 0x00007ffff4e334f0 in QAbstractItemView::qt_static_metacall(QObject*,
QMetaObject::Call, int, void**) () from /lib64/libQt5Widgets.so.5
#13 0x00007ffff1c060a0 in QMetaObject::activate(QObject*, int, int, void**)
() from /lib64/libQt5Core.so.5
#14 0x00007ffff4e795af in QAbstractItemDelegate::commitData(QWidget*) ()
from /lib64/libQt5Widgets.so.5
#15 0x00007ffff4e79e25 in
QAbstractItemDelegatePrivate::_q_commitDataAndCloseEditor(QWidget*) () from
/lib64/libQt5Widgets.so.5
#16 0x00007ffff4e79f98 in
QAbstractItemDelegate::qt_static_metacall(QObject*, QMetaObject::Call, int,
void**) () from /lib64/libQt5Widgets.so.5
#17 0x00007ffff1c06ed9 in QObject::event(QEvent*) () from
/lib64/libQt5Core.so.5
#18 0x00007ffff4bd4c0c in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /lib64/libQt5Widgets.so.5
#19 0x00007ffff4bd9e96 in QApplication::notify(QObject*, QEvent*) () from
/lib64/libQt5Widgets.so.5
#20 0x00007ffff1bd9968 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /lib64/libQt5Core.so.5
#21 0x00007ffff1bdb82a in
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
from /lib64/libQt5Core.so.5
#22 0x00007ffff1c2e8e3 in postEventSourceDispatch(_GSource*, int
(*)(void*), void*) () from /lib64/libQt5Core.so.5
#23 0x00007fffebdb7e3a in g_main_dispatch (context=0x7fffd40016f0) at
gmain.c:3154
#24 g_main_context_dispatch (context=context at entry=0x7fffd40016f0) at
gmain.c:3769
#25 0x00007fffebdb81d0 in g_main_context_iterate
(context=context at entry=0x7fffd40016f0,
block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>)
    at gmain.c:3840
#26 0x00007fffebdb827c in g_main_context_iteration (context=0x7fffd40016f0,
may_block=1) at gmain.c:3901
#27 0x00007ffff1c2ecef in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /lib64/libQt5Core.so.5
#28 0x00007ffff1bd76ea in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/lib64/libQt5Core.so.5
#29 0x00007ffff1bdfddc in QCoreApplication::exec() () from
/lib64/libQt5Core.so.5
#30 0x000000000050aae9 in run_ui () at
/home/rick/src/subsurface/subsurface-desktop-helper.cpp:45
#31 0x0000000000509a41 in main (argc=2, argv=0x7fffffffdd68) at
/home/rick/src/subsurface/subsurface-desktop-main.cpp:107


Cheers,

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160428/027e21e5/attachment.html>


More information about the subsurface mailing list