Opened 18 months ago

Closed 18 months ago

Last modified 12 months ago

#5277 closed defect (fixed)

PG16 PostgreSQL 16 crashing on raster install

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 3.4.0
Component: raster Version: master
Keywords: PostgreSQL 16 pg16 Cc:

Description

I thought it was just my setup, but debbie is having the same issue with her PG16 run as I am

22:54:44  topology has been added to end of database search_path 
22:54:44 (1 row)
22:54:44 
22:54:44 NOTICE:  schema "public" already exists, skipping
22:54:44 NOTICE:  schema "public" already exists, skipping
22:54:44 psql:/var/lib/jenkins/workspace/postgis/branches/3.4/regress/00-regress-install/share/contrib/postgis/rtpostgis.sql:111: server closed the connection unexpectedly
22:54:44 	This probably means the server terminated abnormally
22:54:44 	before or while processing the request.
22:54:44 psql:/var/lib/jenkins/workspace/postgis/branches/3.4/regress/00-regress-install/share/contrib/postgis/rtpostgis.sql:111: error: connection to server was lost
22:54:44 -----------------------------------------------------------------------------
22:54:44 make: *** [regress/runtest.mk:24: check-regress] Error 1
22:54:44 Build step 'Execute shell' marked build as failure
22:54:44 Triggering a new build of PostgreSQL stop
22:54:44 Finished: FAILURE

It just crashes. ON mine it crashes on line 100 of rtpostgis.sql

As best I can tell, this started happening with the commit of

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a73952b795632b2cf5acada8476e7cf75857e9be

I haven't checked to see what that line corresponds to yet.

Commit a73952b795632b2cf5acada8476e7cf75857e9be by michael

Add check on initial and boot values when loading GUCs

This commit adds a function to perform a cross-check between the initial
value of the C declaration associated to a GUC and its actual boot
value in assert-enabled builds.  The purpose of this is to prevent
anybody reading these C declarations from being fooled by mismatched
values before they are loaded at program startup.

The following rules apply depending on the GUC type:
* bool - can be false, or same as boot_val.
* int - can be 0, or same as the boot_val.
* real - can be 0.0, or same as the boot_val.
* string - can be NULL, or strcmp'd equal to the boot_val.
* enum - equal to the boot_val.

This is done for the system as well custom GUCs loaded by external
modules, which may require extension developers to adapt the C
declaration of the variables used by these GUCs (testing this change
with some of my own modules has allowed me to catch some stupid typos,
FWIW).  This may finish by being a bad experiment depending on the
feedbcak received, but let's see how it goes.

Author: Peter Smith
Reviewed-by: Nathan Bossart, Tom Lane, Michael Paquier, Justin Pryzby
Discussion: https://postgr.es/m/CAHut+PtHE0XSfjjRQ6D4v7+dqzCw=d+1a64ujra4EX8aoc_Z+w@mail.gmail.com

On my setup lines 95 - 107 are these and it is crashing at 100

-- part of Raster type
-- expects input to be Hex WKB
CREATE OR REPLACE FUNCTION raster_in(cstring)
    RETURNS raster
    AS 'C:/ming64gcc81/projects/postgis/postgis-git/regress/00-regress-install/lib/postgis_raster-3.4','RASTER_in'
    LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE;
# line 100
-- part of Raster type
-- expects output to be Hex WKB
CREATE OR REPLACE FUNCTION raster_out(raster)
    RETURNS cstring
    AS 'C:/ming64gcc81/projects/postgis/postgis-git/regress/00-regress-install/lib/postgis_raster-3.4','RASTER_out'
    LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE;

Change History (9)

comment:1 by robe, 18 months ago

I should add debbie doesn't build with every push of postgresql master. So the error would lie anywhere after this commit

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d9d873bac67047cfacc9f5ef96ee488f2cb0f1c3: Clean up some inconsistencies with GUC declarations (details)

and on or before the above commit - https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a73952b795632b2cf5acada8476e7cf75857e9be

but on closer inspection, I'm not seeing any commits between these, so I guess https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a73952b795632b2cf5acada8476e7cf75857e9be is probably the smoking gun.

Last edited 18 months ago by robe (previous) (diff)

comment:2 by robe, 18 months ago

Keywords: PostgreSQL 16 pg16 added

comment:3 by robe, 18 months ago

yap confirmed running this is sufficient to crash my backend:

CREATE OR REPLACE FUNCTION raster_in(cstring)
    RETURNS raster
    AS 'C:/ming64gcc81/projects/postgis/postgis-git/regress/00-regress-install/lib/postgis_raster-3.4','RASTER_in'
    LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE;

Sadly gdb is of no help here.

There is no backtrace of meaning

Reading symbols from C:\ming64gcc81\projects\postgresql\rel\pg16w64gcc81\bin\postgres.exe...done.
(gdb) cont
Continuing.
[Thread 17048.0xad4 exited with code 0]
[Thread 17048.0x2874 exited with code 3]
[Thread 17048.0x590c exited with code 3]
[Thread 17048.0x2e98 exited with code 3]
[Thread 17048.0x4d70 exited with code 3]
[Thread 17048.0x64d8 exited with code 3]
[Inferior 1 (process 17048) exited with code 03]

comment:4 by robe, 18 months ago

I'm guessing it's failing in the _PG_init(void) of raster, which is where default boot values are set.

comment:5 by robe, 18 months ago

Summary: PG16 crashing on raster installPG16 PostgreSQL 16 crashing on raster install

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

Resolution: fixed
Status: newclosed

In 5df6277/git:

Fix crash in PG16 on raster.
Closes #5277 for PostGIS 3.4.0

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

In 4aabcd4/git:

Fix multi-def error introduced in last commit. References #5277 for PostGIS 3.4.0

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

In a18bfd0/git:

Mark them as all static. References #5277 for PostGIS 3.4.0

comment:9 by Regina Obe <lr@…>, 12 months ago

In 76f44de/git:

Support build on Pg16devel for PostGIS 3.3.3

Closes #5257
Closes #5261
Closes #5277
Closes #5308
Closes #5374
Closes https://github.com/postgis/postgis/pull/716

Note: See TracTickets for help on using tickets.