Ticket #7994 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Fix errors reported by coverity

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

Description (last modified by Martyn Gigg) (diff)

A scan of the project was submitted to scan.coverity.com. Spend a few hours fixing some issues that it has raised.

Attachments

MDAlgorithmsTest.LoadSQWTestPerformance.testLoading.runtime.v.revision.png (40.8 KB) - added by Russell Taylor 7 years ago.

Change History

comment:1 Changed 7 years ago by Martyn Gigg

  • Description modified (diff)

comment:2 Changed 7 years ago by Martyn Gigg

  • Status changed from new to inprogress

Kill warning in RemoteJobManager.cpp

Refs #7994

Changeset: b6f39c2088f7ec642d3e258b26a4046996b972dc

comment:3 Changed 7 years ago by Martyn Gigg

Pass matrices/unit cell by reference to const in constructors.

Refs #7994

Changeset: 9043e6b0ed679ffaaab58cb43c6982833cc947ba

comment:4 Changed 7 years ago by Martyn Gigg

Pass by reference in NexusClasses. Refs #7994

Changeset: c7b3f9e9edec7ec3371c096f144dd4061362459c

comment:5 Changed 7 years ago by Martyn Gigg

Remove old unused code.

Refs #7994

Changeset: 8e822ac8b01ec91baf53a528e97cdfafb0a38150

comment:6 Changed 7 years ago by Martyn Gigg

Move null pointer checks to more sensible place.

Refs #7994

Changeset: 0eaa6a82d0fd3ed15896393d8959b674e8d180a8

comment:7 Changed 7 years ago by Martyn Gigg

Avoid capturing return values if they are not used.

Refs #7994

Changeset: 0be6ab2b01e2773d3856ce4ca5056892dcf4a476

comment:8 Changed 7 years ago by Martyn Gigg

Remove pointless check for textAxis pointer in FitMW.

We know from our setup that it's what we will get. Refs #7994

Changeset: 888194f2f5236ff6b53304549798c3c645669770

comment:9 Changed 7 years ago by Martyn Gigg

Use a more sensible argument type for FileFinder::findRun

Refs #7994

Changeset: 4866c322bd928adb5d71181bc5fb9eb4f30a8dc8

comment:10 Changed 7 years ago by Martyn Gigg

Check once for NULL graph pointer in *Curve constructors.

Refs #7994

Changeset: 293893ca1062177953fa1c4832f9c1e04a700390

comment:11 Changed 7 years ago by Martyn Gigg

Swap raw pointer for boost::shared_ptr in BinaryOperation

The BinaryOperationTable was not deleted at the end of the operation causing a memory leak. The shared_ptr will take care of this properly. Refs #7994

Changeset: 6f9c03412eb9ab4bdc8fd43ff35f5f757c9a3dbc

comment:12 Changed 7 years ago by Peter Peterson

  • Milestone changed from Backlog to Release 3.0

Should have moved things from backlog into the release before working on it.

comment:13 Changed 7 years ago by Martyn Gigg

Merge branch 'bugfix/7994_coverity_errors' into develop

Conflicts:

Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp

Refs #7994

Changeset: 5caef6ed4c1fe92e23198974cc519e8c3c32ed8a

comment:14 Changed 7 years ago by Martyn Gigg

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

Branch: bugfix/7994_coverity_errors

Tester: Should probably be tested my someone with a coverity account. I assigned some bugs to myself and have marked those that are fixed by this ticket as "Fix Submitted". You can see it by going to the list of owners and clicking on me.

All are not fixed yet as I timed-boxed this two a few hours. We can keep chipping away at these in future but I aimed for the ones that were copy unnecessarily or potential bad usage or raw pointers.

comment:15 Changed 7 years ago by Russell Taylor

  • Status changed from verify to reopened
  • Resolution fixed deleted

The performance tests are suggesting that LoadSQW slows down a lot due to these changes (see the attached graph). We should at least have a go at understanding this.

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

comment:16 Changed 7 years ago by Martyn Gigg

Strange. It's not clear what is happening here. I've built my branch before & after all of the changes and the stays at the same timings. It's a similar story with develop on my machine.

I also tried specifying explicit optimization flags like the performance test build does but that made no difference either. Is there anything special about that build that I might have missed?

comment:17 Changed 7 years ago by Russell Taylor

OK, I checked and didn't see anything locally either. I then cleaned the build directory on the performance tests job & restarted the machine. The outcome is that the test has gone back to its previous timing so you can re-close the ticket.

comment:18 Changed 7 years ago by Martyn Gigg

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

Ok, thanks.

comment:19 Changed 7 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:20 Changed 7 years ago by Russell Taylor

  • Status changed from verifying to closed

Merge remote branch 'origin/bugfix/7994_coverity_errors'

Full changeset: eb895455f0112e74ed66f3e3461818276d62629b

comment:21 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8839

Note: See TracTickets for help on using tickets.