Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#610 closed defect (worksforme)

geos 3.3.6 : WKTReader fails on POINT(0 0) (MSVC 2008, W7)

Reported by: gt75 Owned by: geos-devel@…
Priority: major Milestone: 3.3.7
Component: Default Version: 3.3.6
Severity: Unassigned Keywords:
Cc:

Description

Simple program fails with heap corruption error.

namespace ggm = geos::geom;

namespace gio = geos::io;

ggm::PrecisionModel *pm = new ggm::PrecisionModel(PrecisionModel::FLOATING);

ggm::GeometryFactory *gf = new ggm::GeometryFactory(pm);

gio::WKTReader *wktReader = new gio::WKTReader(gf);

const std::string str = " POINT (0 0) ";

ggm::Geometry *geom = wktReader->read(str); HERE IT FAILS

delete wktReader;

Change History (6)

comment:1 by strk, 11 years ago

Did "make check" succeed ?

comment:2 by mloskot, 11 years ago

Resolution: worksforme
Status: newclosed

My crystal sphere failed to figure out what you mean by "HERE IT FAILS", but the tests confirm everything is in order and the mysterious failure is not reproducible r3740

comment:3 by mloskot, 11 years ago

Tested using VS2010

comment:4 by gt75, 11 years ago

As concerns diagnostics - I got error like 'HEAP CORRUPTION near variable wktReader". Nothing more. As for "make check" - I am newbie - how can I do it? I built geos with CMake method and further "nmake /f makefile.vc" . Command "msbuild geos.sln" fails just as in Ticket #576 . How did you prepare geos binaries for MSVC ?

WBW&R, Grigory.

comment:5 by mloskot, 11 years ago

The "heap corruption" may mean lots of things, including problems in your program that happened earlier, before WKTReader is called.

If you build with CMake, then you should get the geos_unit program built as well. Just execute it and it should run all tests.

Grab and apply the patch from #611, it should help.

comment:6 by gt75, 11 years ago

Thanks a lot! The patch solved my problem.

Note: See TracTickets for help on using tickets.