Opened 13 years ago
Closed 13 years ago
#1150 closed defect (fixed)
Prevent people from inserting entries in spatial_ref_sys with no proj4text
Reported by: | robe | Owned by: | strk |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 1.5.4 |
Component: | postgis | Version: | 1.5.X |
Keywords: | windows | Cc: |
Description
At least on windows if you have an empty proj4text for example in #1149
Then PostgreSQL comes crashing down if you try to transform to such a beast. We shouldn't even be allowing people to insert these things in the table to begin with.
Change History (17)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Owner: | changed from | to
---|
Good point. I think you or Mark can take care of this one then. Feel free to push it over to Mark.
comment:3 by , 13 years ago
Robe: I get no crash, but an exception, when proj4text is empty:
=# select st_transform('srid=4326;POINT(0 0)'::geometry, 2046);ERROR: AddToPROJ4SRSCache: couldn't parse proj4 string: '': (null)
This is with current (svn r7968) PostGIS Can you reproduce a real crash on windows with it ?
comment:4 by , 13 years ago
Yes crashes on my 1.5 and postgis 2.0 trunk. I tested on 2.0 on both 8.4 and 9.1.
which version of proj are you running. I'm running 4.6.1.
pg_Log doesn't even give any detail -- it just crashed too quickly to be logged. I suspect its one of those tragedies that only befalls windows users.
comment:5 by , 13 years ago
Keywords: | windows added |
---|
comment:7 by , 13 years ago
well I tried that example you had above 2046 and in my table that is an empty string. Haven't tried null yet.
comment:10 by , 13 years ago
or even better, a backtrace... (looking at the code it seems this might be a proj4 rather than postgis bug).
comment:12 by , 13 years ago
Yes happens with 2.0 trunk. Not near my compiler at moment. Will try next time.
comment:14 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Crasher removed from 2.0 at r8910.
comment:15 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Still crashes for me:
insert into spatial_ref_sys (srid, proj4text) values (500001,NULL); insert into spatial_ref_sys (srid, proj4text) values (500002, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'); select '#1150', st_astext(st_transform('SRID=500002;POINT(0 0)',500001));
comment:17 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fine now just gives a notice instead of crashing
ERROR: AddToPROJ4SRSCache: couldn't parse proj4 string: :
The crash should be fixed at a lower level. I see possible valid reasons not to insert a proj4 string (yet): you don't know it and don't want to think about it _now_ but you will later, looking at the srtext..