[BUG] lo_open() makes a warning/falls to an assertion

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [BUG] lo_open() makes a warning/falls to an assertion
Date: 2008-12-02 04:42:37
Message-ID: 4934BCBD.5060604@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Is it possible to reproduce on your system?

I got the following result at the latest CVS HEAD independently from
the feature of SE-PostgreSQL. I could not get the result a week ago,
but could not find where cause the regression.

-- (1) make a dummy file.
[kaigai(at)saba base]$ dd if=/dev/zero of=/tmp/hoge bs=1024 count=80
80+0 records in
80+0 records out
81920 bytes (82 kB) copied, 0.000767843 s, 107 MB/s

-- (2) import it.
[kaigai(at)saba base]$ psql postgres
psql (8.4devel)
Type "help" for help.

postgres=# SELECT lo_import('/tmp/hoge');
lo_import
-----------
24576
(1 row)

-- (3) tries to open it with writable mode under transaction block.
postgres=# BEGIN;
BEGIN
postgres=# SELECT lo_open(24576, x'40000'::int);
WARNING: Snapshot reference leak: Snapshot 0x96b8488 still referenced
lo_open
---------
0
(1 row)

postgres=# ABORT;
ROLLBACK

-- (4) tries to open it with writable mode outside of transaction block.
postgres=# SELECT lo_open(24576, x'40000'::int);
WARNING: Snapshot reference leak: Snapshot 0x96b8488 still referenced
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: Succeeded.

In this case, it is killed by an assertion macro.
----------------
[kaigai(at)saba base]$ gdb -f /usr/local/pgsql/bin/postgres -c /tmp/core
GNU gdb Fedora (6.8-29.fc10)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Core was generated by `postgres: kaigai postgres [loc'.
Program terminated with signal 6, Aborted.
[New process 30031]
#0 0x00110416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.9-2.i686
(gdb) bt
#0 0x00110416 in __kernel_vsyscall ()
#1 0x0086f450 in raise () from /lib/libc.so.6
#2 0x00870e18 in abort () from /lib/libc.so.6
#3 0x083093be in ExceptionalCondition (conditionName=0x846094c "!(RegisteredSnapshots > 0)",
errorType=0x833e818 "FailedAssertion", fileName=0x84608f5 "snapmgr.c", lineNumber=387)
at assert.c:57
#4 0x083361bc in UnregisterSnapshot (snapshot=0x96b8488) at snapmgr.c:387
#5 0x08240469 in inv_close (obj_desc=0x96c0f14) at inv_api.c:274
#6 0x081b9223 in AtEOXact_LargeObject (isCommit=1 '\001') at be-fsstubs.c:511
#7 0x080c3a8c in CommitTransaction () at xact.c:1608
#8 0x080c4b55 in CommitTransactionCommand () at xact.c:2331
#9 0x0824e9e9 in finish_xact_command () at postgres.c:2330
#10 0x0824fa35 in exec_simple_query (query_string=0x9688644 "SELECT lo_open(24576, x'40000'::int);")
at postgres.c:1025
#11 0x082510f4 in PostgresMain (argc=4, argv=0x9626e18, username=0x9626de8 "kaigai")
at postgres.c:3573
#12 0x0821c20f in BackendRun () at postmaster.c:3258
#13 BackendStartup () at postmaster.c:2872
#14 ServerLoop () at postmaster.c:1283
#15 0x0821d190 in PostmasterMain (argc=1, argv=0x96249e8) at postmaster.c:1031
#16 0x081c20b6 in main (argc=1, argv=0x96249e8) at main.c:188
(gdb)
----------------

Thanks,
--
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2008-12-02 04:48:56 Re: New to_timestamp implementation is pretty strict
Previous Message Emmanuel Cecchet 2008-12-02 03:00:48 Re: Transactions and temp tables