Ticket #7216 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

NormaliseToMonitor crashed with event data

Reported by: Vickie Lynch Owned by: Russell Taylor
Priority: major Milestone: Release 2.6
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description

To see crash, load event data with LoadMonitors and MonitorsAsEvents both true. Then use the same workspace for input and output for NormaliseToMonitor. This is from gdb:

#0  0x0000003d884328a5 in raise () from /lib64/libc.so.6
#1  0x0000003d88434085 in abort () from /lib64/libc.so.6
#2  0x0000003d8842ba1e in __assert_fail_base () from /lib64/libc.so.6
#3  0x0000003d8842bae0 in __assert_fail () from /lib64/libc.so.6
#4  0x00007fffe305a6b3 in boost::shared_ptr<Mantid::DataObjects::EventWorkspace>::operator-> (this=0x7fffd3a9b360)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:418
#5  0x00007fffddecdcd2 in Mantid::Algorithms::NormaliseToMonitor::normaliseBinByBin (.omp_data_i=0x7fffd3a9b380)
    at /home/vel/mantid/Code/Mantid/Framework/Algorithms/src/NormaliseToMonitor.cpp:586
#6  0x00007fffddecc784 in Mantid::Algorithms::NormaliseToMonitor::normaliseBinByBin (this=0x3703600, inputWorkspace=...,
    outputWorkspace=...) at /home/vel/mantid/Code/Mantid/Framework/Algorithms/src/NormaliseToMonitor.cpp:562
#7  0x00007fffddec85b2 in Mantid::Algorithms::NormaliseToMonitor::exec (this=0x3703600)
    at /home/vel/mantid/Code/Mantid/Framework/Algorithms/src/NormaliseToMonitor.cpp:274
#8  0x00007ffff6b89134 in Mantid::API::Algorithm::execute (this=0x3703600)
    at /home/vel/mantid/Code/Mantid/Framework/API/src/Algorithm.cpp:550
#9  0x00007ffff6b8e58a in Mantid::API::Algorithm::executeAsyncImpl (this=0x3703600)
    at /home/vel/mantid/Code/Mantid/Framework/API/src/Algorithm.cpp:1339
#10 0x00007ffff6bc7815 in Mantid::API::AlgorithmProxy::executeAsyncImpl (this=0x178e930, dummy=...)
    at /home/vel/mantid/Code/Mantid/Framework/API/src/AlgorithmProxy.cpp:116
#11 0x00007ffff6bca550 in Poco::ActiveRunnable<bool, Poco::Void, Mantid::API::AlgorithmProxy>::run (this=0x30f62e0)
    at /usr/include/Poco/ActiveRunnable.h:85
#12 0x0000003d8a0ebf7d in Poco::PooledThread::run() () from /usr/lib64/libPocoFoundationd.so.11
#13 0x0000003d8a0e7978 in Poco::ThreadImpl::runnableEntry(void*) () from /usr/lib64/libPocoFoundationd.so.11
#14 0x00007ffff18b9851 in start_thread () from /lib64/libpthread.so.0
#15 0x0000003d884e890d in clone () from /lib64/libc.so.6

Change History

comment:1 Changed 7 years ago by Russell Taylor

  • Owner set to Russell Taylor
  • Status changed from new to accepted

comment:2 Changed 7 years ago by Russell Taylor

The problem is that in normaliseBinByBin, the outputEvent variable is never assigned if the input & outputworkspaces are the same.

comment:3 Changed 7 years ago by Russell Taylor

Re #7216. Tidy up, removing unused code.

Changeset: 3493bd65f34e5843d21f41458b26b9972a156008

comment:4 Changed 7 years ago by Russell Taylor

Re #7216. Only do the work creating a workspace when it's needed.

The setUp method would be getting called before every single test whether they needed it or not. This just does this relatively expensive work where it's actually used.

Changeset: 89518aaf2b8a68bab65047f98f579569eccd2139

comment:5 Changed 7 years ago by Russell Taylor

Re #7216. Add test for output workspace same as input one.

testExec_Events_inplace fails right now of course.

Changeset: 714a24382a81f6963d4edb772f4fe7093ecb5eac

comment:6 Changed 7 years ago by Russell Taylor

Re #7216. Fix for inplace normalisation of event workspaces.

Changeset: 490175871efedd9478a9b27cb864667594792c1e

comment:7 Changed 7 years ago by Russell Taylor

Re #7216. Best practice is to pass shared_ptr by const ref if poss.

Changeset: 508a5a547a9bd5894fe22653df5b3f3a8ec42f1d

comment:8 Changed 7 years ago by Russell Taylor

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

Branch is feature/7216_normalisetomonitor_crash

To test, run something like the following, which crashed before (note the input was an event workspace):

NormaliseToMonitor-[Information] Algorithm: NormaliseToMonitor v1
NormaliseToMonitor-[Information] Parameters:
NormaliseToMonitor-[Information]   Name: InputWorkspace, Value: TOPAZ_6665_event, Default?: No, Direction: Input
NormaliseToMonitor-[Information]   Name: OutputWorkspace, Value: TOPAZ_6665_event, Default?: No, Direction: Output
NormaliseToMonitor-[Information]   Name: MonitorSpectrum, Value: -1, Default?: Yes, Direction: InOut
NormaliseToMonitor-[Information]   Name: MonitorID, Value: -1, Default?: Yes, Direction: Input
NormaliseToMonitor-[Information]   Name: MonitorWorkspace, Value: TOPAZ_6665_event_monitors, Default?: No, Direction: Input
NormaliseToMonitor-[Information]   Name: MonitorWorkspaceIndex, Value: 0, Default?: Yes, Direction: InOut
NormaliseToMonitor-[Information]   Name: IntegrationRangeMin, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
NormaliseToMonitor-[Information]   Name: IntegrationRangeMax, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
NormaliseToMonitor-[Information]   Name: IncludePartialBins, Value: 0, Default?: Yes, Direction: Input

comment:9 Changed 7 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:10 Changed 7 years ago by Martyn Gigg

  • Status changed from verifying to closed

Ran it about 10 times consecutively and didn't get a crash.

comment:11 Changed 7 years ago by Russell Taylor

Last edited 7 years ago by Russell Taylor (previous) (diff)

comment:12 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8062

Note: See TracTickets for help on using tickets.