Opened 16 years ago
Last modified 16 years ago
#116 closed task (fixed)
Hex string representing POLYGON EMPTY crashes postmaster
Reported by: | martijnm | Owned by: | |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 1.3.6 |
Component: | postgis | Version: | 1.3.X |
Keywords: | Cc: |
Description
What steps will reproduce the problem?
This will demonstrate the crashing of the postmaster:
gisbase⇒ select astext('010300000000000000'); server closed the connection unexpectedly
This probably means the server terminated abnormally before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
What is the expected output? What do you see instead?
Expected would be a result of 'POLYGON EMPTY'.
What version of the product are you using? On what operating system?
gisbase⇒ select postgis_full_version();
postgis_full_version
POSTGIS='1.3.5' GEOS='3.0.3-CAPI-1.4.2' PROJ='Rel. 4.6.1, 21 August 2008'
on a Sun AMD:
SunOS 5.10 Generic_138889-02 i86pc i386 i86pc
Please provide any additional information below.
Apparently postgis maps empty geometry internally to an empty collection:
gisbase⇒ select geomfromewkt('POLYGON EMPTY');
geomfromewkt
(1 row)
gisbase⇒ select astext(geomfromewkt('POLYGON EMPTY'));
astext
GEOMETRYCOLLECTION EMPTY
(1 row)
However, if third party software tries to write a hexadecimal representation of an empty polygon ('010300000000000000'). PostGIS will crash the postmaster. This is the case when using FME to load a shapefile to PostGIS for example.
Both a. insert statements and b. copy statements using hexadecimal representation will crash the postmaster. WKT notation goes correct and can thus be used as temporary workaround.
Happens on my 1.3.5 install too. Also happens on my 8.3 1.4 so still seems to be an issue.