reload of shared library

From: Edoardo Panfili <edoardo(at)aspix(dot)it>
To: pgsql-bugs(at)postgresql(dot)org
Subject: reload of shared library
Date: 2003-03-05 09:59:06
Message-ID: 3E65CA6A.8030408@aspix.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I'm sorry if this is not a bug.

I build a shared library that contains a single function.
I loaded it into postgres and uset it to create an index and a view.

After that i modify rebuild the shared library ,
copy the ".so" file in "/usr/lib/postgres/lib" and reload it with
"LOAD 'funzioniGDB.so';"
in pgsql
sometimes all goes well other times the system says:
-------------------------------------------------------------------
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.
-------------------------------------------------------------------

and this id the dump in postgres.log
-------------------------------------------------------------------
2003-03-05 10:55:20 [1881] DEBUG: StartTransactionCommand
2003-03-05 10:55:20 [1881] DEBUG: query: LOAD 'funzioniGDB.so';
2003-03-05 10:55:20 [1881] DEBUG: parse tree: { QUERY :command 5
:utility ? :resultRelation 0 :into <> :isPortal false :isBinary false
:isTemp false :hasAggs false :hasSubLinks false :rtable <> :jointree <>
:rowMarks () :targetList <> :groupClause <> :havingQual <> :distinctClause
<> :sortClause <> :limitOffset <> :limitCount <> :setOperations <>
:resultRelations ()}
2003-03-05 10:55:20 [1881] DEBUG: rewritten parse tree:
2003-03-05 10:55:20 [1881] DEBUG: { QUERY :command 5 :utility ?
:resultRelation 0 :into <> :isPortal false :isBinary false :isTemp false
:hasAggs false :hasSubLinks false :rtable <> :jointree <> :rowMarks ()
:targetList <> :groupClause <> :havingQual <> :distinctClause <>
:sortClause <> :limitOffset <> :limitCount <> :setOperations <>
:resultRelations ()}
2003-03-05 10:55:20 [1881] DEBUG: ProcessUtility: LOAD 'funzioniGDB.so';
2003-03-05 10:55:20 [1881] DEBUG: find_in_dynamic_libpath: trying
/usr/lib/postgresql/lib/funzioniGDB.so
2003-03-05 10:55:20 [1460] DEBUG: reaping dead processes
2003-03-05 10:55:20 [1460] DEBUG: child process (pid 1881) was
terminated by signal 11
2003-03-05 10:55:20 [1460] DEBUG: server process (pid 1881) was
terminated by signal 11
2003-03-05 10:55:20 [1460] DEBUG: terminating any other active server
processes
2003-03-05 10:55:20 [1460] DEBUG: all server processes terminated;
reinitializing shared memory and semaphores
2003-03-05 10:55:20 [1460] DEBUG: shmem_exit(0)
invoking IpcMemoryCreate(size=2449408)
2003-03-05 10:55:20 [1884] DEBUG: database system was interrupted at
2003-03-05 10:54:53 CET
2003-03-05 10:55:20 [1884] DEBUG: checkpoint record is at 0/AD731C0
2003-03-05 10:55:20 [1884] DEBUG: redo record is at 0/AD731C0; undo
record is at 0/0; shutdown TRUE
2003-03-05 10:55:20 [1884] DEBUG: next transaction id: 464857; next oid:
277223
2003-03-05 10:55:20 [1884] DEBUG: database system was not properly shut
down; automatic recovery in progress
2003-03-05 10:55:20 [1460] DEBUG: BackendStartup: forked pid=1885 socket=8
2003-03-05 10:55:20 [1884] DEBUG: ReadRecord: record with zero length at
0/AD73200
2003-03-05 10:55:20 [1884] DEBUG: redo is not required
2003-03-05 10:55:20 [1885] FATAL 1: The database system is starting up
2003-03-05 10:55:21 [1885] DEBUG: proc_exit(0)
2003-03-05 10:55:21 [1885] DEBUG: shmem_exit(0)
2003-03-05 10:55:21 [1885] DEBUG: exit(0)
2003-03-05 10:55:21 [1460] DEBUG: reaping dead processes
2003-03-05 10:55:21 [1460] DEBUG: child process (pid 1885) exited with
exit code 0
2003-03-05 10:55:23 [1884] DEBUG: database system is ready
2003-03-05 10:55:23 [1884] DEBUG: proc_exit(0)
2003-03-05 10:55:23 [1884] DEBUG: shmem_exit(0)
2003-03-05 10:55:23 [1884] DEBUG: exit(0)
2003-03-05 10:55:23 [1460] DEBUG: reaping dead processes
-------------------------------------------------------------------

it seems that this sequence is the bad one:
1-rebuild the ".so" file
2-open pgsql
3-copy ".so" file in "/usr/lib/postgres/lib"
4-"LOAD 'funzioniGDB.so';" in pgsql

if the sequence is 1-3-2-4 all goes well.

I hope this in usefull for you

Edoardo Panfili

Attachment Content-Type Size
funzioniGDB.c text/x-csrc 5.3 KB

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurent FAILLIE 2003-03-05 16:42:53 Solution for bug #899
Previous Message shura 2003-03-05 06:43:35 Problem with TIME datatype