[Exim] Re: Exim4.31+PostgreSQL problem

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Mikhail Ts
Ημερομηνία:  
Προς: ph10
Υ/ο: exim-users
Αντικείμενο: [Exim] Re: Exim4.31+PostgreSQL problem
--- Mikhail Ts <ts_mike@???> wrote: > Hi,
> I'm experiencing strange problem - when Exim 4.31 MTA makes a call to
> PostgreSQL DB I get following in gdb: "Program received signal
> SIGINT,
> Interrupt." Execution goes somewhere without trace in any log. I
> asked
> on Exim lists without much luck. One of the reasons - this Exim
> installation works just fine against MySQL DB. Another - Exim works
> fine with PostgreSQL as well when Exim is run in debug mode. It only
> crashes when it is run as standalone daemon. PostgreSQL log shows
> normal queries without errors. I also have Courier IMAP server
> working
> with the same PostgreSQL DB without problems. I compared source and
> couldn't see significant difference in implementation. In both cases
> libpq linked as shared library. I've found that Exim crashes at the
> PQexec call with PGconn being checked by PQstatus line before. If I
> comment PQexec call out - everything goes fine except DB data of
> course. Questions:
> 1. How to get information on what exactly crashes?
> 2. Any idea how the place where function is called can either crash
> it
> or continue normally?
>
> I rebuilt/cleaned both programs more then once with the same result.
> Find doesn't find libpq in any other place except pgsql directory. OS
> -
> Debian Linux 2.2.20.
>
> Mikhail.
>


I published message above to PostgreSQL list but didn't get any
replies. Good news - I know what was causing problems - while debugging
Courier I set up log_statement=true flag in PostgreSQL config file to
see what exact queries get generated. If I change to default "false"
Exim starts to work normally if I set to "true" - it goes the way I
described earlier. By this time I've not only rebuilt all three
programs several times but also upgraded my kernel to 2.4.25 version,
made libpq statically linked into Exim, switched to Unix domain
sockets, tried to attach to running Exim with gdb - still the same
behaviour, except gdb message shown above. I'm very new to all this and
could be missing something obvious but it seemed to me that log setting
shouldn't affect that much. I also wrote simple C program to access
PostgreSQL and it shown that PostgreSQL returns back log record itself
as a first row in query result(!) in this mode and that confuses hell
out of pgsql lookup on Exim side. As I stated earlier - no traces in
Exim logs, email and errors just get lost. Didn't trace it further
though. If I put log_write() statements in pgsql.c above(!) PQexec call
they are lost as well in this mode - I don't see them in the log.
That's where I got the assumption that something "crashes" and stack
gets partially cleared(?). Anyway - I got it running and like it very
much, thank you.

Mikhail.

______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca