Hello again,


>> This can be reproduced with the official Docker Image "postgres:13.8".

>> Steps to reproduce:

>> First install the Debian Package `postgresql-13-postgis-3`

> Hm - is that part required to trigger the problem? Your reproducer doesn't
> reference postgis anywhere....

> I tried to reproduce this, without success, neither inside nor outside a
> container. I did start the container with podman, not docker though.

This was my mistake, the entry of the OS (in the Bug Reporting Form) didn’t make it into the bug report.

It stated that it only happens on “linux/arm64/v8” machines (verified on 2 separate machines).

 

The PG Log prints this line: `LLVMJIT detected CPU "generic", with features "+neon,+fp-armv8,+crypto,+crc"`

 

This issue occurred in production, and I did a lot of trial and error to figure out the minimum requirement to have a reliable testcase on my side

One of the Requirements is having the shared_buffers settings, the other one is having Postgis-Package installed (which itself adds additional JIT Headers to postgres, which might be the cause)


>> A core dump is produced as well, but it is not of any use, i presume because
>> of JIT Compilation

> Does the core dump look more sensible if you turn on 'jit_debugging_support'?

Yes indeed, I wasn’t aware of this option, thanks for the hint.

This is the Stacktrace of the Core-Dump.

```

Reading symbols from /usr/lib/postgresql/13/bin/postgres...

Reading symbols from /usr/lib/debug/.build-id/f5/3be18fe7523ce412811658eb9496cc45d5fd99.debug...

 

warning: Can't open file /dev/shm/PostgreSQL.450058653 during file-backed mapping note processing

 

warning: Can't open file /dev/zero (deleted) during file-backed mapping note processing

 

warning: Can't open file /SYSV005ce028 (deleted) during file-backed mapping note processing

[New LWP 43]

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".

Core was generated by `postgres: postgres postgres [local] UPDATE           '.

Program terminated with signal SIGSEGV, Segmentation fault.

#0  0x00010000158b72e0 in ?? ()

#1  0x0000ffff158b705c in evalexpr_1_0 ()

#2  0x0000ffff158b705c in evalexpr_1_0 ()

#3  0x0000aaaacaf74738 in ExecEvalExprSwitchContext (isNull=0xffffd1e2b3a7, econtext=0xaaab06289308, state=0xaaab06289e20)

    at ./build/../src/include/executor/executor.h:322

#4  ExecProject (projInfo=0xaaab06289e18) at ./build/../src/include/executor/executor.h:356

#5  ExecScan (node=<optimized out>, accessMtd=0xaaaacaf95d90 <SeqNext>, recheckMtd=0xaaaacaf95e20 <SeqRecheck>)

    at ./build/../src/backend/executor/execScan.c:238

#6  0x0000aaaacaf94764 in ExecProcNode (node=0xaaab062891f8) at ./build/../src/include/executor/executor.h:248

#7  ExecNestLoop (pstate=0xaaab06289058) at ./build/../src/backend/executor/nodeNestloop.c:109

#8  0x0000aaaacaf93348 in ExecProcNode (node=0xaaab06289058) at ./build/../src/include/executor/executor.h:248

#9  ExecModifyTable (pstate=0xaaab06288c38) at ./build/../src/backend/executor/nodeModifyTable.c:2178

#10 0x0000aaaacaf6b06c in ExecProcNode (node=0xaaab06288c38) at ./build/../src/include/executor/executor.h:248

#11 ExecutePlan (execute_once=<optimized out>, dest=0xaaab062a9ff8, direction=<optimized out>, numberTuples=0,

    sendTuples=<optimized out>, operation=CMD_UPDATE, use_parallel_mode=<optimized out>, planstate=0xaaab06288c38,

    estate=0xaaab06288838) at ./build/../src/backend/executor/execMain.c:1632

#12 standard_ExecutorRun (queryDesc=0xaaab0629fbe8, direction=<optimized out>, count=0, execute_once=<optimized out>)

    at ./build/../src/backend/executor/execMain.c:350

#13 0x0000aaaacb0e01e0 in ProcessQuery (plan=0xaaab062aa8e8,

    sourceText=0xaaab061c34c8 "UPDATE t2 SET int_id = t1.int_id FROM t1 WHERE t2.text_id = t1.text_id;", params=0x0, queryEnv=0x0,

    dest=0xaaab062a9ff8, qc=0xffffd1e2b8c8) at ./build/../src/backend/tcop/pquery.c:160

#14 0x0000aaaacb0e0e2c in PortalRunMulti (portal=portal@entry=0xaaab06225e88, isTopLevel=isTopLevel@entry=true,

    setHoldSnapshot=setHoldSnapshot@entry=false, dest=dest@entry=0xaaab062a9ff8, altdest=altdest@entry=0xaaab062a9ff8,

    qc=qc@entry=0xffffd1e2b8c8) at ./build/../src/backend/tcop/pquery.c:1271

#15 0x0000aaaacb0e1190 in PortalRun (portal=portal@entry=0xaaab06225e88, count=count@entry=9223372036854775807,

    isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0xaaab062a9ff8,

    altdest=altdest@entry=0xaaab062a9ff8, qc=qc@entry=0xffffd1e2b8c8) at ./build/../src/backend/tcop/pquery.c:788

--Type <RET> for more, q to quit, c to continue without paging--

#16 0x0000aaaacb0dbe84 in exec_simple_query (

    query_string=query_string@entry=0xaaab061c34c8 "UPDATE t2 SET int_id = t1.int_id FROM t1 WHERE t2.text_id = t1.text_id;")

    at ./build/../src/backend/tcop/postgres.c:1238

#17 0x0000aaaacb0dcb74 in PostgresMain (argc=<optimized out>, argv=argv@entry=0xaaab061edf20, dbname=<optimized out>,

    username=<optimized out>) at ./build/../src/backend/tcop/postgres.c:4347

#18 0x0000aaaacb05c138 in BackendRun (port=0xaaab061e68e0) at ./build/../src/backend/postmaster/postmaster.c:4550

#19 BackendStartup (port=0xaaab061e68e0) at ./build/../src/backend/postmaster/postmaster.c:4234

#20 ServerLoop () at ./build/../src/backend/postmaster/postmaster.c:1739

#21 0x0000aaaacb05d114 in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0xaaab061bcfd0)

    at ./build/../src/backend/postmaster/postmaster.c:1412

#22 0x0000aaaacadc29b8 in main (argc=3, argv=0xaaab061bcfd0) at ./build/../src/backend/main/main.c:210

```

 

With best regards,

 

Marcel Spitz