Re: PostgreSQL crashes with Qmail-SQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PostgreSQL crashes with Qmail-SQL
Date
Msg-id 26604.1011979817@sss.pgh.pa.us
Whole thread Raw
In response to Re: PostgreSQL crashes with Qmail-SQL  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: PostgreSQL crashes with Qmail-SQL  (Vince Vielhaber <vev@michvhf.com>)
Re: PostgreSQL crashes with Qmail-SQL  (Bruno Wolff III <bruno@wolff.to>)
Re: PostgreSQL crashes with Qmail-SQL  (Bear Giles <bear@coyotesong.com>)
List pgsql-hackers
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> As a side question, how far do you need to install qmail to use the test?
> I'd gotten the test files to run against a 7.1 server I set up, but didn't
> feel comfortable doing a full install of qmail if possible.

I didn't want to do that either.  I managed to get things running by
unpacking the rpm, unpacking the qmail-1.03.tar.gz original sources,
applying the qmail-sql-0.19.patch (and not any of the other ones,
which might've been a mistake), then setting up the three needed config
files by hand:

$ cat sqltype.h
/* Uncomment to choose postgresql */
#define SQLTYPE PGSQLTYPE
/* Uncomment to choose mysql */
// #define SQLTYPE MYSQLTYPE
$ cat sql.headers
-I/usr/include/pgsql
$ cat sql.lib
-lpq
$

and then I was able to do "make qmail-getpw" which is the only
executable you need for the benchmark.  Put that somewhere, copy
the sqlserver.sample file to where qmail-getpw will look for it [1]
and edit to taste, and you're set.

Caution: I wasted some time running "benchmarks" that proved only
to be exercising how fast the client could fail.  qmail-getpw's
approach to error handling seems to be (a) don't bother testing for
very many error conditions (eg, it coredumps on an empty sqlserver
control file), and (b) if it does detect a failure, exiting with a
nonzero error code is a sufficient way of reporting it.  Error messages
are for wimps, apparently.  So don't bother running the querydb script
until you've made *sure* qmail-getpw is working.  After running the
initdb script (watch out for name conflicts with ours!) you should get

$ ./qmail-getpw alias0 domain0
alias00existance_irrelevant_for_testing-alias00trash@devnull.biz$

if all is well.  Lack of output means you have a problem.
        regards, tom lane

[1] I didn't bother making the expected /var/qmail/control/sqlserver,
but just put the sqlserver file in subdirectory control of where I
was running the tests.  Works fine since qmail-getpw doesn't check
whether its chdir("/var/qmail") succeeds.

[2] No, I don't think I'll be trusting my email to this thing real soon.
But I'd like to know whether it really is provoking a PG crash.


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: RTREE Index on primary key generated by a sequence
Next
From: Vince Vielhaber
Date:
Subject: Re: PostgreSQL crashes with Qmail-SQL