Menu

#385 Crash using data range selector in graphs with linear fit

next
fixed
nobody
None
1fatal
2019-08-09
2019-05-23
Fellype
No

SciDAVis crashes when data range selector is used in a graph with a non-linear curve and a linear fit.

The attached project can be used to reproduce the bug. Just click on the "Select data range" button and click on one point of the non-linear curve -> a crash will occur.

The error shown in the command line is:

ASSERT failure in QVector<t>::operator[]: "index out of range", file /usr/lib64/qt/include/QtCore/qvector.h, line 355
Aborted</t>

Observed in version 1.25, built from source, only on Slackware Linux (Qt4 + python 2)

1 Attachments

Discussion

  • High Performance Coder

    • status: open --> closed
     
  • High Performance Coder

    Yes - the code hits an out of range assertion. Doesn't apparently cause harm on the relase build, but there could still be subtle errors occuring then too.

    Coding should be done defensively, so I have added code to check for out of range condition and return without doing anything. It does raise the question of how you generated an index to a nonexistent curve in the first place, but that would be easy enough to do on the python interface.

     
    • Fellype

      Fellype - 2019-05-24

      Russell,
      I built the latest git version (from branch master) and the crash still occurring.

       
  • High Performance Coder

    • status: closed --> fixed
     
  • High Performance Coder

    Yes - the code hits an out of range assertion. Doesn't apparently cause harm on the relase build, but there could still be subtle errors occuring then too.

    Coding should be done defensively, so I have added code to check for out of range condition and return without doing anything. It does raise the question of how you generated an index to a nonexistent curve in the first place, but that would be easy enough to do on the python interface.

     
  • High Performance Coder

    reopening this untile conversation resolved

     
  • High Performance Coder

    WTF has happened to my response!!!!

     
  • High Performance Coder

    Reposting the response....

    That sciprj file is no longer crashing for me, in either debug or
    release builds.

    Do you have an updated project file?

    Cheers

     
    • Fellype

      Fellype - 2019-05-27

      Russell, here follows more information that I get running in debug mode:

      ASSERT failure in QVector<t>::operator[]: "index out of range", file /usr/lib64/qt/include/QtCore/qvector.h, line 355</t>

      Thread 1 "scidavis" received signal SIGABRT, Aborted.
      0x00007ffff39263f8 in raise () from /lib64/libc.so.6
      (gdb) bt

      0 0x00007ffff39263f8 in raise () at /lib64/libc.so.6

      1 0x00007ffff3927ffa in abort () at /lib64/libc.so.6

      2 0x00007ffff47f3d3d in qt_message_output(QtMsgType, char const*) () at /usr/lib64/qt/lib/libQtCore.so.4

      3 0x00007ffff47f3e85 in () at /usr/lib64/qt/lib/libQtCore.so.4

      4 0x00007ffff47f46d4 in qFatal(char const*, ...) () at /usr/lib64/qt/lib/libQtCore.so.4

      5 0x00007ffff7b76ac8 in QwtArrayData::y(unsigned long) const () at /usr/lib/libqwt5.so.5

      6 0x0000000000663f92 in RangeSelectorTool::pointSelected(QPoint const&) ()

      7 0x00007ffff7b64d80 in QwtPicker::transition(QEvent const*) () at /usr/lib/libqwt5.so.5

      8 0x00007ffff7b63668 in QwtPicker::eventFilter(QObject, QEvent) () at /usr/lib/libqwt5.so.5

      9 0x00007ffff4903d76 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject, QEvent) ()

      at /usr/lib64/qt/lib/libQtCore.so.4
      

      10 0x00007ffff51c146c in QApplicationPrivate::notify_helper(QObject, QEvent) ()

      at /usr/lib64/qt/lib/libQtGui.so.4
      

      11 0x00007ffff51c80c3 in QApplication::notify(QObject, QEvent) () at /usr/lib64/qt/lib/libQtGui.so.4

      12 0x00000000004558fc in Application::notify(QObject, QEvent) ()

      13 0x00007ffff4903c0d in QCoreApplication::notifyInternal(QObject, QEvent) ()

      at /usr/lib64/qt/lib/libQtCore.so.4
      

      14 0x00007ffff51c775d in QApplicationPrivate::sendMouseEvent(QWidget, QMouseEvent, QWidget, QWidget, QWidget**, QPointer<qwidget>&, bool) () at /usr/lib64/qt/lib/libQtGui.so.4</qwidget>

      15 0x00007ffff523eaf9 in () at /usr/lib64/qt/lib/libQtGui.so.4

      16 0x00007ffff523cdf5 in QApplication::x11ProcessEvent(_XEvent*) () at /usr/lib64/qt/lib/libQtGui.so.4

      17 0x00007ffff5264942 in () at /usr/lib64/qt/lib/libQtGui.so.4

      18 0x00007fffef8e3797 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0

      19 0x00007fffef8e39c8 in () at /usr/lib64/libglib-2.0.so.0

      20 0x00007fffef8e3a6c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0

      21 0x00007ffff49320ce in QEventDispatcherGlib::processEvents(QFlags<qeventloop::processeventsflag>) ()</qeventloop::processeventsflag>

      at /usr/lib64/qt/lib/libQtCore.so.4
      

      22 0x00007ffff52649e6 in () at /usr/lib64/qt/lib/libQtGui.so.4

      ---Type <return> to continue, or q <return> to quit---</return></return>

      23 0x00007ffff49025d1 in QEventLoop::processEvents(QFlags<qeventloop::processeventsflag>) ()</qeventloop::processeventsflag>

      at /usr/lib64/qt/lib/libQtCore.so.4
      

      24 0x00007ffff49028e5 in QEventLoop::exec(QFlags<qeventloop::processeventsflag>) ()</qeventloop::processeventsflag>

      at /usr/lib64/qt/lib/libQtCore.so.4
      

      25 0x00007ffff4907ec9 in QCoreApplication::exec() () at /usr/lib64/qt/lib/libQtCore.so.4

      26 0x0000000000453637 in main ()

      (gdb)

       
  • High Performance Coder

    Hi Fellype, could you tell me please what you're doing to trigger the assertion? Just loading the above .sciprj file does not trigger it on the current head.

     
    • Fellype

      Fellype - 2019-05-27

      Russell,
      The steps to reproduce the crash after load the project file are:
      - click on the data range selector button;
      - click on a point of the curve "T_2"

      It is always reproducible here.
      Regards

       
  • High Performance Coder

    One question: What is a "data range selector button"? What does it look like?

    I click on one of the dots (labelled "T_2" in the legend), and it brings up the following dialog, as shown in the attached image. No crash.

     
  • High Performance Coder

    Stumped me for a while until I realised that View>Toolbars>Graph enables those icons. Alternatively, Alt-S or Tools>Select Data Range.

    However, it doesn't crash for me! weird...

     
  • gbm

    gbm - 2019-08-09

    It doesn't crash for me either, but it was not working as intended.
    Please try attached patch.

     
    • Fellype

      Fellype - 2019-08-09

      Miquel,
      This patch solves the problem. Thanks.

       

Log in to post a comment.