Opened 13 years ago

Last modified 11 years ago

#126 closed defect

CAPI GEOSGeom_getDimensions() segfaults operating on 'GEOMETRYCOLLECTION EMPTY'

Reported by: hrz@… Owned by: strk@…
Priority: critical Milestone:
Component: C-API Version: master
Severity: Significant Keywords: imported, phpbugtracker
Cc: mloskot

Description (last modified by mloskot)

The following code causes a segmentation fault:

GEOSGeometry* geom = GEOSGeomFromWKT("GEOMETRYCOLLECTION EMPTY");
int ndims = GEOSGeom_getDimensions(geom);

A backtrace for it looks like:

#0  0xb7d0940a in geos::geom::GeometryCollection::getGeometryN (this=0x804a900, n=0) at GeometryCollection.cpp:132
No locals.
#1  0xb7eedcdf in GEOSGeom_getDimensions (g=0x804a900) at geos_c.cpp:1796

My system is:

$ uname -a
Linux 2.6.17-gentoo-r7 #2 PREEMPT Thu Sep 7 12:29:51 BST 2006 i686 AMD Athlon(tm) XP 2800+ AuthenticAMD GNU/Linux
{{{
and GEOS CAPI 3.0.0rc2-CAPI-1.3.0 with:
{{{
$ gcc-config -c
i686-pc-linux-gnu-4.1.1
}}}
}}}

Change History (5)

comment:1 Changed 13 years ago by strk@…

Committed a patch for this in TRUNK, please try again by updating your working copy or fetching the online snapshot in an hour or so.
Thanks!

comment:2 Changed 13 years ago by hrz@…

That works fine - thanks for the quick response!

comment:3 Changed 12 years ago by mloskot

Cc: mloskot added
Description: modified (diff)
Milestone: imported3.0.0
Priority: 3critical
Severity: AnnoyanceSignificant
Version: 3.0.0svn-trunk

comment:4 Changed 12 years ago by mloskot

Duplicate of #132

comment:5 Changed 11 years ago by (none)

Milestone: 3.0.0

Milestone 3.0.0 deleted

Note: See TracTickets for help on using tickets.