function lca('{}'::ltree[]) caused DB Instance crash - Mailing list pgsql-bugs

From 李海龙
Subject function lca('{}'::ltree[]) caused DB Instance crash
Date
Msg-id 5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com
Whole thread Raw
List pgsql-bugs


HI,Oleg && pgsql-hackers

Plese help me to check this is a bug of ltree?


thxs!




lhl@localhost:~$ cat /etc/issue
Ubuntu 14.04.5 LTS \n \l

lhl@localhost:~$ uname -av
Linux localhost 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


lhl@localhost:~$ psql mydb
psql (10.3)
Type "help" for help.

mydb=# select version();
                                                version                                               
-------------------------------------------------------------------------------------------------------
 PostgreSQL 10.3 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit
(1 row)

mydb=# \dx ltree
                        List of installed extensions
 Name  | Version | Schema |                   Description                  
-------+---------+--------+-------------------------------------------------
 ltree | 1.1     | public | data type for hierarchical tree-like structures
(1 row)

mydb=# select lca('{}'::ltree[]);
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.




in /var/log/syslog

Jul 13 18:02:39 localhost kernel: [25703.907912] postgres[8869]: segfault at 4 ip 00007f6bad8c2ca6 sp 00007fffd8f64560 error 4 in ltree.so[7f6bad8be000+d000]


in log of PostgreSQL Datadir

[lhl mydb psql [local] 2018-07-13 18:02:36.962 CST 8869 5b4878b6.22a5 1 3/2 0]LOG:  statement: SELECT e.extname AS "Name", e.extversion AS "Version", n.nspname AS "Schema", c.description AS "Description"
    FROM pg_catalog.pg_extension e LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass
    WHERE e.extname OPERATOR(pg_catalog.~) '^(ltree)$'
    ORDER BY 1;
[lhl mydb psql [local] 2018-07-13 18:02:36.972 CST 8869 5b4878b6.22a5 2 3/0 0]LOG:  duration: 10.269 ms
[lhl mydb psql [local] 2018-07-13 18:02:39.313 CST 8869 5b4878b6.22a5 3 3/3 0]LOG:  statement: select lca('{}'::ltree[]);
[    2018-07-13 18:02:39.444 CST 1638 5b481476.666 102  0]LOG:  server process (PID 8869) was terminated by signal 11: Segmentation fault
[    2018-07-13 18:02:39.444 CST 1638 5b481476.666 103  0]DETAIL:  Failed process was running: select lca('{}'::ltree[]);
[    2018-07-13 18:02:39.444 CST 1638 5b481476.666 104  0]LOG:  terminating any other active server processes
[lhl mydb [unknown] [local] 2018-07-13 18:02:39.445 CST 8873 5b4878bf.22a9 1  0]FATAL:  the database system is in recovery mode
[    2018-07-13 18:02:39.446 CST 8635 5b4876a7.21bb 1 1/0 0]WARNING:  terminating connection because of crash of another server process
[    2018-07-13 18:02:39.446 CST 8635 5b4876a7.21bb 2 1/0 0]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.
[    2018-07-13 18:02:39.446 CST 8635 5b4876a7.21bb 3 1/0 0]HINT:  In a moment you should be able to reconnect to the database and repeat your command.
[    2018-07-13 18:02:39.447 CST 1638 5b481476.666 105  0]LOG:  archiver process (PID 8636) exited with exit code 1
[    2018-07-13 18:02:39.447 CST 1638 5b481476.666 106  0]LOG:  all server processes terminated; reinitializing
[    2018-07-13 18:02:39.520 CST 8874 5b4878bf.22aa 1  0]LOG:  database system was interrupted; last known up at 2018-07-13 17:53:42 CST
[    2018-07-13 18:02:39.798 CST 8874 5b4878bf.22aa 2  0]LOG:  database system was not properly shut down; automatic recovery in progress
[    2018-07-13 18:02:39.838 CST 8874 5b4878bf.22aa 3  0]LOG:  redo starts at 1/9815F478
[    2018-07-13 18:02:39.838 CST 8874 5b4878bf.22aa 4  0]LOG:  invalid record length at 1/9815F4B0: wanted 24, got 0
[    2018-07-13 18:02:39.839 CST 8874 5b4878bf.22aa 5  0]LOG:  redo done at 1/9815F478
[    2018-07-13 18:02:40.036 CST 1638 5b481476.666 107  0]LOG:  database system is ready to accept connections



--
PostgreSQL DBA hailong.li

Attachment

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: BUG #15263: pg_dump / psql failure. When loading, psql does notsee function-based constraints or indices
Next
From: Łukasz Jarych
Date:
Subject: Fwd: SQL