Opened 8 months ago

Closed 7 months ago

#5728 closed defect (fixed)

32bit builds crashing on topology topogeo_addpoint_merge_edges

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

Description (last modified by strk)

02:22:42  topology/test/regress/topogeo_addpoint_merge_edges ..Died at ./regress/run_test.pl line 979.
02:22:48  failed (psql exited with an error: /tmp/pgis_reg/test_222_out)
02:22:48 -----------------------------------------------------------------------------
02:22:48 sn.CW-back-merge|-checking-
02:22:48 sn.CW-back-merge.ep-edges|-checking-
02:22:48 sn.CW-back-merge.ep-edges-back|-checking-
02:22:48 sn.CCW-back-merge|-checking-
02:22:48 sn.CCW-back-merge.ep-edges|-checking-
02:22:48 sn.CCW-back-merge.ep-edges-back|-checking-
02:22:48 sn.CW-forw-merge|-checking-
02:22:48 sn.CW-forw-merge.ep-edges|-checking-
02:22:48 sn.CW-forw-merge.ep-edges-back|-checking-
02:22:48 sn.CCW-forw-merge|-checking-
02:22:48 sn.CCW-forw-merge.ep-edges|-checking-
02:22:48 sn.CCW-forw-merge.ep-edges-back|-checking-
02:22:48 en.CW-back-merge|-checking-
02:22:48 en.CW-back-merge.ep-edges|-checking-
02:22:48 en.CW-back-merge.ep-edges-back|-checking-
02:22:48 en.CW-forw-merge|-checking-
02:22:48 en.CW-forw-merge.ep-edges|-checking-
02:22:48 en.CW-forw-merge.ep-edges-back|-checking-
02:22:48 psql:topogeo_addpoint_merge_edges.sql:320: server closed the connection unexpectedly
02:22:48 	This probably means the server terminated abnormally
02:22:48 	before or while processing the request.
02:22:48 psql:topogeo_addpoint_merge_edges.sql:320: error: connection to server was lost

This particular one looks like it might have started on the May 6th, but hard to tell since berrie has been failing for a while on garden tests

Change History (5)

comment:1 by strk, 8 months ago

Description: modified (diff)

I know I'm not properly doing memory management with the new function, can that be the cause ? Is there a way for me to ssh into berrie and build manually ?

comment:2 by strk, 8 months ago

Summary: berrie (32 bit) crashing on topology topogeo_addpoint_merge_edges32bit builds crashing on topology topogeo_addpoint_merge_edges
Version: 3.4.xmaster

Also bessie crashes, see https://debbie.postgis.net/view/PostGIS/job/PostGIS_Worker_Run/label=bessie32/5900/console

And gitlab too, once it gets a chance to run (currently not getting there due to #5724): https://gitlab.com/strk/postgis/-/jobs/6870457656

comment:3 by strk, 8 months ago

I'm running on bessie32. This seems to be the culprit:

SELECT * FROM runTest('snap-CW-newface-sp',
  ARRAY[
    'LINESTRING(0 1, 100 1)',
    'LINESTRING(0 -10,50 0,100 -10)',
    'LINESTRING(0 1, 0 -10)'
  ], 'POINT(50 0)', 2
);

Debug output:

DEBUG:  [topo/lwgeom_topo.c:_lwt_FirstDistinctVertex2D:1450] first point is index 1
DEBUG:  [topo/lwgeom_topo.c:_lwt_FirstDistinctVertex2D:1454] testing point 0
DEBUG:  [topo/lwgeom_topo.c:_lwt_FindAdjacentEdges:1665] edge 3 ends on node 6, edgeend is [50 0,0 -10]
DEBUG:  [topo/lwgeom_topo.c:_lwt_FindAdjacentEdges:1677] azimuth of edge 3: 4.51499342053481 (diff: 2.96419442771306)
DEBUG:  [topo/lwgeom_topo.c:_lwt_FindAdjacentEdges:1706] new nextCCW edge is 3, outgoing, from start point, with face_left 1 and face_right 1 (previous had maxaz=0.217393, face_left is new ccwFace)
DEBUG:  [topo/lwgeom_topo.c:_lwt_FindAdjacentEdges:1721] edges adjacent to azimuth 1.5508 (incident to node 6): CW:5(0.217393) CCW:-3(2.96419)
DEBUG:  [topo/lwgeom_topo.c:_lwt_SnapEdgeToExistingNode:5231] Component 1 of split edge 0 next CW is 2, next CCW is 0
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.
!?> 

comment:4 by strk, 8 months ago

Some gdb:

Program received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
strlen (str=0x4 <error: Cannot access memory at address 0x4>) at /usr/src/lib/libc/string/strlen.c:101
101     /usr/src/lib/libc/string/strlen.c: No such file or directory.
(gdb) bt
#0  strlen (str=0x4 <error: Cannot access memory at address 0x4>) at /usr/src/lib/libc/string/strlen.c:101
#1  0x08525584 in ?? ()
#2  0x0852657c in pg_vsnprintf ()
#3  0x335c5e01 in pg_debug () from /usr/home/strk/postgis/regress/00-regress-install/lib/postgis_topology-3.so
#4  0x335e1072 in lwdebug () from /usr/home/strk/postgis/regress/00-regress-install/lib/postgis_topology-3.so
#5  0x00000001 in ?? ()
#6  0x3363d04c in ?? () from /usr/home/strk/postgis/regress/00-regress-install/lib/postgis_topology-3.so
#7  0x33615ea0 in lwt_EdgeEndStar_debugPrint () from /usr/home/strk/postgis/regress/00-regress-install/lib/postgis_topology-3.so
#8  0x3360ea2a in _lwt_AddPoint () from /usr/home/strk/postgis/regress/00-regress-install/lib/postgis_topology-3.so
#9  0x335c3eba in TopoGeo_AddPoint () from /usr/home/strk/postgis/regress/00-regress-install/lib/postgis_topology-3.so

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

Resolution: fixed
Status: newclosed

In de88a07c/git:

Fix printf formats to be safe on 32bit systems

Closes #5728

Note: See TracTickets for help on using tickets.