Ticket #11060 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Coverity High Impact issues: resource leaks in MDEvents

Reported by: Federico M Pouzols Owned by: Federico M Pouzols
Priority: major Milestone: Release 3.4
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Dan Nixon

Description

Well not so incredible high impact, as these are a few memory leaks.

Fix a bunch of resource leak issues found by coverity in Framework/MDEvents: 1075577-1075588 (functions AffineMatrixParameter and createTransform). All of them seem solvable by using boost::shared_ptr and/or deleting pointers to temporary objects.

Change History

comment:1 Changed 6 years ago by Federico M Pouzols

More details about these issues:

  • 1075577-80 are memory leaks in CoordTransformDistanceParser::createTransform that should go away by using shared_ptr.
  • 1075581-83 are similar memory leaks in CoordTransformAffineParser::createTransform
  • 1075584: CoordTransformAffine constructor: leak (pointer going out of scope). This issue is now listed as fixed.
  • 1075585,6: ConvToMDHistoWS: leak (pointer to thread scheduler, be careful there). These two are now listed as fixed, and the file as "historical". Trying to clarify what happened.
  • 1075587: AffineMatrixParameter constructor: memory leak, pointer tmpX going out of scope.
  • 1075588: AffineMatrixParameter copy constructor, similar leak with pointer tmpX.

comment:2 Changed 6 years ago by Federico Montesino Pouzols

fix 1075577-80, avoid leak using shared_ptr, re #11060

Changeset: e3c261089a74ae38d067612fd5317b9f42bdb070

comment:3 Changed 6 years ago by Federico Montesino Pouzols

fix 1075581-83, avoid leak using shared_ptr, re #11060

Changeset: 6c16ad0f4fd45b1167ff8115b30fe261891b6dab

comment:4 Changed 6 years ago by Federico Montesino Pouzols

added m_rawMem, m_refix, =NULL, coverity issues 1075587,8 re #11060

Changeset: 654527d43e709dbdd90e8c8e548bb241c26cb01f

comment:5 Changed 6 years ago by Nick Draper

  • Status changed from new to assigned

comment:6 Changed 6 years ago by Federico M Pouzols

It seems that I added 1075584-6 by mistake, as these were fixed some time ago.

In AffineMatrixParameter (issues 1075587-8, constructor and copy constructor) I added the data member m_rawMem for consistency with CoordTransformAffine. I also used the m_ prefix throughout the class. In principle there was no real memory leak in AffineMatrixParameter but with these changes coverity should now be able to see that everything is fine.

comment:7 Changed 6 years ago by Federico M Pouzols

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

This is being verified as pull request #247.

comment:8 Changed 6 years ago by Dan Nixon

  • Status changed from verify to verifying
  • Tester set to Dan Nixon

comment:9 Changed 6 years ago by Dan Nixon

  • Status changed from verifying to closed

Merge pull request #247 from mantidproject/11060_coverity_resource_leaks_in_MDEvents

Coverity issues (resource leaks) in Framework/MDEvents

Full changeset: 077007e8d334eca07de4d91e903fcce675d25b5d

comment:10 Changed 5 years ago by Nick Draper

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

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11899

Note: See TracTickets for help on using tickets.