Ticket #5462 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

Race condition when displaying MantidMatrix of updating workspace

Reported by: Russell Taylor Owned by: Russell Taylor
Priority: major Milestone: Release 2.2
Component: MantidPlot Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description

This has manifested itself as a segmentation fault when displaying an EventWorkspace during a live data run, but I think it's a possible problem (if less likely) with a Workspace2D as well.

We presumabely need to read-lock the workspace.

Here's a stack trace of the crash:

Mantid::DataObjects::TofEvent::tof() at Events.h:102	
Mantid::DataObjects::EventList::generateCountsHistogram() at EventList.cpp:2,059	
Mantid::DataObjects::EventList::generateHistogram() at EventList.cpp:1,986	
Mantid::DataObjects::EventList::constDataY() at EventList.cpp:1,536	
Mantid::DataObjects::EventList::dataY() at EventList.h:278	
Mantid::API::MatrixWorkspace::readY() at MatrixWorkspace.h:172	
MantidMatrixModel::data() at MantidMatrix.cpp:1,467 0x9b8372	
MantidMatrixModel::data() at MantidMatrix.cpp:1,517 0x9b869f	

Change History

comment:1 Changed 8 years ago by Russell Taylor

  • Status changed from new to accepted

comment:2 Changed 8 years ago by Russell Taylor

Re #5462. Some const-correctness changes ahead of the real work.

Changeset: 4dbb08a15efbf780a5c77ba2c1b6ab06b2627798

comment:3 Changed 8 years ago by Russell Taylor

Re #5462. Some const-correctness changes ahead of the real work.

Changeset: 4dbb08a15efbf780a5c77ba2c1b6ab06b2627798

comment:4 Changed 8 years ago by Russell Taylor

Re #5462. Some const-correctness changes ahead of the real work.

Changeset: 4dbb08a15efbf780a5c77ba2c1b6ab06b2627798

comment:5 Changed 8 years ago by Russell Taylor

Re #5462. Read-lock workspace for thread-safety.

I've seen crashes at this point when running live data and the workspace updates. We need to keep an eye on performance here - this locks the workspace for every single data point (bin). If we see problems, we may have to refactor to do it more 'globally'.

Changeset: ec967d6b9fb18125db6c99f0796fbad1366fd018

comment:6 Changed 8 years ago by Russell Taylor

Re #5462. Read-lock workspace for thread-safety.

I've seen crashes at this point when running live data and the workspace updates. We need to keep an eye on performance here - this locks the workspace for every single data point (bin). If we see problems, we may have to refactor to do it more 'globally'.

Changeset: ec967d6b9fb18125db6c99f0796fbad1366fd018

comment:7 Changed 8 years ago by Russell Taylor

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

This cured the crash for me.

comment:8 Changed 8 years ago by Russell Taylor

Re #5462. Some const-correctness changes ahead of the real work.

Changeset: 4dbb08a15efbf780a5c77ba2c1b6ab06b2627798

comment:9 Changed 8 years ago by Russell Taylor

Re #5462. Read-lock workspace for thread-safety.

I've seen crashes at this point when running live data and the workspace updates. We need to keep an eye on performance here - this locks the workspace for every single data point (bin). If we see problems, we may have to refactor to do it more 'globally'.

Changeset: ec967d6b9fb18125db6c99f0796fbad1366fd018

comment:10 Changed 8 years ago by Martyn Gigg

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

comment:11 Changed 8 years ago by Martyn Gigg

  • Status changed from verifying to closed

Tried both event & histogram data with a 0.1 second update from the fake listeners and I didn't get a crash.

comment:12 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 6308

Note: See TracTickets for help on using tickets.