#219 closed defect (fixed)
This geometry causes buffer(?, 0) to crash the PostGresql server
Reported by: | robe | Owned by: | strk |
---|---|---|---|
Priority: | major | Milestone: | 3.0.4 |
Component: | Default | Version: | 3.0.3 |
Severity: | Unassigned | Keywords: | |
Cc: | mbdavis@… |
Description (last modified by )
This was submitted to PostGIS -- and we have confirmed this to be an issue in 3.0.3 and 3.1.0 SVN of GEOS with newer installs of PostGIS and believe its a GEOS bug and not a PostGIS one. Refer to http://code.google.com/p/postgis/issues/detail?id=81
What steps will reproduce the problem?
- Run the attached script
What is the expected output? What do you see instead?
server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. connection to server was lost
What version of the product are you using? On what operating system?
psql 8.3.5 postgis_version: 1.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 postgis_geos_version: 3.0.1-CAPI-1.4.2 Fedora 10
Please provide any additional information below.
The following is written to the log file:
bufferOriginalPrecision failed (TopologyException: unable to assign hole to a shell), trying with reduced precision recomputing with precision scale factor = 1e+09 Scaler: offsetX,Y: 0,0 scaleFactor: 1e+09 dstahlke svdev [local] SELECT: ../../source/headers/geos/noding/SegmentString.h:175: void geos::noding::SegmentString::testInvariant() const: Assertion `pts->size() > 1' failed. LOG: server process (PID 863) was terminated by signal 6: Aborted LOG: terminating any other active server processes LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2008-12-05 14:16:19 AKST LOG: database system was not properly shut down; automatic recovery in progress LOG: record with zero length at 0/3C5BC340 LOG: redo is not required LOG: database system is ready to accept connections LOG: autovacuum launcher started
Attachments (3)
Change History (11)
by , 15 years ago
Attachment: | geos-bug.sql added |
---|
comment:1 by , 15 years ago
Milestone: | → 3.0.4 |
---|---|
Owner: | changed from | to
Version: | → 3.0.3 |
comment:2 by , 15 years ago
Description: | modified (diff) |
---|
comment:3 by , 15 years ago
comment:4 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Confirmed, can reproduce with a GEOS XML test. Working on it.
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed as of revision 2481.
comment:6 by , 15 years ago
Note: the input multipolygon is invalid: NOTICE: Self-intersection at or near point -164.805 63.0918
That said, I don't think it is sane to put it into an XML tester as we can't really pretend the non-segfaulting result is the correct one (and it isn't, in that it trims out the offending polygon)
comment:7 by , 15 years ago
Right, the reason people are running buffer(,0) is to "clean" invalid polygons. What we need is to start building an API specifically for that purpose that expects, nay, welcomes invalidity.
comment:8 by , 15 years ago
Cc: | added |
---|
Not sure the result I'm seeing we can accept as an "expected" cleanup output.
I attach an XML tester (expecting empty geom, just for fun) and an SQL file that creates a bug219_xml table with fields 'a' as input geometry and 'obtained' as the result of buffer(0).
Martin, your thoughts on this ? Is it sane to use Buffer(0) to cleanup geoms, and is what you get on the attached geometry an expected cleanup ?
OK, I can reproduce the crash here. The problem is that the fifth component of the MULTIPOLYGON is a zero-area (within floating point tolerance) square. If I re-build the multipolygon without that element, the crash goes away. Here's what I did...
So the work-around is there, if you need it, and we know pretty precisely where the problem is to go and fix it.