Opened 8 years ago

Closed 8 years ago

#6178 closed defect (fixed)

ILI driver(s) leak memory

Reported by: Even Rouault Owned by: pka
Priority: normal Milestone: 2.1.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: interlis
Cc:

Description

valgrind --leak-check=full python ogr_ili.py :

==30471== 894 (112 direct, 782 indirect) bytes in 2 blocks are definitely lost in loss record 3,044 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7EC652D: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<CPLString const, GeomFieldInfo> > >::allocate(unsigned long, void const*) (new_allocator.h:89)
==30471==    by 0x7EC63DB: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_get_node() (stl_tree.h:359)
==30471==    by 0x7EC6254: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_create_node(std::pair<CPLString const, GeomFieldInfo> const&) (stl_tree.h:369)
==30471==    by 0x7EC5F02: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_insert_(std::_Rb_tree_node_base const*, std::_Rb_tree_node_base const*, std::pair<CPLString const, GeomFieldInfo> const&) (stl_tree.h:881)
==30471==    by 0x7EC6081: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_insert_unique(std::pair<CPLString const, GeomFieldInfo> const&) (stl_tree.h:1177)
==30471==    by 0x7EC58AB: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<CPLString const, GeomFieldInfo> >, std::pair<CPLString const, GeomFieldInfo> const&) (stl_tree.h:1217)
==30471==    by 0x7EC5321: std::map<CPLString, GeomFieldInfo, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::insert(std::_Rb_tree_iterator<std::pair<CPLString const, GeomFieldInfo> >, std::pair<CPLString const, GeomFieldInfo> const&) (stl_map.h:540)
==30471==    by 0x7EC4EF8: std::map<CPLString, GeomFieldInfo, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::operator[](CPLString const&) (stl_map.h:450)
==30471==    by 0x7ED0FCF: IliClass::AddFieldDefinitions(std::vector<CPLXMLNode*, std::allocator<CPLXMLNode*> >) (imdreader.cpp:261)
==30471==    by 0x7ECF947: ImdReader::ReadModel(char const*) (imdreader.cpp:471)
==30471==    by 0x80AFB26: OGRILI2DataSource::Create(char const*, char**) (ogrili2datasource.cpp:239)
==30471== 

==30471== 
==30471== 1,224 (168 direct, 1,056 indirect) bytes in 3 blocks are definitely lost in loss record 3,096 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7EC652D: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<CPLString const, GeomFieldInfo> > >::allocate(unsigned long, void const*) (new_allocator.h:89)
==30471==    by 0x7EC63DB: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_get_node() (stl_tree.h:359)
==30471==    by 0x7EC6254: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_create_node(std::pair<CPLString const, GeomFieldInfo> const&) (stl_tree.h:369)
==30471==    by 0x7EC5F02: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_insert_(std::_Rb_tree_node_base const*, std::_Rb_tree_node_base const*, std::pair<CPLString const, GeomFieldInfo> const&) (stl_tree.h:881)
==30471==    by 0x7EC6081: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_insert_unique(std::pair<CPLString const, GeomFieldInfo> const&) (stl_tree.h:1177)
==30471==    by 0x7EC58AB: std::_Rb_tree<CPLString, std::pair<CPLString const, GeomFieldInfo>, std::_Select1st<std::pair<CPLString const, GeomFieldInfo> >, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<CPLString const, GeomFieldInfo> >, std::pair<CPLString const, GeomFieldInfo> const&) (stl_tree.h:1217)
==30471==    by 0x7EC5321: std::map<CPLString, GeomFieldInfo, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::insert(std::_Rb_tree_iterator<std::pair<CPLString const, GeomFieldInfo> >, std::pair<CPLString const, GeomFieldInfo> const&) (stl_map.h:540)
==30471==    by 0x7EC4EF8: std::map<CPLString, GeomFieldInfo, std::less<CPLString>, std::allocator<std::pair<CPLString const, GeomFieldInfo> > >::operator[](CPLString const&) (stl_map.h:450)
==30471==    by 0x7ED0FCF: IliClass::AddFieldDefinitions(std::vector<CPLXMLNode*, std::allocator<CPLXMLNode*> >) (imdreader.cpp:261)
==30471==    by 0x7ECF947: ImdReader::ReadModel(char const*) (imdreader.cpp:471)
==30471==    by 0x7ECACC9: ILI2Reader::ReadModel(ImdReader*, char const*) (ili2reader.cpp:386)
==30471== 

==30471== 
==30471== 1,776 (560 direct, 1,216 indirect) bytes in 14 blocks are definitely lost in loss record 3,131 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7EC8F67: getPolyline(xercesc_2_8::DOMElement*) (ili2reader.cpp:213)
==30471==    by 0x7ECA701: ILI2Reader::getGeometry(xercesc_2_8::DOMElement*, int) (ili2reader.cpp:349)
==30471==    by 0x7ECB325: ILI2Reader::SetFieldValues(OGRFeature*, xercesc_2_8::DOMElement*) (ili2reader.cpp:461)
==30471==    by 0x7ECB1AD: ILI2Reader::SetFieldValues(OGRFeature*, xercesc_2_8::DOMElement*) (ili2reader.cpp:442)
==30471==    by 0x7ECC837: ILI2Reader::AddFeature(xercesc_2_8::DOMElement*) (ili2reader.cpp:693)
==30471==    by 0x7EC7074: ILI2Handler::endElement(unsigned short const*, unsigned short const*, unsigned short const*) (ili2handler.cpp:131)
==30471==    by 0xC4318C3: xercesc_2_8::SAX2XMLReaderImpl::endElement(xercesc_2_8::XMLElementDecl const&, unsigned int, bool, unsigned short const*) (in /usr/lib/libxerces-c.so.28.0)
==30471==    by 0xC3F4FC1: xercesc_2_8::IGXMLScanner::scanEndTag(bool&) (in /usr/lib/libxerces-c.so.28.0)
==30471==    by 0xC3F57CA: xercesc_2_8::IGXMLScanner::scanContent() (in /usr/lib/libxerces-c.so.28.0)
==30471==    by 0xC3F5987: xercesc_2_8::IGXMLScanner::scanDocument(xercesc_2_8::InputSource const&) (in /usr/lib/libxerces-c.so.28.0)
==30471==    by 0xC4A902C: xercesc_2_8::XMLScanner::scanDocument(unsigned short const*) (in /usr/lib/libxerces-c.so.28.0)
==30471== 

==30471== 
==30471== 7,872 (960 direct, 6,912 indirect) bytes in 24 blocks are definitely lost in loss record 3,233 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7ECA070: getPolygon(xercesc_2_8::DOMElement*) (ili2reader.cpp:306)
==30471==    by 0x7ECABE5: ILI2Reader::getGeometry(xercesc_2_8::DOMElement*, int) (ili2reader.cpp:366)
==30471==    by 0x7ECB325: ILI2Reader::SetFieldValues(OGRFeature*, xercesc_2_8::DOMElement*) (ili2reader.cpp:461)
==30471==    by 0x7ECB1AD: ILI2Reader::SetFieldValues(OGRFeature*, xercesc_2_8::DOMElement*) (ili2reader.cpp:442)
==30471==    by 0x7ECC837: ILI2Reader::AddFeature(xercesc_2_8::DOMElement*) (ili2reader.cpp:693)
==30471==    by 0x7EC7074: ILI2Handler::endElement(unsigned short const*, unsigned short const*, unsigned short const*) (ili2handler.cpp:131)
==30471==    by 0xC4318C3: xercesc_2_8::SAX2XMLReaderImpl::endElement(xercesc_2_8::XMLElementDecl const&, unsigned int, bool, unsigned short const*) (in /usr/lib/libxerces-c.so.28.0)
==30471==    by 0xC3F4FC1: xercesc_2_8::IGXMLScanner::scanEndTag(bool&) (in /usr/lib/libxerces-c.so.28.0)
==30471==    by 0xC3F57CA: xercesc_2_8::IGXMLScanner::scanContent() (in /usr/lib/libxerces-c.so.28.0)
==30471==    by 0xC3F5987: xercesc_2_8::IGXMLScanner::scanDocument(xercesc_2_8::InputSource const&) (in /usr/lib/libxerces-c.so.28.0)
==30471==    by 0xC4A902C: xercesc_2_8::XMLScanner::scanDocument(unsigned short const*) (in /usr/lib/libxerces-c.so.28.0)
==30471== 

==30471== 12,328 (4,576 direct, 7,752 indirect) bytes in 26 blocks are definitely lost in loss record 3,247 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7ECEF22: ImdReader::ReadModel(char const*) (imdreader.cpp:393)
==30471==    by 0x7EC2854: ILI1Reader::ReadModel(ImdReader*, char const*, OGRILI1DataSource*) (ili1reader.cpp:102)
==30471==    by 0x80AB215: OGRILI1DataSource::Open(char const*, char**, int) (ogrili1datasource.cpp:174)
==30471==    by 0x80ABC98: OGRILI1DriverOpen(GDALOpenInfo*) (ogrili1driver.cpp:60)
==30471==    by 0x7C2C709: GDALOpenEx (gdaldataset.cpp:2731)
==30471==    by 0x8266205: OGRVRTLayer::FullInitialize() (ogrvrtlayer.cpp:639)
==30471==    by 0x826BBFD: OGRVRTLayer::GetLayerDefn() (ogrvrtlayer.cpp:2208)
==30471==    by 0x80C0AAA: OGR_L_GetLayerDefn (ogrlayer.cpp:996)
==30471==    by 0x1B74F2B7: _wrap_Layer_GetLayerDefn (ogr_wrap.cpp:3837)
==30471==    by 0x4A7766: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A93D0: PyEval_EvalCodeEx (in /usr/bin/python2.6)
==30471== 
==30471== 14,366 (5,280 direct, 9,086 indirect) bytes in 30 blocks are definitely lost in loss record 3,248 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7ECEF22: ImdReader::ReadModel(char const*) (imdreader.cpp:393)
==30471==    by 0x80AFB26: OGRILI2DataSource::Create(char const*, char**) (ogrili2datasource.cpp:239)
==30471==    by 0x80B08AB: OGRILI2DriverCreate(char const*, int, int, int, GDALDataType, char**) (ogrili2driver.cpp:84)
==30471==    by 0x7C3B183: GDALDriver::Create(char const*, int, int, int, GDALDataType, char**) (gdaldriver.cpp:233)
==30471==    by 0x81ECED5: OGR_Dr_CreateDataSource (ogrsfdriver.cpp:77)
==30471==    by 0x1B74AB83: _wrap_Driver_CreateDataSource (ogr_wrap.cpp:3478)
==30471==    by 0x4A7766: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A93D0: PyEval_EvalCodeEx (in /usr/bin/python2.6)
==30471==    by 0x4A7568: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A82AF: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A82AF: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471== 

==30471== 25,386 (10,208 direct, 15,178 indirect) bytes in 58 blocks are definitely lost in loss record 3,255 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7ECEF22: ImdReader::ReadModel(char const*) (imdreader.cpp:393)
==30471==    by 0x7ECACC9: ILI2Reader::ReadModel(ImdReader*, char const*) (ili2reader.cpp:386)
==30471==    by 0x80AF627: OGRILI2DataSource::Open(char const*, char**, int) (ogrili2datasource.cpp:168)
==30471==    by 0x80B07D3: OGRILI2DriverOpen(GDALOpenInfo*) (ogrili2driver.cpp:61)
==30471==    by 0x7C2C709: GDALOpenEx (gdaldataset.cpp:2731)
==30471==    by 0x81ED60D: OGROpen (ogrsfdriverregistrar.cpp:121)
==30471==    by 0x1B747613: Open(char const*, int) (ogr_wrap.cpp:5010)
==30471==    by 0x1B748B92: _wrap_Open (ogr_wrap.cpp:23560)
==30471==    by 0x4A7766: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A93D0: PyEval_EvalCodeEx (in /usr/bin/python2.6)
==30471==    by 0x4A7568: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471== 
==30471== 36,954 (12,672 direct, 24,282 indirect) bytes in 72 blocks are definitely lost in loss record 3,256 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7ECEF22: ImdReader::ReadModel(char const*) (imdreader.cpp:393)
==30471==    by 0x80AB4A6: OGRILI1DataSource::Create(char const*, char**) (ogrili1datasource.cpp:232)
==30471==    by 0x80ABD70: OGRILI1DriverCreate(char const*, int, int, int, GDALDataType, char**) (ogrili1driver.cpp:83)
==30471==    by 0x7C3B183: GDALDriver::Create(char const*, int, int, int, GDALDataType, char**) (gdaldriver.cpp:233)
==30471==    by 0x81ECED5: OGR_Dr_CreateDataSource (ogrsfdriver.cpp:77)
==30471==    by 0x1B74AB83: _wrap_Driver_CreateDataSource (ogr_wrap.cpp:3478)
==30471==    by 0x4A7766: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A93D0: PyEval_EvalCodeEx (in /usr/bin/python2.6)
==30471==    by 0x4A7568: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A82AF: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A82AF: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471== 
==30471== 146,200 (52,976 direct, 93,224 indirect) bytes in 301 blocks are definitely lost in loss record 3,263 of 3,276
==30471==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==30471==    by 0x7ECEF22: ImdReader::ReadModel(char const*) (imdreader.cpp:393)
==30471==    by 0x7EC2854: ILI1Reader::ReadModel(ImdReader*, char const*, OGRILI1DataSource*) (ili1reader.cpp:102)
==30471==    by 0x80AB215: OGRILI1DataSource::Open(char const*, char**, int) (ogrili1datasource.cpp:174)
==30471==    by 0x80ABC98: OGRILI1DriverOpen(GDALOpenInfo*) (ogrili1driver.cpp:60)
==30471==    by 0x7C2C709: GDALOpenEx (gdaldataset.cpp:2731)
==30471==    by 0x81ED60D: OGROpen (ogrsfdriverregistrar.cpp:121)
==30471==    by 0x1B747613: Open(char const*, int) (ogr_wrap.cpp:5010)
==30471==    by 0x1B748B92: _wrap_Open (ogr_wrap.cpp:23560)
==30471==    by 0x4A7766: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==30471==    by 0x4A93D0: PyEval_EvalCodeEx (in /usr/bin/python2.6)
==30471==    by 0x4A7568: PyEval_EvalFrameEx (in /usr/bin/python2.6)

(I've only included the definitely lost. There are a lot of potentially lost in Xerces code paths that might be false positives)

Change History (1)

comment:1 by Even Rouault, 8 years ago

Milestone: 2.1.0
Resolution: fixed
Status: newclosed

trunk r32723 "ILI: fix memory leaks (#6178)"

Note: See TracTickets for help on using tickets.