Opened 7 months ago

Closed 7 months ago

#5712 closed defect (fixed)

TopoGeo_LoadGeometry coredumps database when NULL geometry

Reported by: Lars Aksel Opsahl Owned by: strk
Priority: medium Milestone: PostGIS 3.5.0
Component: topology Version: master
Keywords: Cc:

Description

On

POSTGIS="3.5.0dev 3.4.0rc1-1087-g2e4d96393" [EXTENSION] PGSQL="140" GEOS="3.12.1-CAPI-1.18.1" PROJ="9.4.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/Users/lop/Library/Application Support/proj DATABASE_PATH=/opt/homebrew/Cellar/proj/9.4.0/share/proj/proj.db" LIBXML="2.13.0" LIBJSON="0.17" TOPOLOGY

PostgreSQL 14.11 (Homebrew) on aarch64-apple-darwin23.2.0, compiled by Apple clang version 15.0.0 (clang-1500.1.0.2.5), 64-bit

Running this command

SELECT topology.CreateTopology ('t1', 4258 , 0);
 createtopology 
----------------
              3
(1 row)

select topology.TopoGeo_LoadGeometry('t1',null::geometry,0::float8);


I get this response

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.

And the log I find this

2024-04-15 10:56:13.390 CEST [35641] LOG:  server process (PID 35927) was terminated by signal 11: Segmentation fault: 11

Change History (2)

comment:1 by strk, 7 months ago

Milestone: PostGIS 3.4.3PostGIS 3.5.0
Status: newassigned
Version: 3.4.xmaster

Confirmed, I'm on it. The function is new in 3.5 so only master needs be fixed

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

Resolution: fixed
Status: assignedclosed

In 1d12c31/git:

Fix crash on NULL geometry input to LoadGeometry

Also short-circuit the EMPTY case
Includes regress test.

Closes #5712

Note: See TracTickets for help on using tickets.