thirtythreeforty / bullycpp

A Bully Bootloader PC driver program
GNU General Public License v3.0
12 stars 6 forks source link

Crash in dataXfer #6

Closed bjones1 closed 9 years ago

bjones1 commented 9 years ago

In the dataXfer branch, I find that invoking variableUpdated when u_index > 0 causes a crash. Removing all code from variableUpdated eliminates the crash. Any ideas?

thirtythreeforty commented 9 years ago

According to the debugging backtrace, this occurs due to the assert in line 70 of DataXferWrap.cpp in 3ca9bc6. It seems that the table emits a signal when I modify it. I was not expecting this signal (expecting only the user to generate it); I'll fix it.

thirtythreeforty commented 9 years ago
#0  0x00007ffff5cce4b7 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff5ccf88a in abort () from /usr/lib/libc.so.6
#2  0x00007ffff65b9fcd in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6
#3  0x00007ffff65b7e56 in __cxxabiv1::__terminate(void (*)()) () from /usr/lib/libstdc++.so.6
#4  0x00007ffff65b7ea1 in std::terminate() () from /usr/lib/libstdc++.so.6
#5  0x00007ffff65b80b8 in __cxa_throw () from /usr/lib/libstdc++.so.6
#6  0x000000000041c194 in DataXferWrap::variableEdited (this=0x7fffffffdab0, u_index=2, newValue="test") at ../src/dataxfer/DataXferWrap.cpp:70
#7  0x00000000004291cf in QtDataXfer::updateItemVariable (this=0x7fffffffda98, item=0x8383a0) at ../src/QtDataXfer.cpp:102
#8  0x000000000042981a in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QTableWidgetItem*>, void, void (QtDataXfer::*)(QTableWidgetItem*)>::call (f=
    (void (QtDataXfer::*)(QtDataXfer * const, QTableWidgetItem *)) 0x429170 <QtDataXfer::updateItemVariable(QTableWidgetItem*)>, o=0x7fffffffda98, arg=0x7fffffffcfe0)
    at /usr/include/qt/QtCore/qobjectdefs_impl.h:500
#9  0x000000000042979c in QtPrivate::FunctionPointer<void (QtDataXfer::*)(QTableWidgetItem*)>::call<QtPrivate::List<QTableWidgetItem*>, void> (f=
    (void (QtDataXfer::*)(QtDataXfer * const, QTableWidgetItem *)) 0x429170 <QtDataXfer::updateItemVariable(QTableWidgetItem*)>, o=0x7fffffffda98, arg=0x7fffffffcfe0)
    at /usr/include/qt/QtCore/qobjectdefs_impl.h:519
#10 0x0000000000429709 in QtPrivate::QSlotObject<void (QtDataXfer::*)(QTableWidgetItem*), QtPrivate::List<QTableWidgetItem*>, void>::impl (which=1, this_=0x877530, r=0x7fffffffda98, 
    a=0x7fffffffcfe0, ret=0x0) at /usr/include/qt/QtCore/qobject_impl.h:143
#11 0x00007ffff6fdfc9a in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#12 0x00007ffff7b5fae2 in QTableWidget::itemChanged(QTableWidgetItem*) () from /usr/lib/libQt5Widgets.so.5
#13 0x00007ffff7b60eab in ?? () from /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff6fe0309 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#15 0x00007ffff705c20c in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /usr/lib/libQt5Core.so.5
#16 0x00007ffff7b66e4d in ?? () from /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff7b67621 in QTableWidget::setItem(int, int, QTableWidgetItem*) () from /usr/lib/libQt5Widgets.so.5
#18 0x0000000000428d39 in QtDataXfer::variableUpdated (this=0x7fffffffda98, index=2, name="test", description="test", value="test", modifiable=false) at ../src/QtDataXfer.cpp:53
#19 0x000000000041f52f in MainWindow::MainWindow (this=0x7fffffffd9f0, parser=..., parent=0x0) at ../src/MainWindow.cpp:153
#20 0x0000000000419552 in main (argc=1, argv=0x7fffffffdf88) at ../src/bullycpp.cpp:43
bjones1 commented 9 years ago

Thanks for the helpful debug. I'm still getting my debugger set up, unfortunately...

thirtythreeforty commented 9 years ago

There you go. Merge my dataXfer branch (or cherry-pick that commit) and that should fix it. You'll have a couple unrelated merge conflicts if you merge, so it might be better to cherry-pick it.

thirtythreeforty commented 9 years ago

Alternately, merge my dataxfer_merged branch, which I just pushed. I already handled the merge to test the fix; no reason for you to have to do it as well.

bjones1 commented 9 years ago

Nice, thanks!