Ticket #7583 (closed: fixed)
Crash with quick script that changes log values or instrument parameters
Reported by: | Martyn Gigg | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | blocker | Milestone: | Release 2.6 |
Component: | Framework | Keywords: | |
Cc: | Alex.Buts@… | Blocked By: | |
Blocking: | Tester: | Russell Taylor |
Description (last modified by Martyn Gigg) (diff)
Demonstrated by the script below.
import dgreduce iliad_setup=dgreduce.setup iliad=dgreduce.arb_units iliad_abs=dgreduce.abs_units iliad_help=dgreduce.help inst='mar' iliad_setup(inst) ext='.raw' mapfile='mari_res' cal_file='MAR11060.RAW' #load vanadium file for i in range(200): print '############' ,i,' ##################' run='11001' WB='11060' ei = 12.5 rebin_params = "-6.25,0.03125,11.875" BkgdRange = [11705.726218019521, 19500] w1=iliad(WB,run,ei,rebin_params,mapfile,det_cal_file=cal_file,norm_method='current') #w1test=iliad(WB,run,ei,rebin_params,mapfile,det_cal_file=cal_file,norm_method='current',save_format='',background=True,bkgd_range=BkgdRange) DeleteWorkspace('w1') #DeleteWorkspace('w1test')
that never reaches the end successfully.
In release it either shows the terminate dialog saying about m_run being empty or something about a null pointer in the ParameterMap
Change History
comment:2 Changed 7 years ago by Alex Buts
- Cc Alex.Buts@… added
Yes it is the problem I am experiencing with the Reductuion GUI
comment:3 Changed 7 years ago by Martyn Gigg
- Status changed from new to inprogress
Lock the DataItem RWLock while generating the ADS tree for the dock.
The ADS is now generating a node tree that describes the state of the ADS when queried. This in turn queries the workspace itself and while running in MantidPlot an executing script can cause things wrapped in a cow_ptr to be copied and at the same time access the pointer while it is being copied, causing a crash.
Refs #7583
Changeset: e6de55b899a74120c7da75773190024f12cb0fbc
comment:4 Changed 7 years ago by Martyn Gigg
This is not ideal. The dock used to lazy-load the information about a workspace which in-practice avoided this problem because 99% of the time the information was never generated. At this stage in the release it's not possible to put back the lazy loading but the crash needsto be avoided.
comment:5 Changed 7 years ago by Martyn Gigg
- Status changed from inprogress to verify
- Resolution set to fixed
Branch: bugfix/7583_crash_on_dock_updating
Tester: The script above should reproduce the error. It will require the systemtests/Data directory to be in the Mantid search path and to be run from MantidPlot.
I would advise running the script BEFORE starting to test to ensure that the segfault actually occurs and then merge to the code and test the script again.
comment:6 Changed 7 years ago by Russell Taylor
- Status changed from verify to verifying
- Tester set to Russell Taylor
comment:7 Changed 7 years ago by Russell Taylor
- Status changed from verifying to closed
OK, it made it through the script 3 times without crashing with that change. I think you could have achieved the same thing (and saved me compilation time!) with a one line change in Workspace.cpp: Kernel::ReadLock _lock(*this);
We certainly need to get back to laziness in this area.