Closed mh21 closed 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)?
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
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.
2507 replaced qfatals with exceptions and just catch them in the dialog when trying to create an experiment.
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)
4 0x00007ff1c58dc40d in spin::SpinExperimentCreator::createFiltersData() const (this=0x7ffd5bc8d060)
5 0x00007ff1c58d970d in spin::SpinExperimentCreator::createExperimentData() const (this=0x7ffd5bc8d060)
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