Re: Segment fault when excuting SPI function On PG with commit 41c6a5be

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: "liuhuailing(at)fujitsu(dot)com" <liuhuailing(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Segment fault when excuting SPI function On PG with commit 41c6a5be
Date: 2021-07-30 12:14:02
Message-ID: CAEudQAq38W7uJpp04=fWKuGrUAYuM9j-JNSqj46Fbp1nnEzO0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em sex., 30 de jul. de 2021 às 05:57, liuhuailing(at)fujitsu(dot)com <
liuhuailing(at)fujitsu(dot)com> escreveu:

> Hi, all
>
> When I used SPI_execute_plan function on PG12 which commit 41c6a5be is
> used,
> Segment fault occurred.
>
> PS: If commit 41c6a5be is not used, this phenomenon will not happen.
>
> Reproduce:
> In a background process, the following steps are executed.
> --------------------------
> StartTransactionCommand();
> SPI_connect();
> plan = SPI_prepare(query,0,NULL); ★the query is a SELECT SQL.
> SPI_keepplan(plan);
> SPI_finish();
> CommitTransactionCommand();
> StartTransactionCommand();
> SPI_connect();
> SPI_execute_plan(plan, NULL, NULL, true, 0); ★Segment fault
> --------------------------
>
> Core stack:
> Stack trace of thread 43926:
> #0 0x0000000000772f19 EnsurePortalSnapshotExists
> (postgres)
> #1 0x000000000064f85c _SPI_execute_plan (postgres)
> #2 0x000000000064fbd1 SPI_execute_plan (postgres)
> #3 0x00007fbee784402e xxx (xxx.so)
> #4 0x00007fbee78424ae xxxx (xxxx.so)
> #5 0x00000000006e91f5 StartBackgroundWorker (postgres)
> #6 0x00000000006f5e25 maybe_start_bgworkers (postgres)
> #7 0x00000000006f6121 reaper (postgres)
> #8 0x00007fbeedf48dc0 __restore_rt (libpthread.so.0)
> #9 0x00007fbeebadf75b __select (libc.so.6)
> #10 0x00000000006f6ea6 ServerLoop (postgres)
> #11 0x00000000006f8c30 PostmasterMain (postgres)
> #12 0x0000000000485d99 main (postgres)
> #13 0x00007fbeeba0f873 __libc_start_main (libc.so.6)
> #14 0x0000000000485e3e _start (postgres)
>
> Is there a bug in the commit 41c6a5be? Please confirm it.
>
Did you test it on the HEAD too?

regards,
Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-07-30 12:38:01 Re: Segment fault when excuting SPI function On PG with commit 41c6a5be
Previous Message Zhihong Yu 2021-07-30 12:12:53 Re: Segment fault when excuting SPI function On PG with commit 41c6a5be