Ticket #8542 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Guard against unknown/invalid pixel id's in the 'Precount' functionality of LoadEventNexus

Reported by: Russell Taylor Owned by: Russell Taylor
Priority: critical Milestone: Release 3.1
Component: Framework Keywords: PatchCandidate
Cc: Blocked By:
Blocking: Tester: Michael Reuter

Description

It's been discovered that if a file contains events assigned (event_id field in the nexus file) to an unknown pixel ID (i.e. one not in the IDF) then there's potential for a bad_alloc when the 'Precount' option tries to allocate the vectors. The code doesn't protect against this happening so can end up getting the calculation wrong and trying to allocate very large vectors. We need to catch this - as presumably the code that actually loads the events does.

Change History

comment:1 Changed 7 years ago by Russell Taylor

  • Status changed from new to inprogress

Re #8542. Protect against unknown pixel id's.

Specifically, when all the IDs in a bank are higher than the highest known one from the instrument definition.

Changeset: 0650416cca9ebe7e915102f1283c6db690db3fa1

comment:2 Changed 7 years ago by Russell Taylor

Re #8542. Co-locate related code.

Just moved up a piece of code - nothing functional has changed.

Changeset: 5d1e79c1a09b4a9229b321b16511c8e885e99bd6

comment:3 Changed 7 years ago by Russell Taylor

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

This addresses the problem seen here, which relates to pixel ID's that are larger than the highest number in the IDF (#7524 handled the case of unknown pixel IDs within the range given by the IDF).

To test (will need to be at SNS to get the data):

  • Load SEQ_43974.nxs.h5 into Mantid. Make sure the 'Precount' option is set to on.
  • Before the changes, the algorithm fails with a 'bad_alloc'. After the changes, all is sweet.

comment:4 Changed 7 years ago by Michael Reuter

  • Status changed from verify to verifying
  • Tester set to Michael Reuter

comment:5 Changed 7 years ago by Michael Reuter

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/8542_loadeventnexus_bad_alloc'

Full changeset: abf16dea737612aafbc8c0eb88eab5f30b2483fb

comment:6 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9386

Note: See TracTickets for help on using tickets.