Ticket #8564 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

SNSLiveEventDataListener: Add protection for empty elements in device descriptor

Reported by: Russell Taylor Owned by: Russell Taylor
Priority: critical Milestone: Release 3.1
Component: Framework Keywords: LiveData, PatchCandidate
Cc: Blocked By:
Blocking: Tester: Ross Miller

Description

The SEQUOIA live stream has started to crash Mantid. The source has been traced to the ADARA device descriptor packet for the (just added) PulseMagnet device. This contains XML like:

<process_variable>
   <pv_name>PM_ADC</pv_name>
   <pv_id>1</pv_id>
   <pv_description>ADC capture</pv_description>
   <pv_type>integer</pv_type>
   <pv_units></pv_units>
</process_variable>

Notice that there's no text element contained in the pv_units element. In other cases where there's no unit the pv_units element is omitted entirely. In the above case we are getting back a null pointer when we try to get the text element and then dereferencing it.

Change History

comment:1 Changed 7 years ago by Russell Taylor

  • Status changed from new to inprogress

Re #8564. Just some tidying up.

E.g. use empty() instead of size() == 0, ! instead of == NULL.

Changeset: 71ca580a65caaecc24aca05bdc89a7aefd6a3dfa

comment:2 Changed 7 years ago by Russell Taylor

Re #8564. Guard against empty text elements in device descriptor pkts.

Changeset: b0b8410a3bbca9ee74b94ad4510f26b7fe760ce3

comment:3 Changed 7 years ago by Russell Taylor

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

To test (needs to be at SNS):

Try to connect to the SEQUOIA live stream. Before the changes, this will crash Mantid (unless they've changed things upstream in the meantime), afterwards it should be all good and sample logs should be created correctly and some should have units (do a 'view sample logs').

comment:4 Changed 7 years ago by Ross Miller

  • Status changed from verify to verifying
  • Tester set to Ross Miller

comment:5 Changed 7 years ago by Ross Miller

  • Status changed from verifying to closed

Merge remote branch 'origin/bugfix/8564_snslivelistener_devicedescriptor_crash'

Full changeset: a85e30f50f8fab82df4751518d9a1c399cf8ea5d

comment:6 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9408

Note: See TracTickets for help on using tickets.