[geos-devel] [GEOS] #923: Memory leak in GEOSNode

GEOS geos-trac at osgeo.org
Fri Sep 14 02:23:15 PDT 2018


#923: Memory leak in GEOSNode
-------------------------+--------------------------
 Reporter:  Algunenano   |      Owner:  geos-devel@…
     Type:  defect       |     Status:  new
 Priority:  major        |  Milestone:  3.7.0
Component:  Default      |    Version:  master
 Severity:  Significant  |   Keywords:
-------------------------+--------------------------
 Small repro test: `geos_leak.c` (attached)

 Leak (full log in `leak_summary.log`):
 {{{
 $ clang -fsanitize=address geos_leak.c -lgeos_c -L/usr/lib
 -I/usr/include/geos
 $ ./a.out

 =================================================================
 ==15579==ERROR: LeakSanitizer: detected memory leaks

 Indirect leak of 88 byte(s) in 1 object(s) allocated from:
     #0 0x563c03fb26a1 in __interceptor_malloc
 (/home/raul/dev/public/postgis/a.out+0xe66a1)
     #1 0x7fdddba9e5fc in operator new(unsigned long)
 /build/gcc/src/gcc/libstdc++-v3/libsupc++/new_op.cc:50:40
     #2 0x7fdddbcaa3e2 in
 geos::noding::GeometryNoder::extractSegmentStrings(geos::geom::Geometry
 const&, std::vector<geos::noding::SegmentString*,
 std::allocator<geos::noding::SegmentString*> >&)
 /usr/src/debug/geos/src/noding/GeometryNoder.cpp:157:12
     #3 0x7fdddbcaa88b in geos::noding::GeometryNoder::getNoded()
 /usr/src/debug/geos/src/noding/GeometryNoder.cpp:123:24
     #4 0x7fdddbcaaa55 in
 geos::noding::GeometryNoder::node(geos::geom::Geometry const&)
 /usr/src/debug/geos/src/noding/GeometryNoder.cpp:80:25
     #5 0x7fdddc10f497 in GEOSNode_r
 /usr/src/debug/geos/capi/geos_ts_c.cpp:2450:76
     #6 0x563c03fe6a75 in main
 (/home/raul/dev/public/postgis/a.out+0x11aa75)
     #7 0x7fdddbd7f222 in __libc_start_main (/usr/lib/libc.so.6+0x24222)

 ...

 SUMMARY: AddressSanitizer: 360 byte(s) leaked in 8 allocation(s).

 }}}

 The issue wasn't there in rc1 (`geos-git-3.7.0rc1.r9.g1be02b36` building
 from git) but it is there with current master/HEAD (`geos-
 git-3.7.0rc1.r21.gbe8b3ffb`).

-- 
Ticket URL: <https://trac.osgeo.org/geos/ticket/923>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list