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

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Carlos Moreno <moreno_pg(at)mochima(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why is create function bringing down the Backend server?
Date: 2005-12-22 21:09:37
Message-ID: e51f66da0512221309t58ce32d9o3c47c478b611fbff@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/22/05, Carlos Moreno <moreno_pg(at)mochima(dot)com> 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.

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.

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

> 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.

If you want to hack, you could try adding SHA224 to the SHA2
implementation in 8.1. There are currently only SHA256/384/512
hashes implemented. (AFAIR it is basically truncated SHA256
but with different init vector)

--
marko

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ted Byers 2005-12-22 21:27:58 Re: Stored procedure
Previous Message David Fetter 2005-12-22 20:09:55 Re: Sorting array field