Thread: psql produces core dump

psql produces core dump

From
Reiner Dassing
Date:
Hello Tom!

By accident I gave in psql the command \@ and \db.
In both cases a core dump was produced.

This is just a note for your TODO List.

Basis:
PostgreSQL V7.1.1 on Tru64 V 5.1

--
Mit freundlichen Gruessen / With best regards
   Reiner Dassing

Re: psql produces core dump

From
Oliver Vecernik
Date:
Reiner Dassing wrote:
>
> Hello Tom!
>
> By accident I gave in psql the command \@ and \db.
> In both cases a core dump was produced.
>
> This is just a note for your TODO List.
>
> Basis:
> PostgreSQL V7.1.1 on Tru64 V 5.1

But not on:

                            version
---------------------------------------------------------------
 PostgreSQL 7.1.1 on i686-pc-linux-gnu, compiled by GCC 2.95.2
(1 row)

Oliver

Re: psql produces core dump

From
Bruce Momjian
Date:
Worked fine here:


    \test=> \@
    Invalid command \@. Try \? for help.
    test=> \db
    Did not find any relation named "b".


[ Charset ISO-8859-2 unsupported, converting... ]
> Hello Tom!
>
> By accident I gave in psql the command \@ and \db.
> In both cases a core dump was produced.
>
> This is just a note for your TODO List.
>
> Basis:
> PostgreSQL V7.1.1 on Tru64 V 5.1
>
> --
> Mit freundlichen Gruessen / With best regards
>    Reiner Dassing
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: psql produces core dump

From
Reiner Dassing
Date:
Here's my screen dump:

db=# \@
Invalid command \@. Try \? for help.
Segmentation fault (core dumped)


--
Mit freundlichen Gruessen / With best regards
   Reiner Dassing

Re: psql produces core dump

From
Tom Lane
Date:
Reiner Dassing <dassing@wettzell.ifag.de> writes:
> By accident I gave in psql the command \@ and \db.
> In both cases a core dump was produced.
> PostgreSQL V7.1.1 on Tru64 V 5.1

Apparently this is platform-specific.  Can you provide a stack backtrace
from the core file?

            regards, tom lane

Re: psql produces core dump

From
Tom Lane
Date:
Reiner Dassing <dassing@wettzell.ifag.de> writes:
> By accident I gave in psql the command \@ and \db.
> In both cases a core dump was produced.
> Basis:
> PostgreSQL V7.1.1 on Tru64 V 5.1

Which version is your file pgsql/src/bin/psql/command.c ?
If it's 1.49 then this is a known bug.  1.49.2.1 has the fix,
but I'm not sure if that's in the file set you have.

            regards, tom lane

Re: psql produces core dump

From
Peter Eisentraut
Date:
Reiner Dassing writes:

> By accident I gave in psql the command \@ and \db.
> In both cases a core dump was produced.

This is a bug I accidentally introduced in 7.1.1.  It will be fixed in
7.1.2.  If you only got a core dump, you got lucky...

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: psql produces core dump

From
Reiner Dassing
Date:
Tom Lane wrote:
>
> Reiner Dassing <dassing@wettzell.ifag.de> writes:
> > By accident I gave in psql the command \@ and \db.
> > In both cases a core dump was produced.
> > Basis:
> > PostgreSQL V7.1.1 on Tru64 V 5.1
>
> Which version is your file pgsql/src/bin/psql/command.c ?
> If it's 1.49 then this is a known bug.  1.49.2.1 has the fix,
> but I'm not sure if that's in the file set you have.
It's version 1.49
See:

/*
 * psql - the PostgreSQL interactive terminal
 *
 * Copyright 2000 by PostgreSQL Global Development Group
 *
 * $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/psql/command.c,v
1.49 2001/04/18 20:53:08 petere Exp$
 */


>
>                         regards, tom lane

One remark:
The modified "mainloop.c" I sent you is due to:
query_start contains a value nearly infinity and then it produces
the core dump.

--
Mit freundlichen Gruessen / With best regards
   Reiner Dassing

Re: psql produces core dump

From
Tom Lane
Date:
Reiner Dassing <dassing@wettzell.ifag.de> writes:
> The modified "mainloop.c" I sent you is due to:
> query_start contains a value nearly infinity and then it produces
> the core dump.

Yes, but the broken query_start value is the fault of the bug in
command.c.  You can get the patch from our CVS server,
http://www.ca.postgresql.org/cgi/cvsweb.cgi/pgsql/src/bin/psql/command.c.diff?r1=1.49&r2=1.49.2.1&f=c

            regards, tom lane

Re: psql produces core dump

From
Reiner Dassing
Date:
Tom Lane wrote:
Thank you for the patch at
> http://www.ca.postgresql.org/cgi/cvsweb.cgi/pgsql/src/bin/psql/command.c.diff?r1=1.49&r2=1.49.2.1&f=c

It works!
>
>                         regards, tom lane

--
Mit freundlichen Gruessen / With best regards
   Reiner Dassing

www_sql

From
"Miguel Gonzalez"
Date:
dear all,

 Sorry because maybe this is not the place where I should address this
question, but
I thought that maybe someone on this list knows something about www_sql. If
not, sorry
for disturbing you with my email

Here it goes:

 I have downloaded www-sql 0.5.7 and trying to configure it
for Apache 1.3.14 and for PostgreSQL 7.0.3 (I only have this
database system, no mySQL).

 I have used the followind directives in the configure script:

 >./configure --with-database="pgsql" \
 --with-pgsql-headers="/usr/local/pgsql/include" \
 --with-pgsql-libs="/usr/local/pgsql/libs" \
 --enable-apache-action-check
 --enable-recursive

 >make

 >make install CGI_DIR="/usr/local/apache/cgi-bin"

 It seems that everything is fine, I have checked www-sql with the
example of test.in given in the www-sql.html document and www-sql
gives back the right answer.

 Then I copied the example.pgsql and changed it into ejemplo.sql. I
only tried to use it to query into a different database. But it doesnt
work. I checked then, the error_log of Apache and says the following:

 www-sql:error in loading shared-libraries:libpq.so.2.1:cannot open
shared object file:No such file or directory.

I changed permissions to this file for nobody (the default Apache user)
and didnt work either.

 I have different questions.

 1.- I have only PostgreSQL. I thought that when you use the directive
--with-database="pgsql" then only compiles for PostgreSQL. The output
of the configure script says that cant find mySQL libraries. It seems
that still tries also to compile for mySQL. Checking also config.status
there is an entry about mySQL libs. What is wrong?

 2.- After executing "make" then I got two executables "www-sql"
and "www-pgsql" but when I execute "make install CGI_DIR ..." only
installs in the cgi directory of Apache the www-sql binary. Why?

 3.- In the httpd.conf I added the directives

 Action www-sql /cgi-bin/www-sql
 AddHandler www-sql sql

 This means that I have to use .sql extension to make the cgi www-sql
to parse the file. But is this meant to be only for mySQL? I mean, I
am really confused about the www-sql www-pgsql binaries and dont know
exactly if having www-sql to access PostgreSQL databases I need to
use different directives and binaries (also different extensions
providing that the example given in the source files is called
example.pgsql).

 Sorry for the long email but I had to explain all the steps that I
have taken, but it was necessary to show you guys what I have done
and to focus really in the problem.

 Also I would like to know if there is any resource for www-sql,
tutorials, any other website apart of the main site, mailing-lists, etc.

 Thank you very much in advance and sorry for my English

 Miguel