RE: BUG #16920: Can't compile PostGIS with MingW64 against PostgreSQL 14 head

Regina Obe <lr@pcorp.us>

From: "Regina Obe" <lr@pcorp.us>
To: "'Tom Lane'" <tgl@sss.pgh.pa.us>
Cc: <pgsql-bugs@lists.postgresql.org>
Date: 2021-03-12T16:48:31Z
Lists: pgsql-bugs
> "Regina Obe" <lr@pcorp.us> writes:
> > I was mistaken though that in the postgresql regress I do get a lot of
> > failures like failure on stats.
> > But many of these errors seemed to be the same as what is on the
> > buildfarm
> > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=walleye&dt=202
> > 1-03-0
> > 8%2021%3A35%3A41
> 
> walleye's owners have so far failed to extract any useful data about why
it's
> been crashing.  If you could provide stack traces from some of those
crashes,
> it'd be much appreciated.
> 
> 			regards, tom lane

Okay the crash on PostGIS against PostgreSQL 14 does seem to be mingw
related since our debian bot passes with flying colors.
Both have postgresql built with --enable-cassert

(PG 13 is fine for mingw64 BTW also cassert enabled)

On my mingw64 gcc 8.1.0 (cassert enabled, not sure that matters) -- in
PostGIS regress - it starts crashing with this query:

SELECT topology.ST_AddIsoEdge('sqlmm_topology', 1, 2, 'LINESTRING(0 0, 10 0,
5 5, 5 -5)');

Hopefully the back trace is of some help -- I'm going to try to formulate a
similar one without PostGIS involvement.

As far as the PostgreSQL tests, I'm not sure how to run the regress tests
standalone to grab a stack trace. Suggestions welcome.

Thread 1 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 22272.0x49ec]
0x00007ffe75f5f23f in ntdll!RtlLeaveCriticalSection ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0  0x00007ffe75f5f23f in ntdll!RtlLeaveCriticalSection ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffe75fd4c0e in ntdll!memset () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffe75fbc872 in ntdll!__C_specific_handler ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x00007ffe75fd1fef in ntdll!.chkstk () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x00007ffe75f60939 in ntdll!RtlUnwindEx ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x00007ffe74002eed in msvcrt!_setjmpex ()
   from C:\WINDOWS\System32\msvcrt.dll
#6  0x00000000008d929a in pg_re_throw () at elog.c:1776
#7  0x00000000008d911d in errfinish (filename=<optimized out>,
    lineno=<optimized out>, funcname=0x6b025560 <__func__.114531>
"pg_error")
    at elog.c:589
#8  0x000000006afc91d3 in pg_error (fmt=<optimized out>, ap=<optimized out>)
    at lwgeom_pg.c:250
#9  0x000000006afdfb03 in lwerror (fmt=0x0) at lwutil.c:197
#10 0x000000006b000c16 in lwt_AddIsoEdge (topo=topo@entry=0x83629b0,
    startNode=startNode@entry=1, endNode=endNode@entry=2,
    geom=geom@entry=0x7a303b8) at lwgeom_topo.c:794
#11 0x000000006afc70d2 in ST_AddIsoEdge (fcinfo=0x7a2caa8)
    at postgis_topology.c:3567
#12 0x00000000005f7604 in ExecInterpExpr (state=0x7a2c9c0,
    econtext=0x7a2c6c0, isnull=<optimized out>) at execExprInterp.c:1209
#13 0x000000000062f23f in ExecEvalExprSwitchContext (isNull=0x509ef9f,
    econtext=0x7a2c6c0, state=0x7a2c9c0)
    at ../../../src/include/executor/executor.h:315
#14 ExecProject (projInfo=0x7a2c9b8)
    at ../../../src/include/executor/executor.h:349
#15 ExecResult (pstate=<optimized out>) at nodeResult.c:136
#16 0x00000000005fc0ca in ExecProcNode (node=0x7a2c5a8)
    at ../../../src/include/executor/executor.h:247
#17 ExecutePlan (execute_once=<optimized out>, dest=0x7a2b2e8,
    direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>,
    operation=CMD_SELECT, use_parallel_mode=<optimized out>,
    planstate=0x7a2c5a8, estate=0x7a2c370) at execMain.c:1531
#18 standard_ExecutorRun (queryDesc=0x8338990, direction=<optimized out>,
    count=0, execute_once=<optimized out>) at execMain.c:350
#19 0x00000000007a08cb in PortalRunSelect (portal=0x79bcc70,
    portal@entry=0x7fffffff, forward=forward@entry=true,
count=count@entry=0,
    dest=dest@entry=0x7a2b2e8) at pquery.c:912
#20 0x00000000007a20cc in PortalRun (portal=0x7fffffff,
    portal@entry=0x79bcc70, count=0, count@entry=2147483647,
    isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true,
    dest=dest@entry=0x7a2b2e8, altdest=altdest@entry=0x7a2b2e8,
    qc=qc@entry=0x509f2d0) at pquery.c:756
#21 0x000000000079d6ab in exec_simple_query (
    query_string=0x79fd1e0 "SELECT topology.ST_AddIsoEdge('sqlmm_topology',
1, 2, 'LINESTRING(0 0, 10 0, 5 5, 5 -5)');") at postgres.c:1173
#22 0x000000000079ee40 in PostgresMain (argc=argc@entry=1,
    argv=argv@entry=0x509f980, dbname=<optimized out>,
    username=<optimized out>) at postgres.c:4327
#23 0x0000000000708608 in BackendRun (port=0x509f7c0, port=0x509f7c0)
    at postmaster.c:4464
#24 SubPostmasterMain (argc=argc@entry=3, argv=argv@entry=0x5176af0)
    at postmaster.c:4977
#25 0x000000000093cb13 in main (argc=3, argv=0x5176af0) at main.c:186




Commits

  1. Work around issues in MinGW-64's setjmp/longjmp support.