Opened 3 years ago

Closed 3 years ago

#5152 closed defect (fixed)

ST_Split goes into infinite loop with empty geometries

Reported by: robe Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.5.7
Component: postgis Version: 3.2.x
Keywords: Cc:

Description (last modified by komzpa)

SELECT ST_Split('LINESTRING EMPTY'::geometry, ST_Point(10,50)) As result

with recurring notice:

NOTICE:  lwgeom_api.c [138] called with n=511880 and npoints=0
NOTICE:  lwgeom_api.c [138] called with n=511881 and npoints=0

Change History (11)

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

Resolution: fixed
Status: newclosed

In 34007a2/git:

Demote ST_Split notices to debug

Closes #5152

comment:2 by komzpa, 3 years ago

Description: modified (diff)
Resolution: fixed
Status: closedreopened

ahem strk the endless loop is still there.

comment:3 by strk, 3 years ago

Oops, I overlooked the "infinite loop" part. How back in stable branches did you guys test ?

comment:4 by strk, 3 years ago

Do you like this fix ? https://gitlab.com/postgis/postgis/-/merge_requests/82

Results in GEOMETRYCOLLECTION(LINESTRING EMPTY) output, on the basis of the documented fact that if a blade does not intersect a line, the returned collection will return the full input untouched (which in this case was empty)

comment:5 by robe, 3 years ago

I only tested master, but assumed it probably has been there for a while. I'm going to commit my garden test changes to master and then the other branches to see how far it goes.

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

In 5cff5f7/git:

Fix infinite loop in lwline_split_by_point_to

References #5152 in master branch
Includes unit and regress test

comment:7 by strk, 3 years ago

I pushed to master, needs be backported still, but I'm not going to have time any soon (feel free to backport, it's a single commit, needs NEWS entry in each back branch)

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

In e039130b/git:

Fix infinite loop in lwline_split_by_point_to

References #5152 in 3.0 branch (3.0.6dev)
Includes unit and regress test

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

In ff3d4b6/git:

Fix infinite loop in lwline_split_by_point_to

References #5152 in 3.2 branch (3.2.2dev)
Includes unit and regress test

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

In 2979ae7c/git:

Fix infinite loop in lwline_split_by_point_to

References #5152 in 3.1 branch (3.1.6dev)
Includes unit and regress test

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

Resolution: fixed
Status: reopenedclosed

In 260e4b6/git:

Fix infinite loop in lwline_split_by_point_to

Closes #5152 in 2.5 branch (2.5.7dev)
Includes unit and regress test

Note: See TracTickets for help on using tickets.