[postgis-tickets] [PostGIS] #4779: server process (PID 49666) was terminated by signal 6: Aborted, munmap_chunk(): invalid pointer

PostGIS trac at osgeo.org
Sat Oct 31 01:50:46 PDT 2020


#4779: server process (PID 49666) was terminated by signal 6: Aborted,
munmap_chunk(): invalid pointer
-----------------------+---------------------------
  Reporter:  laopsahl  |      Owner:  pramsey
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 3.1.0
 Component:  postgis   |    Version:  3.0.x
Resolution:            |   Keywords:
-----------------------+---------------------------

Comment (by laopsahl):

 I got help from Magnus Hagender he found out that the problem was related
 this [https://stackoverflow.com/questions/42912038/what-is-the-difference-
 between-cxa-atexit-and-atexit]. He also that this does not happen all
 systems. Hen had run it on CentOs before i failed.

 Then I managed to make a simple test cases that fails.

 Run this command


 {{{
 psql  postgres -c "drop DATABASE test1"
 psql  postgres -c "CREATE DATABASE test1 template=template0;"
 psql  test1 -c "create extension pg_stat_statements; create extension
 postgis; create extension postgis_topology; create extension
 postgis_raster ;"


 }}}

 and I find this in my postgres log


 {{{
 free(): invalid pointer
 2020-10-31 10:50:50.857 CET [25765] LOG:  server process (PID 28736) was
 terminated by signal 6: Aborted
 2020-10-31 10:50:50.857 CET [25765] LOG:  terminating any other active
 server processes
 2020-10-31 10:50:50.857 CET [28731] WARNING:  terminating connection
 because of crash of another server process
 2020-10-31 10:50:50.857 CET [28731] DETAIL:  The postmaster has commanded
 this server process to roll back the current transaction and exit, because
 another server process exited abnormally and possibly corrupted shared
 memory.
 2020-10-31 10:50:50.857 CET [28731] HINT:  In a moment you should be able
 to reconnect to the database and repeat your command.
 2020-10-31 10:50:50.858 CET [25765] LOG:  all server processes terminated;
 reinitializing
 2020-10-31 10:50:50.906 CET [28740] LOG:  database system was interrupted;
 last known up at 2020-10-31 10:50:49 CET
 2020-10-31 10:50:51.404 CET [28740] LOG:  database system was not properly
 shut down; automatic recovery in progress
 2020-10-31 10:50:51.427 CET [28740] LOG:  redo starts at 0/EF5E570
 2020-10-31 10:50:51.470 CET [28740] LOG:  invalid record length at
 0/FA38A08: wanted 24, got 0
 2020-10-31 10:50:51.470 CET [28740] LOG:  redo done at 0/FA207A0
 2020-10-31 10:50:52.021 CET [25765] LOG:  database system is ready to
 accept connections

 }}}

 Then  run this


 {{{
 psql  test1 -c "CREATE SCHEMA test_topo_ar50;
 CREATE UNLOGGED TABLE
 test_topo_ar50.ar50_utvikling_flate_border_line_many_points (
     id integer NOT NULL,
     log_time timestamp without time zone DEFAULT now(),
     geo public.geometry(LineString,25833)
 );
 CREATE SEQUENCE
 test_topo_ar50.ar50_utvikling_flate_border_line_many_points_id_seq
     AS integer
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
     NO MAXVALUE
     CACHE 1;
 CREATE SCHEMA tmp_jm_raster;
 CREATE TABLE tmp_jm_raster.dem25_norge_raster (
     rid integer NOT NULL,
     rast public.raster,
     filename text,
     CONSTRAINT enforce_height_rast CHECK ((public.st_height(rast) = 100)),
     CONSTRAINT enforce_max_extent_rast CHECK
 (public.st_coveredby(public.st_convexhull(rast),
 '0103000020E96400000100000005000000000000001803FCC0000000A01C6C5841000000001803FCC0000000A06E645E4100000080DA483141000000A06E645E4100000080DA483141000000A01C6C5841000000001803FCC0000000A01C6C5841'::public.geometry)),
     CONSTRAINT enforce_nodata_values_rast CHECK
 (((public._raster_constraint_nodata_values(rast))::numeric(16,10)[] =
 '{32767}'::numeric(16,10)[])),
     CONSTRAINT enforce_num_bands_rast CHECK ((public.st_numbands(rast) =
 1)),
     CONSTRAINT enforce_out_db_rast CHECK
 ((public._raster_constraint_out_db(rast) = '{f}'::boolean[])),
     CONSTRAINT enforce_pixel_types_rast CHECK
 ((public._raster_constraint_pixel_types(rast) = '{16BSI}'::text[])),
     CONSTRAINT enforce_same_alignment_rast CHECK
 (public.st_samealignment(rast,
 '0100000000000000000000394000000000000039C0000000001803FCC0000000A06E645E4100000000000000000000000000000000E964000001000100'::public.raster)),
     CONSTRAINT enforce_scalex_rast CHECK
 (((public.st_scalex(rast))::numeric(16,10) = (25)::numeric(16,10))),
     CONSTRAINT enforce_scaley_rast CHECK
 (((public.st_scaley(rast))::numeric(16,10) =
 ('-25'::integer)::numeric(16,10))),
     CONSTRAINT enforce_srid_rast CHECK ((public.st_srid(rast) = 25833)),
     CONSTRAINT enforce_width_rast CHECK ((public.st_width(rast) = 100))
 );
 CREATE SCHEMA ok_grl;
 CREATE TABLE ok_grl.ok_kommkyst_flate (
     gid integer NOT NULL,
     ftema integer,
     komid integer,
     kartblad_5 character varying(9),
     kartblad_10 character varying(9),
     kartblad_20 character varying(9),
     kartblad_dmk character varying(9),
     dmk_kode integer,
     areal numeric,
     objectid integer,
     area numeric,
     len numeric,
     geo public.geometry,
     CONSTRAINT enforce_dims_geo CHECK ((public.st_ndims(geo) = 2)),
     CONSTRAINT enforce_geotype_geo CHECK (((public.geometrytype(geo) =
 'POLYGON'::text) OR (geo IS NULL))),
     CONSTRAINT enforce_srid_geo CHECK ((public.st_srid(geo) = 4258))
 );
 CREATE SEQUENCE ok_grl.ok_kommkyst_flate_gid_seq
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
     NO MAXVALUE
     CACHE 1;"

 }}}

 and you see this again


 {{{
 free(): invalid pointer
 2020-10-31 10:51:20.530 CET [25765] LOG:  server process (PID 28753) was
 terminated by signal 6: Aborted
 2020-10-31 10:51:20.530 CET [25765] LOG:  terminating any other active
 server processes
 2020-10-31 10:51:20.530 CET [28750] WARNING:  terminating connection
 because of crash of another server process
 2020-10-31 10:51:20.530 CET [28750] DETAIL:  The postmaster has commanded
 this server process to roll back the current transaction and exit, because
 another server process exited abnormally and possibly corrupted shared
 memory.
 2020-10-31 10:51:20.530 CET [28750] HINT:  In a moment you should be able
 to reconnect to the database and repeat your command.
 2020-10-31 10:51:20.531 CET [25765] LOG:  all server processes terminated;
 reinitializing
 2020-10-31 10:51:20.624 CET [28756] LOG:  database system was interrupted;
 last known up at 2020-10-31 10:50:51 CET
 2020-10-31 10:51:20.894 CET [28756] LOG:  database system was not properly
 shut down; automatic recovery in progress
 2020-10-31 10:51:20.920 CET [28756] LOG:  redo starts at 0/FA38A80
 2020-10-31 10:51:20.921 CET [28756] LOG:  invalid record length at
 0/FA79D40: wanted 24, got 0
 2020-10-31 10:51:20.921 CET [28756] LOG:  redo done at 0/FA78988
 2020-10-31 10:51:21.322 CET [25765] LOG:  database system is ready to
 accept connections


 }}}

 (sorry wrong time on my test server)

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4779#comment:2>
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-tickets mailing list