Ticket #6886 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Crash if replacing a TableWorkspace with one having more columns

Reported by: Russell Taylor Owned by: Roman Tolchenov
Priority: critical Milestone: Release 2.6
Component: MantidPlot Keywords:
Cc: Blocked By:
Blocking: Tester: Karl Palmen

Description

This crash occurs if you are viewing the table at the point of replacement.

Steps to reproduce:

t = CreateEmptyTableWorkspace()
t.addColumn('int','a')
t.addRow([0])

Double-click on the workspace at this point to bring it up (showing just a single cell)

t.addColumn('int','b')
t = CloneWorkspace(t)

The crash in this case is at line 874 of Table.cpp because you try to go past the end of the col_label container. Stack trace:

#4  0x00000030a4e6a075 in qFatal(char const*, ...) ()
   from /usr/lib64/libQtCore.so.4
#5  0x00000000006dcc3b in QList<QString>::operator[] (this=0x3193528, i=1)
    at /usr/include/QtCore/qlist.h:447
#6  0x000000000090f0a3 in Table::setColName (this=0x3193480, col=1, text=..., 
    enumerateRight=false)
    at /home/tr9/Mantid/Code/Mantid/MantidPlot/src/Table.cpp:874
#7  0x00000000009f7d4d in MantidTable::fillTable (this=0x3193480)
    at /home/tr9/Mantid/Code/Mantid/MantidPlot/src/Mantid/MantidTable.cpp:72
#8  0x0000000000ae2f05 in MantidTable::qt_metacall (this=0x3193480, _c=
    QMetaObject::InvokeMetaMethod, _id=5, _a=0x7fffffffcdb0)
    at /home/tr9/Mantid/Code/debug/MantidPlot/src/Mantid/moc_MantidTable.cxx:90
#9  0x00000030a4f6a7af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#10 0x0000000000ae2f73 in MantidTable::needToUpdate (this=0x3193480)
    at /home/tr9/Mantid/Code/debug/MantidPlot/src/Mantid/moc_MantidTable.cxx:108

In a more complicated example (the output from SumEventsByLogValue), the failure point is slightly different:

#4  0x00000030a4e6a075 in qFatal(char const*, ...) ()
   from /usr/lib64/libQtCore.so.4
#5  0x00000000006dcca9 in QList<int>::operator[] (this=0x40a5838, i=17)
    at /usr/include/QtCore/qlist.h:447
#6  0x000000000091ab2a in Table::setHeaderColType (this=0x40a5780)
    at /home/tr9/Mantid/Code/Mantid/MantidPlot/src/Table.cpp:2219
#7  0x000000000090f7d1 in Table::setColName (this=0x40a5780, col=4, text=..., 
    enumerateRight=false)
    at /home/tr9/Mantid/Code/Mantid/MantidPlot/src/Table.cpp:910
#8  0x00000000009f7d4d in MantidTable::fillTable (this=0x40a5780)
    at /home/tr9/Mantid/Code/Mantid/MantidPlot/src/Mantid/MantidTable.cpp:72

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.5 to Release 2.6

Moved to r2.6 at the end of r2.5

comment:2 Changed 7 years ago by Nick Draper

  • Owner set to Roman Tolchenov
  • Status changed from new to assigned

comment:3 Changed 7 years ago by Roman Tolchenov

  • Status changed from assigned to accepted

comment:4 Changed 7 years ago by Roman Tolchenov

Changed setNumCols to resizeCols in MantidTable. Re #6886.

Changeset: ba5ad709cb6d83f412d22753e30cd2ab7c3ab72b

comment:5 Changed 7 years ago by Roman Tolchenov

Changed setNumCols to resizeCols in MantidTable. Re #6886.

Changeset: ba5ad709cb6d83f412d22753e30cd2ab7c3ab72b

comment:6 Changed 7 years ago by Roman Tolchenov

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:7 Changed 7 years ago by Karl Palmen

  • Status changed from verify to verifying
  • Tester set to Karl Palmen

comment:8 Changed 7 years ago by Karl Palmen

  • Status changed from verifying to closed

Also successful with a larger TableWorkspace created by part of a tube calibration script.

comment:9 Changed 7 years ago by Roman Tolchenov

Changed setNumCols to resizeCols in MantidTable. Re #6886.

Changeset: ba5ad709cb6d83f412d22753e30cd2ab7c3ab72b

comment:10 Changed 7 years ago by Roman Tolchenov

Changed setNumCols to resizeCols in MantidTable. Re #6886.

Changeset: ba5ad709cb6d83f412d22753e30cd2ab7c3ab72b

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7732

Note: See TracTickets for help on using tickets.