Ticket #8491 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Fix unreleased use of POCO::XML document and nodelists in MD code

Reported by: Karl Palmen Owned by: Federico M Pouzols
Priority: major Milestone: Release 3.4
Component: Framework Keywords: maintenance
Cc: Blocked By:
Blocking: #10637 Tester: Martyn Gigg

Description (last modified by Karl Palmen) (diff)

In the code of framework/MDAlgorithms and framework/MDEvents I found some cases of POCO::XML document or nodelist objects being created, but not released. This could cause memory leakage. Fix by using AutPtr for the object.

The cases I found were:

MDAlgorithms InvalidParameterParser, Vector3DParameterParser, BinMDTest, InvalidParameterParserTest

MDEvents AffineMatrixParameterParser, CoordTransformAffineParser, CoordTransformDistanceParser and unit tests

Change History

comment:1 Changed 7 years ago by Gesner Passos

it seems that the following inclues are not used in Mantid/Framework/MDAlgorithms/src/BinMD.cpp

#include <Poco/DOM/Document.h>
#include <Poco/DOM/DOMParser.h>
#include <Poco/DOM/Element.h>

comment:2 Changed 7 years ago by Karl Palmen

  • Description modified (diff)

comment:3 Changed 7 years ago by Karl Palmen

  • Description modified (diff)

comment:4 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

bulk move to assigned at the into of the triage step

comment:5 Changed 6 years ago by Federico M Pouzols

  • Blocking 10637 added

comment:6 Changed 6 years ago by Federico M Pouzols

  • Status changed from assigned to inprogress
  • Owner set to Federico M Pouzols

comment:7 Changed 6 years ago by Federico Montesino Pouzols

Use Poco::AutoPtr, get rid of old poco includes, re #8491

Changeset: cea958b2ea5a10457f1feb4b841a029786887e9e

comment:8 Changed 6 years ago by Federico M Pouzols

  • Milestone changed from Backlog to Release 3.4

comment:9 Changed 6 years ago by Federico M Pouzols

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

This removes potential leaks with Poco::XML objects (following guidelines in #10637), a bunch of not needed includes have been removed (using forward declarations wherever possible). It seems that some of the issues have been fixed since this ticket was reported. The pieces modified here are (not counting removal of unnecessary headers):

  • Algorithms: InvalidParameterParserTest
  • Events: CoordTransformAffineParser. CoordTransformDistanceParser

Suggestion to test:

  • check that builds are fine on all platforms (apparently no issue here)
  • review code
  • make sure that (MD) tests pass

comment:10 Changed 6 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:11 Changed 6 years ago by Martyn Gigg

  • Status changed from verifying to reopened
  • Resolution fixed deleted

There are some merge conflicts with master, which I think are due to the mass format with clang-format. I would suggest running clang-format on the files changed in the branch and then merging master into the branch.

It will then need to be put back on develop

comment:12 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from reopened to inprogress

clang-format them to fix conflict issues, re #8491

Changeset: 2059c3d27b5d024b2d56a875f3456fc35cf2495b

comment:13 Changed 6 years ago by Federico M Pouzols

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

I think it should be fine and conflict-free this time.

comment:14 Changed 6 years ago by Martyn Gigg

  • Status changed from verify to verifying

comment:15 Changed 6 years ago by Martyn Gigg

  • Status changed from verifying to closed

Merge branch 'bugfix/8491_fix_unreleased_poco_xml_objects_MD'

Conflicts:

Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Vector3DParameterParser.h Code/Mantid/Framework/MDEvents/src/CoordTransformAffineParser.cpp Code/Mantid/Framework/MDEvents/src/CoordTransformDistanceParser.cpp

Full changeset: 4603100bb5dfca1993879da5101b5a3f6811678f

comment:16 Changed 5 years ago by Nick Draper

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

comment:17 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9335

Note: See TracTickets for help on using tickets.