Re: server closed connection on a select query

From: Guillaume Lelarge <guillaume(dot)lelarge(at)gmail(dot)com>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: server closed connection on a select query
Date: 2005-11-22 18:02:35
Message-ID: d854adec0511221002n1838f933h@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry for answering this late.

2005/11/16, Larry Rosenman <ler(at)lerctr(dot)org>:
> Bruce Momjian wrote:
> > The SCO compiler is so buggy (and for so many years) I see no reason
> > to even look at a bug report from someone using it.
> >
>
> I **REALLY** wish you would STOP saying that, Bruce. The current OpenServer
> Compiler (UDK), is the same as on UnixWare, and is **MUCH** better than the
> Old SVR3 compiler.
>
> We **REALLY** **SHOULD** look at it.
>
> I'll take the bug report directly to SCO if I get enough detail.
>

I was using cc, exactly "SCO UNIX Development System Release 5.1.2A
27Jul00". Last week, I tried with "UX:i386cc: INFO: SCO UNIX
Development System Release 5.2.0A 07Oct05" but I had the same
results. I think I'm doing something wrong but I don't know what.

I launched postgres in standalone mode and a core file is created. I
used gdb on it to see the backtrace :
(gdb) bt
#0 0x081bf5fd in booltestsel ()
#1 0x08141125 in clause_selectivity ()
#2 0x081409d2 in clauselist_selectivity ()
#3 0x0814295b in set_baserel_size_estimates ()
#4 0x0813ff42 in set_plain_rel_pathlist ()
#5 0x0813ff12 in set_base_rel_pathlists ()
#6 0x0813fe1d in make_one_rel ()
#7 0x0814b455 in query_planner ()
#8 0x0814bfa0 in grouping_planner ()
#9 0x0814ba11 in subquery_planner ()
#10 0x0814b6c7 in planner ()
#11 0x08181e07 in pg_plan_query ()
#12 0x08181ea0 in pg_plan_queries ()
#13 0x081820ce in exec_simple_query ()
#14 0x081849dd in PostgresMain ()
#15 0x08161d92 in BackendRun ()
#16 0x081616c9 in BackendStartup ()
#17 0x0815fba8 in ServerLoop ()
#18 0x0815f67c in PostmasterMain ()
#19 0x08127d91 in main ()
#20 0x08074d1a in _start ()

So I tried to work on the booltestsel function
(src/backend/utils/adt/selfuncs.c file). I added some elog statements
to see where problems arise. When I put an elog statement in these
lines, my issue is gone :
/*
* Get first MCV frequency and derive frequency for true
*/
if (DatumGetBool(values[0]))
freq_true = numbers[0];
else
freq_true = 1.0 - numbers[0] - freq_null;

/*
* Next derive frequency for false. Then use these as appropriate
* to derive frequency for each case.
*/
freq_false = 1.0 - freq_true - freq_null;

So, I don't get it. I have absolutely no problems with gcc on linux,
but I have this issue on cc (5.1.2A and 5.2.0A releases).

Larry, if you have some more questions, please ask. I don't know whose
bug it is (c compiler or PostgreSQL... or, perhaps, me) but I want to
get rit of it.

Regards.

--
Guillaume.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-11-22 18:28:38 Update to FAQ
Previous Message Martijn van Oosterhout 2005-11-22 17:56:48 Re: Practical error logging for very large COPY