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

From: Carlos Moreno <moreno_pg(at)mochima(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why is create function bringing down the Backend server?
Date: 2005-12-22 23:45:51
Message-ID: 43AB3AAF.3020007@mochima.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marko Kreen wrote:

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

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-22 23:51:17 Re: view or index to optimize performance
Previous Message Klein Balázs 2005-12-22 23:42:56 Re: view or index to optimize performance