Opened 3 months ago

Closed 3 months ago

Last modified 7 weeks ago

#5684 closed defect (fixed)

Segfault from _RegisterMissingFaces

Reported by: strk Owned by: strk
Priority: blocker Milestone: PostGIS 3.5.0
Component: topology Version: master
Keywords: Cc:

Description

I'm getting a segfault from a draft implementation of TopoGeo_addGeometry which is pure plpgsql and shows the segfault happens when calling the internal _RegisterMissingFaces function which is instead written in C.

The C function is only accessible from 3.5.0dev (still unreleased) so I'm marking this as a blocker to avoid shipping a crashable version.

Attachments (1)

issue5684.pgtopo (227.0 KB ) - added by strk 3 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Sandro Santilli <strk@…>, 3 months ago

In a6194d2/git:

Move topology polygonizer code in its own file

References #5684

by strk, 3 months ago

Attachment: issue5684.pgtopo added

comment:2 by strk, 3 months ago

Instructions to reproduce:

  1. Download the attached issue5684.pgtopo
  2. Import with: pgtopo_import -f issue5684.pgtopo issue5684 | psql postgis_reg
  3. select topology._registermissingfaces('issue5684'); — 3 times

Here's the dance performance:

strk=# select topology._registermissingfaces('issue5684');
ERROR:  Polygonize: face table is not empty.
strk=# select topology._registermissingfaces('issue5684');
ERROR:  Polygonize: face table is not empty.
strk=# select topology._registermissingfaces('issue5684');
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: Failed.
The connection to the server was lost. Attempting reset: Failed.
!?> 

comment:3 by Sandro Santilli <strk@…>, 3 months ago

Resolution: fixed
Status: newclosed

In 56023cc/git:

Always initialize the mbr member of fetched faces

Closes #5684

comment:4 by strk, 7 weeks ago

The fixing change was too wide in scope, introducing bug #5707. The change was reverted with [943215120c9fe63de0523f9560ca6a1a44e329aa/git] so I'm reopening this ticket as the fix needs to be somewhere else

comment:5 by Sandro Santilli <strk@…>, 7 weeks ago

In 9eefe39/git:

Do not attempt to release non-allocated face MBR

Fixes crash in _RegisterMissingFaces internal function
Closes #5684

Note: See TracTickets for help on using tickets.