pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: isaac.open@gmail.com
Subject: BUG #16071: Server crashes when 'numeric' data type is used on any plpython Function
Date: Mon, 21 Oct 2019 06:33:25 +0000
Message-ID: <16071-051c0170b04b1a6d@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16071
Logged by:          Isaac Aguirre
Email address:      isaac.open@gmail.com
PostgreSQL version: 12.0
Operating system:   Windows 7
Description:        

# Steps to Reproduce
Install extension plpython3u
Create function using data type numeric as an input, may be unique input or
in combination with other data types.
Use Function in query such as SELECT or UPDATE.

#Example
CREATE OR REPLACE FUNCTION network.test(number numeric)
    RETURNS numeric
    LANGUAGE 'plpython3u'
    VOLATILE
    PARALLEL UNSAFE
    COST 100
AS $BODY$return number
$BODY$;

SELECT network.test(5);

#Log Output
2019-10-20 13:21:59.116 PDT [2864] LOG:  server process (PID 12560) was
terminated by exception 0xC0000005
2019-10-20 13:21:59.116 PDT [2864] DETAIL:  Failed process was running:
SELECT network.test(5)
2019-10-20 13:21:59.116 PDT [2864] HINT:  See C include file "ntstatus.h"
for a description of the hexadecimal value.
2019-10-20 13:21:59.117 PDT [2864] LOG:  terminating any other active server
processes
2019-10-20 13:21:59.119 PDT [13156] WARNING:  terminating connection because
of crash of another server process
2019-10-20 13:21:59.119 PDT [13156] 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.
2019-10-20 13:21:59.119 PDT [13156] HINT:  In a moment you should be able to
reconnect to the database and repeat your command.
2019-10-20 13:21:59.121 PDT [7960] WARNING:  terminating connection because
of crash of another server process
2019-10-20 13:21:59.121 PDT [7960] 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.
2019-10-20 13:21:59.121 PDT [7960] HINT:  In a moment you should be able to
reconnect to the database and repeat your command.
2019-10-20 13:21:59.122 PDT [3040] WARNING:  terminating connection because
of crash of another server process
2019-10-20 13:21:59.122 PDT [3040] 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.
2019-10-20 13:21:59.122 PDT [3040] HINT:  In a moment you should be able to
reconnect to the database and repeat your command.
2019-10-20 13:21:59.131 PDT [2824] WARNING:  terminating connection because
of crash of another server process
2019-10-20 13:21:59.131 PDT [2824] 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.
2019-10-20 13:21:59.131 PDT [2824] HINT:  In a moment you should be able to
reconnect to the database and repeat your command.
2019-10-20 13:21:59.174 PDT [2864] LOG:  all server processes terminated;
reinitializing
2019-10-20 13:21:59.233 PDT [10152] LOG:  database system was interrupted;
last known up at 2019-10-20 08:04:14 PDT
2019-10-20 13:22:00.523 PDT [7104] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:00.894 PDT [13076] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:02.009 PDT [8300] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:02.973 PDT [12948] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:03.612 PDT [12708] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:04.924 PDT [9844] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:05.564 PDT [3520] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:05.962 PDT [8052] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:06.898 PDT [1264] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:06.960 PDT [9512] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:07.534 PDT [9316] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:07.981 PDT [13044] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:08.051 PDT [9520] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:08.898 PDT [10744] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:08.957 PDT [12804] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:09.526 PDT [9992] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:09.973 PDT [9212] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:10.029 PDT [10504] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:10.904 PDT [9292] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:10.978 PDT [9796] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:11.534 PDT [10784] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:11.959 PDT [8096] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:12.023 PDT [12532] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:12.900 PDT [12724] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:13.066 PDT [8256] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:13.998 PDT [4152] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:14.008 PDT [3392] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:14.902 PDT [9960] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:15.538 PDT [12580] FATAL:  the database system is in
recovery mode
2019-10-20 13:22:16.958 PDT [10152] LOG:  database system was not properly
shut down; automatic recovery in progress
2019-10-20 13:22:17.000 PDT [10152] LOG:  redo starts at 0/85D5338
2019-10-20 13:22:17.000 PDT [10152] LOG:  invalid record length at
0/85D5418: wanted 24, got 0
2019-10-20 13:22:17.000 PDT [10152] LOG:  redo done at 0/85D53E0
2019-10-20 13:22:17.264 PDT [2864] LOG:  database system is ready to accept
connections

#Additional Info
Issue could be reproduced as well in PostgreSQL 11 before update.
If inputs in functions are switched to text, text[], int, int[] they work
without any problem.
Using python37.dll from Stack Builder installer, issue was present with
previous versions as well.
https://www.postgresql.org/docs/12/plpython-data.html describes
compatibility with a data type mapping to Decimal.



view thread (2+ messages)  latest in thread

Message-ID: <16071-051c0170b04b1a6d@postgresql.org>
Permalink:  ../16071-051c0170b04b1a6d@postgresql.org/
Also on:    postgresql.org/message-id/16071-051c0170b04b1a6d@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, isaac.open@gmail.com
  Subject: Re: BUG #16071: Server crashes when 'numeric' data type is used on any plpython Function
  In-Reply-To: <16071-051c0170b04b1a6d@postgresql.org>
  References: <16071-051c0170b04b1a6d@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox