Ticket #11328 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Fix memory, initialization and other issues (coverity) in Framework (especially Load...)

Reported by: Federico M Pouzols Owned by: Federico M Pouzols
Priority: major Milestone: Release 3.4
Component: Framework Keywords:
Cc: Blocked By:
Blocking: #10619 Tester: Harry Jeffery

Description (last modified by Federico M Pouzols) (diff)

This is a bunch of coverity issues (~30), with a bit of focus on Framework, and inside framework, on the Load* classes and related helpers.

Unitialized member vars (scalars and pointers):

  • 1075408: LoadEventPreNexus2 constructor
  • 1075417: LoadPreNexusMonitors constructor
  • 1075403: LoadMask constructor
  • 1075405: LoadLLB
  • 1075411: LoadDetectorsGroupingFile.cpp: LoadDetectorsGroupingFile constructor
  • 1075412: LoadDetectorsGroupingFile.cpp: LoadGroupXMLFile constructor
  • 1075399: LoadRawBin0 constructor
  • 1075398: LoadRawHelper
  • 1075397: LoadRawSpectrum0
  • 1127169: LoadSINQFocus
  • 1075395: LoadTOFRawNexus
  • 1237306: LoadVulcanCalFile
  • 1075349: LoadSQW.h / LoadSQWHelper
  • 1075341: LoadSQW
  • 1075404: LoadLogsForSNSPulsedMagnet
  • 1075401: LoadRaw / item_struct constructor

A few remaining leaks, supposedly high impact:

  • 1271720, 21: leaks in AffineMatrixParameter (false positives I'd say), but the destructor can be improved so that we don't get this false positive and everything is more clear.
  • 1271722: similar issue as above, in CoordTransformAffine

Unchecked dynamic_casts

  • 1223399: LoadILLReflectometry
  • 1223400: LoadILLReflectometry
  • 1076257: ​HFIRLoad
  • 1076262, 63, 64: EQSANSLoad

Integer handling:

  • 1076097: LoadRawBin0 (int32/64 cast)
  • 1076096: ​LoadRawHelper
  • 1076095: LoadRawSpectrum0

Control flow:

  • 1075695: LoadCanSAS1D, Missing break in switch

Unchecked return values:

  • 1076114: LoadRawHelper

Change History

comment:1 Changed 6 years ago by Federico M Pouzols

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Federico M Pouzols

  • Status changed from assigned to inprogress
  • Description modified (diff)
  • Blocking 10619 added
  • Summary changed from Fix memory and initialization issues (coverity) in Framework to Fix memory, initialization and other issues (coverity) in Framework (especially Load...)

comment:3 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075408, re #11328

Changeset: 0a7446bf797b1ae95280e3135b7395a2cd9b95f0

comment:4 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075417 (constructor init), re #11328

Changeset: ecfe4bad656d1c8d9373a8279173cf4e784eedc8

comment:5 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075403 (constructor init), re #11328

Changeset: 27aaf76b29e31347dcee68775c21d039b4133d79

comment:6 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075405 (constructor init), re #11328

Changeset: 83073dbb40784a3289dbf1feb1d8a9c3409bbd86

comment:7 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075411,12 (constructor init), re #11328

Changeset: c5856a0f1ae6b33b848cffebb08d2a27ff7d9659

comment:8 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075399, 1076097 (init and int32/64), re #11328

Changeset: 816b1f75ac85b6b84ac00fb4b8084ecf36ad2cdb

comment:9 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075398,1076096,1076114 (init,int32/64,return), re #11328

Changeset: 1456d585ebf72c9a8574c25e352ae3d80fc3c4b7

comment:10 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075397,1076095 (constructor init, int32/64), re #11328

Changeset: eb2a92b9ab62629ba18825efea1828653a39b881

comment:11 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1127169 (constructor init), re #11328

Changeset: e919757ee63e54a6feefa84183a19ccb27c2ff19

comment:12 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075395 (constructor init), re #11328

Changeset: bf540a127d5cb6a488ad027b68d09d9b9def8466

comment:13 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1237306 (constructor init), re #11328

Changeset: eeb168c66704f027bb03b1e8328f8bedb2b76f79

comment:14 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1271720,21 (destructor, leak), re #11328

Changeset: 590375ba5cf144988ed74cc3e907377041167caa

comment:15 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1271722 (destructor, leak), re #11328

Changeset: 6fcbfaed382638f7dec3b77fa0a544684da5cf56

comment:16 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075695 (switch-break), re #11328

Changeset: a698e22c6515b6b8f349829e3af40eb6337ab403

comment:17 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075403 (constructor init), re #11328

Changeset: b702ed2fe6e3057fac4490fa25b3170c68483467

comment:18 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075397,1076095 (constructor init, int32/64), re #11328

Changeset: 9aa44ba82f2abf474ba8c678b128385f7fea77fd

comment:19 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075399, 1076097 (init and int32/64), re #11328

Changeset: 125e2e8c67b615560d00753078ace04b92938686

comment:20 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075395 (constructor init), re #11328

Changeset: a3789387c0d73d3b64af4164eac080bb1b1ab530

comment:21 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075395 (constructor init), re #11328

Changeset: 28c6a474f7d93eaae6b97f9e045b76e108b8ed98

comment:22 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075417 (constructor init), re #11328

Changeset: 5dafbb7c331c116dbba8d351b28d38e24f67786f

comment:23 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075349,1075341 (constructor init), re #11328

Changeset: 8ff5d47fe9aefda49f240155f5958e4f926dc6a1

comment:24 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075401 (constructor init), re #11328

Changeset: 96a5638b5694598db6db60c282fff0c8557364bc

comment:25 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1075404 (constructor init), re #11328

Changeset: d7efff826a48ee1aa036cfaad567b895fd3c3741

comment:26 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1076262-64 (dynamic_cast checks), re #11328

Changeset: a14f13a281396e3f40dc407be969577dd4d75069

comment:27 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1076257 (dynamic_cast checks), re #11328

Changeset: 78c44fe94020a47ac417daa1cb1300608ae59c88

comment:28 Changed 6 years ago by Federico Montesino Pouzols

fix coverity 1223399,1223400 (dynamic_cast checks), re #11328

Changeset: 27d21362b24110081c0410c1e90f68c25082a9f7

comment:29 Changed 6 years ago by Federico Montesino Pouzols

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

This is being verified as pull request #390.

comment:30 Changed 6 years ago by Harry Jeffery

  • Status changed from verify to verifying
  • Tester set to Harry Jeffery

comment:31 Changed 6 years ago by Harry Jeffery

Other than that it looks good. Nice big clean up for Coverity :+1:

comment:32 Changed 6 years ago by Federico Montesino Pouzols

fix capitalization mistake in some data members, re #11328

Changeset: f78e829658a98ccddda668ba0c1978047426bab2

comment:33 Changed 6 years ago by Harry Jeffery

  • Status changed from verifying to closed

Merge pull request #390 from mantidproject/11328_fix_various_coverity_issues_framework_load_classes

Fix memory, initialization and other coverity issues in Framework (especially Load* classes)

Full changeset: da9098552c6c453df0f265e923992a02553afaf8

comment:34 Changed 5 years ago by Nick Draper

Somehow these slipped through without a resolution. Set to Fixed.

comment:35 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12167

Note: See TracTickets for help on using tickets.