#5347 closed defect (fixed)

berries are crashing on garden tests ST_Intersection(geography, geography) infinite linestring and point, _ST_BestSRID

Reported by: robe Owned by: pramsey
Priority: blocker Milestone: PostGIS 3.0.9
Component: postgis Version: master
Keywords: Cc:

Description (last modified by robe)

SELECT ST_Intersection(geography(foo1.the_geom), geography(foo2.the_geom)) As result, ST_AsText(foo1.the_geom) As ref1_geom, ST_AsText(foo2.the_geom) As ref2_geom
        FROM ((SELECT '0102000020E610000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geometry  AS the_geom
                )
                ) As foo1 CROSS JOIN ((SELECT '0101000020E6100000000000000000F07F000000000000F07F'::geometry AS the_geom ) ) As foo2 LIMIT 10

NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
connection to server was lost

when I run this on my system I don't get a crash though, I get

NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY

ERROR:  Cannot find SRID (-2146484647) in spatial_ref_sys
CONTEXT:  SQL function "st_intersection" statement 1
SQL state: XX000

So crash I guess might be ARM specific, though having a crazy srid is not that helpful either.

Change History (8)

comment:1 by robe, 14 months ago

Description: modified (diff)

Looks like it's the _ST_BestSRID function coming up with that SRID

 SELECT _ST_BestSRID('0102000020E610000005000000000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F000000000000F07F'::geometry, '0101000020E6100000000000000000F07F000000000000F07F'::geometry)

Yields: -2146484647

comment:2 by robe, 14 months ago

Summary: berries are crashing on garden tests ST_Intersection(geography, geography) infinite linestring and pointberries are crashing on garden tests ST_Intersection(geography, geography) infinite linestring and point, _ST_BestSRID

comment:3 by Regina Obe <lr@…>, 14 months ago

In 2c76ff2/git:

Reject infinite coordinates in _ST_BestSRID

to prevent crash on ARM (maybe other systems too)
References #5347 for PostGIS 3.4.0

Also change convert to gserialized logic to use newer syntax

comment:4 by pramsey, 14 months ago

Your fix works for me on Apple ARM. No crash, proper errors generated.

comment:5 by Regina Obe <lr@…>, 13 months ago

In 66ec3e9e/git:

Reject infinite coordinates in _ST_BestSRID

to prevent crash on ARM (maybe other systems too)
References #5347 for PostGIS 3.3.3

Also change convert to gserialized logic to use newer syntax

comment:6 by Regina Obe <lr@…>, 13 months ago

In a895ebc/git:

Reject infinite coordinates in _ST_BestSRID

to prevent crash on ARM (maybe other systems too)
References #5347 for PostGIS 3.2.5

Also change convert to gserialized logic to use newer syntax

comment:7 by Regina Obe <lr@…>, 13 months ago

In 18e7a7c/git:

Reject infinite coordinates in _ST_BestSRID

to prevent crash on ARM (maybe other systems too)
References #5347 for PostGIS 3.1.9

Also change convert to gserialized logic to use newer syntax

comment:8 by Regina Obe <lr@…>, 13 months ago

Resolution: fixed
Status: newclosed

In 0abc351/git:

Reject infinite coordinates in _ST_BestSRID

to prevent crash on ARM (maybe other systems too)
Closes #5347 for PostGIS 3.0.9

Also change convert to gserialized logic to use newer syntax

Note: See TracTickets for help on using tickets.