exporl / apex

APEX 4: software platform for auditory behavioural and psychophysical experiments. This repository follows the major releases of APEX.
http://kuleuven.be/exporl/apex/
Other
10 stars 2 forks source link

SPIN: crash without channel with both speech and noise #181

Closed mh21 closed 7 years ago

mh21 commented 7 years ago

double spin::data::SpinUserSettings::snr() const: called without a suitable channel with both speech and noise

3 0x00007ff1c58e6670 in spin::data::SpinUserSettings::snr() const (this=0x7ffd5bc8d0d8)

at spinusersettings.cpp:485

4 0x00007ff1c58dc40d in spin::SpinExperimentCreator::createFiltersData() const (this=0x7ffd5bc8d060)

at spinexperimentcreator.cpp:491

5 0x00007ff1c58d970d in spin::SpinExperimentCreator::createExperimentData() const (this=0x7ffd5bc8d060)

at spinexperimentcreator.cpp:102

6 0x00007ff1c58d9480 in spin::SpinExperimentCreator::createExperimentFile(QString const&) const (this=0x7ffd5bc8d060, fileName=...) at spinexperimentcreator.cpp:76

7 0x00007ff1c58c21fc in spin::gui::SpinDialog::createExperiment() (this=0x7ffd5bc8e080) at spindialog.cpp:485

8 0x00007ff1c58c1c31 in spin::gui::SpinDialog::validateCurrentPage() (this=0x7ffd5bc8e080) at spindialog.cpp:428

croissanne commented 7 years ago

There are other ways you can make the dialog fail too:

Thread 1 "apex" received signal SIGSEGV, Segmentation fault.
QTableWidgetItem::text (this=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtablewidget.h:97
97          { return data(Qt::DisplayRole).toString(); }
(gdb) bt
#0  QTableWidgetItem::text (this=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtablewidget.h:97
#1  0x00007fffc4e6592e in spin::gui::SpinDialog::currentSettings (this=0x7fffffffc5a8) at spindialog.cpp:388
#2  0x00007fffc4e6600d in spin::gui::SpinDialog::createExperiment (this=0x7fffffffc5a8) at spindialog.cpp:438
#3  0x00007fffc4e65f9b in spin::gui::SpinDialog::validateCurrentPage (this=0x7fffffffc5a8) at spindialog.cpp:428

There is no proper validation of the input when creating the experiment (and the qfatal is a pretty unhelpful way of handling it).

So either proper validation between each page that let's the user know about an invalid setting or reasonable defaults (or both)?

croissanne commented 7 years ago

Another one:

#3  0x00007fffc4e8d577 in spin::data::SpinUserSettings::snr (this=0x7fffffffb510) at spinusersettings.cpp:511
#4  0x00007fffc4e80504 in spin::SpinExperimentCreator::createProcedureConfig (this=0x7fffffffb498)
    at spinexperimentcreator.cpp:270
#5  0x00007fffc4e7ebd3 in spin::SpinExperimentCreator::createExperimentData (this=0x7fffffffb498)
    at spinexperimentcreator.cpp:100
#6  0x00007fffc4e7e951 in spin::SpinExperimentCreator::createExperimentFile (this=0x7fffffffb498, fileName=...)
    at spinexperimentcreator.cpp:76
#7  0x00007fffc4e66894 in spin::gui::SpinDialog::createExperiment (this=0x7fffffffc5a8) at spindialog.cpp:485
#8  0x00007fffc4e65f9b in spin::gui::SpinDialog::validateCurrentPage (this=0x7fffffffc5a8) at spindialog.cpp:428
tomfrancart commented 7 years ago

I'm afraid the SPIN data structures need some refactoring. The main problem is that we allow different noise levels on different noise channels, which complicates things terribly, and which does not have many (any?) practical uses. I suggest that unless these are one-line fixes, to leave this for now, and do a proper refactory later on.

croissanne commented 7 years ago

2507 replaced qfatals with exceptions and just catch them in the dialog when trying to create an experiment.