Search Postgresql Archives

Re: Why is create function bringing down the Backend server?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marko Kreen wrote:

On 12/22/05, Carlos Moreno <moreno_pg@xxxxxxxxxxx> wrote:

The problem is, when I execute the SQL statement:

create or replace function sha1 ....  ;

for the second time (i.e., after making modifications and
recompiling), the *backend* crashes -- it then restarts
automatically, and then I run again the create or replace
statement, and it works now  (and the function seems to
work fine -- well, in its "final" version it does).


You should see if there's something in server log.


The only thing that does show does not seem to say much:

LOG:  server process (PID 12885) was terminated by signal 11
LOG:  terminating any other active server processes
LOG:  all server processes terminated; reinitializing

Not sure what the meaning of signal 11 is with PG (AFAIR, it's
one of the SIGUSER values, right?)


And then indeed, try to gdb it.  You can run Postgres in non-daemon
mode with command 'postgres -D datadir database'.

The stripped pgcrypto.c you posted - your wrapper function looks fine,
only problem I see is that you deleted function find_provider that is used
by pg_digest, so there will be undefined function in final .so.


Oh no!!  That was only in the function I posted, so that the file
is kept as short as possible -- in the one that I compiled, I left
everything untouched, and only added my functions.


But that should not crash the server, so gdb trace could be still useful.


Ok, will try to do it and post any interesting discoveries  (I
can't find any core files, so I guess I'll have to try gdbing it)

Anyway, I wanted to add hash functions (SHA-1 is already there,
so I'd like to add SHA-256 and SHA-512 at the very least, and
maybe also, for completeness, SHA-224 and SHA-384).


For SHA2 hashes it should be enough to compile pgcrypto
against OpenSSL 0.9.8.  Or upgrade to PostgreSQL 8.1,
where they are included.

Ofcourse, that is no fun.


Hahahaha -- why do I keep being naive and making the same mistake
over and over!!!  :-)

As much as it is indeed no fun, it is also good to know  (and I
didn't know that OpenSSL 0.9.8 had them either, so thanks for
the double pointer!)


If you want to hack, you could try adding SHA224 to the SHA2
implementation in 8.1.

Sounds like a plan  :-)

Thanks,

Carlos
--



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux