Re: Segmentation fault when calling BlessTupleDesc in a C function in parallel on PostgreSQL-(12.6, 12.7, 13.2, 13.3)

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Segmentation fault when calling BlessTupleDesc in a C function in parallel on PostgreSQL-(12.6, 12.7, 13.2, 13.3)
Дата
Msg-id CALj2ACV+SiO=xr0A3n13kRKVAgUjChu=4TxFKi8WOX4xxUvk3A@mail.gmail.com
обсуждение исходный текст
Ответ на Segmentation fault when calling BlessTupleDesc in a C function in parallel on PostgreSQL-(12.6, 12.7, 13.2, 13.3)  (Eric Thinnes <e.thinnes@gmx.de>)
Ответы Re: Segmentation fault when calling BlessTupleDesc in a C function in parallel on PostgreSQL-(12.6, 12.7, 13.2, 13.3)  (Eric Thinnes <e.thinnes@gmx.de>)
Список pgsql-bugs
On Fri, May 14, 2021 at 4:49 PM Eric Thinnes <e.thinnes@gmx.de> wrote:
>
>
> Hello Postgres team,
>
> i get a segmentation fault when calling BlessTupleDesc in a C function
> in parallel.
>
> System Configuration
> ---------------------
>    Architecture        : Intel Pentium
>    Operating System    : Ubuntu versions: 16.04.7 LTS, 18.04.5 LTS,
> 20.04.2 LTS
>    PostgreSQL version  : PostgreSQL-(12.6, 12.7, 13.2, 13.3)
>    Compiler used       : gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
>
> Please enter a FULL description of your problem:
> ------------------------------------------------
>
> In the version with the configure option --enable-cassert, the process
> is aborted
> before the segmentation fault occurs.
>
> It is possible that the error does not occur the first time and that
> the call has to be repeated several times.
> That probably indicates a timing problem with concurrency.
>
>
> postgres:5433:et@test=# SET max_parallel_workers_per_gather TO 4;
> SET
> Zeit: 0,558 ms
> postgres:5433:et@test=#* SELECT sum(sign*Betrag) FROM kpos_test,
> setof_kpos(kpos);
> INFO:  pid: 9132, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
> INFO:  pid: 9131, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
> INFO:  pid: 9130, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
> INFO:  pid: 9134, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
> INFO:  pid: 9133, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
> WARNING:  terminating connection because of crash of another server process
> 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.
> TIP:  In a moment you should be able to reconnect to the database and
> repeat your command.
> SSL-SYSCALL-Fehler: Dateiende entdeckt
> Die Verbindung zum Server wurde verloren.  Versuche Reset: Fehlgeschlagen.
> Zeit: 421,098 ms
> ::@!>? \q
>
> If I call the c function once with an empty argument before the
> parallel scan, the error does not occur.
>
>
> SET max_parallel_workers_per_gather TO 4;
> SET
> Zeit: 0,390 ms
> postgres:5433:et@test=#* SELECT setof_kpos('');
> INFO:  pid: 12396, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
>   setof_kpos
> ------------
> (0 Zeilen)
>
> Zeit: 1,253 ms
> postgres:5433:et@test=#* SELECT sum(sign*Betrag) FROM kpos_test,
> setof_kpos(kpos);
> INFO:  pid: 12400, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
> INFO:  pid: 12398, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
> INFO:  pid: 12399, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
> INFO:  pid: 12397, outTypeId: 40962
> INFO:  outTypRelId: 40960, typlen: -1, typbyval: 0, typalign: d
>   sum
> -----
>     0
> (1 Zeile)
>
> I don't know how to fix this.

I'm not sure if this makes sense - do you want to set the set_of_kpos
function's parallel safety to 'unsafe' or 'restricted'?

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



В списке pgsql-bugs по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: BUG #17009: create temporary table with like option using same name as persistent table does not create indexes
Следующее
От: Eric Thinnes
Дата:
Сообщение: Re: Segmentation fault when calling BlessTupleDesc in a C function in parallel on PostgreSQL-(12.6, 12.7, 13.2, 13.3)