[postgis-devel] [PostGIS] #1697: Crash in GiST index with empty MultiPolygons

PostGIS trac at osgeo.org
Fri Mar 23 15:01:41 PDT 2012


#1697: Crash in GiST index with empty MultiPolygons
---------------------------+------------------------------------------------
 Reporter:  realityexists  |       Owner:  pramsey      
     Type:  defect         |      Status:  new          
 Priority:  critical       |   Milestone:  PostGIS 2.0.0
Component:  postgis        |     Version:  trunk        
 Keywords:                 |  
---------------------------+------------------------------------------------

Comment(by pramsey):

 Problem understood.

 When a key is passed into gist compress, you are expected to compress it
 and return a key suitable for insertion into the index. For null, the gist
 superstructure actually bypasses the user function, so our null handling
 never even gets called. For non-null, the expectation is that we'll return
 something sensible, that is to say, a key we will be able to handle
 correctly later on.

 Instead, when we hit the empty case, we're just echoing back the input key
 datum, so it's a garbage key. Any sensible behavior we have gotten with
 empties so far is blind luck. Probably because we don't care about them
 much, and don't seem to insert them in an index often or at all.

 We need to either (a) figure out how to handle them like nulls (just
 blindly copying the old user-function null handling (which as noted above,
 doesn't actually get called) over resulted in crashes, so more research
 there is required) or (b) actually add an "empty box" semantic and deal
 with how to search over empty boxes properly. For (b) one possibility
 might be to generate a (Inf, Inf, Inf, Inf) box, that won't intersect
 anything but itself (I think), however, that could also end up unbalancing
 trees nastily.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1697#comment:9>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list