Ticket #11038 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Random segfaults in doc tests

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: critical Milestone: Release 3.4
Component: Documentation Keywords:
Cc: Blocked By:
Blocking: Tester: Dan Nixon

Description

The documentation tests on RHEL6 have been unstable for some time. It seems to segfault when trying to load an instrument that doesn't exist:

Document: algorithms/CalculatePeaksHKL-v1
12:13:56 -----------------------------------------
12:13:56 Load-[Notice] Load started
12:13:56 InstrumentDefinitionParser-[Warning] Attribute 'mark-as' is a depricated attribute in Instrument Definition File. Please see the deprecated section of www.mantidproject.org/IDF for how to remove this warning message
12:13:57 CreateSimulationWorkspace-[Error] Error in execution of algorithm CreateSimulationWorkspace:
12:13:57 CreateSimulationWorkspace-[Error] Unable to find an Instrument Definition File for search object MARS
12:13:57 MantidApplication-[Fatal] Unexpected exception: Unable to find an Instrument Definition File for search object MARS
12:13:57 CreateSimulationWorkspace-[Error] Error in execution of algorithm CreateSimulationWorkspace:
12:13:57 CreateSimulationWorkspace-[Error] Unable to find an Instrument Definition File for search object MARS
12:14:07 /var/tmp/sclwtzpCG: line 8: 24186 Segmentation fault      (core dumped) /opt/Mantid/bin/MantidPlot_exe -xq docs/runsphinx_doctest.py

Change History

comment:1 Changed 6 years ago by Martyn Gigg

I put a breakpoint in the part of LoadInstrument that throws the exception and found this backtrace

#0  Mantid::DataHandling::LoadInstrument::exec (this=0xa000f60) at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/Framework/DataHandling/src/LoadInstrument.cpp:150
#1  0x00007ffff71179f7 in Mantid::API::Algorithm::execute (this=0xa000f60) at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/Framework/API/src/Algorithm.cpp:571
#2  0x00007ffff710d6e4 in Mantid::API::Algorithm::executeAsChildAlg (this=0xa000f60) at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/Framework/API/src/Algorithm.cpp:677
#3  0x00007fffe3c5bc9a in Mantid::DataHandling::CreateSimulationWorkspace::createInstrument (this=0x5c6b1c0)
    at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp:106
#4  0x00007fffe3c5e232 in Mantid::DataHandling::CreateSimulationWorkspace::exec (this=0x5c6b1c0)
    at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/Framework/DataHandling/src/CreateSimulationWorkspace.cpp:80
#5  0x00007ffff71179f7 in Mantid::API::Algorithm::execute (this=0x5c6b1c0) at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/Framework/API/src/Algorithm.cpp:571
#6  0x00007ffff713c56c in Mantid::API::AlgorithmProxy::execute (this=0x5cf51c0) at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/Framework/API/src/AlgorithmProxy.cpp:71
#7  0x00007ffff6a7c713 in MantidQt::MantidWidgets::IndirectInstrumentConfig::updateInstrumentConfigurations (this=0x5b99030, instrumentName=...)
    at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/MantidQt/MantidWidgets/src/IndirectInstrumentConfig.cpp:317
#8  0x00007ffff3d42036 in QMetaObject::activate (sender=0x5b9c180, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x7fffffffcd40)
    at kernel/qobject.cpp:3539
#9  0x00007ffff6af0b72 in MantidQt::MantidWidgets::InstrumentSelector::instrumentSelectionChanged (this=<value optimized out>, _t1=<value optimized out>)
    at /home/dmn58364/mantidproject/builds/relwithdbg/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/moc_InstrumentSelector.cxx:150
#10 0x00007ffff6af0c69 in MantidQt::MantidWidgets::InstrumentSelector::qt_static_metacall (_o=<value optimized out>, _c=<value optimized out>, _id=<value optimized out>, 
    _a=<value optimized out>) at /home/dmn58364/mantidproject/builds/relwithdbg/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/moc_InstrumentSelector.cxx:66
#11 0x00007ffff3d45dee in QObject::event (this=0x5b9c180, e=<value optimized out>) at kernel/qobject.cpp:1194
#12 0x00007ffff4a5371d in QWidget::event (this=0x5b9c180, event=0x7fffa6d068e0) at kernel/qwidget.cpp:8845
#13 0x00007ffff4a0569c in QApplicationPrivate::notify_helper (this=0x124ce40, receiver=0x5b9c180, e=0x7fffa6d068e0) at kernel/qapplication.cpp:4562
#14 0x00007ffff4a0c35d in QApplication::notify (this=<value optimized out>, receiver=0x5b9c180, e=0x7fffa6d068e0) at kernel/qapplication.cpp:4423
#15 0x000000000087283d in MantidApplication::notify (this=<value optimized out>, receiver=0x5b9c180, event=<value optimized out>)
    at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/MantidPlot/src/Mantid/MantidApplication.cpp:29
#16 0x00007ffff3d2d8ec in QCoreApplication::notifyInternal (this=0x7fffffffdf20, receiver=0x5b9c180, event=0x7fffa6d068e0) at kernel/qcoreapplication.cpp:946
#17 0x00007ffff3d31813 in sendEvent (receiver=0x0, event_type=0, data=0x124cfd0) at kernel/qcoreapplication.h:231
#18 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x124cfd0) at kernel/qcoreapplication.cpp:1570
#19 0x00007ffff3d5afd3 in sendPostedEvents (s=0x1251ca0) at kernel/qcoreapplication.h:236
#20 postEventSourceDispatch (s=0x1251ca0) at kernel/qeventdispatcher_glib.cpp:279
#21 0x00007fffeebd0642 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#22 0x00007fffeebd4c98 in ?? () from /lib64/libglib-2.0.so.0
#23 0x00007fffeebd4e4c in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#24 0x00007ffff3d5a903 in QEventDispatcherGlib::processEvents (this=0x124e270, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#25 0x00007ffff4aa922e in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:207
#26 0x00007ffff3d31d4f in QCoreApplication::processEvents (flags=...) at kernel/qcoreapplication.cpp:1133
#27 0x00000000005944d3 in ApplicationWindow::executeScriptFile (this=0x137b6c0, filename=..., execMode=Script::Asynchronous)
    at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp:15375
#28 0x00000000005dfaa3 in ApplicationWindow::parseCommandLineArguments (this=0x137b6c0, args=...)
    at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp:13932
#29 0x0000000000994cc6 in main (argc=3, argv=<value optimized out>) at /home/dmn58364/mantidproject/src/mantid/Code/Mantid/MantidPlot/src/main.cpp:204

My assumption is that a test is setting the default instrument and causing an InstrumentSelector widget to asynchronously update itself causing an occasional failure. The culprit seems to be IndirectInstrumentConfig

Last edited 6 years ago by Martyn Gigg (previous) (diff)

comment:2 Changed 6 years ago by Martyn Gigg

Remove setting/unsetting facility unecessarily

In MantidPlot, when the indirect interface is open, it causes a lot of flicking and random segfaults in the usage tests Refs #11038

Changeset: 423b4517e2f40dc36f56f7993d05ba2583ad5a3b

comment:3 Changed 6 years ago by Martyn Gigg

  • Status changed from new to assigned

comment:4 Changed 6 years ago by Martyn Gigg

  • Status changed from assigned to inprogress

comment:5 Changed 6 years ago by Martyn Gigg

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

This is being verified as pull request #188.

comment:6 Changed 6 years ago by Dan Nixon

  • Status changed from verify to verifying
  • Tester set to Dan Nixon

comment:7 Changed 6 years ago by Dan Nixon

  • Status changed from verifying to closed

Merge pull request #188 from mantidproject/11038_fix_doctest_segfault

Remove setting/unsetting facility unnecessarily in indirect scripts

Full changeset: 18b5c92c5e1a45a4ad0ab0cf900a3fc7c23520c7

comment:8 Changed 6 years ago by Dan Nixon

For what it's worth this error also occurs within MantidPlot if you have multiple interfaces with instrument selectors on as by default they change the default facility.

IndirectInstrumentConfig helps to stop this to a certain extent by limiting the number of times the default instrument is changed.

comment:9 Changed 6 years ago by Martyn Gigg

Yes, I'm starting to think that changing the default.facility is not a good idea or at least it should be optional

comment:10 Changed 6 years ago by Dan Nixon

As part of #11048(http://trac.mantidproject.org/mantid/ticket/11048) I will add the option to have at least MWRunFIles not depend on the default instrument, so there should no longer be an issue with the indirect interfaces changing the default instrument.

InstrumentSelector at least has the updateInstrumentOnSelection() function to disable changing the default instrument.

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11877

Note: See TracTickets for help on using tickets.