Thread: Bug #714: pg_dump segfaults when given an invalid command line option

Bug #714: pg_dump segfaults when given an invalid command line option

From
pgsql-bugs@postgresql.org
Date:
Menno Smits (menno@oxcoda.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
pg_dump segfaults when given an invalid command line option

Long Description
pg_dump crashes with a segmentation fault and dumps core when given an invalid command line option.

Example:
$ pg_dump --someoptionthatdoesntexist somedb
Segmentation fault (core dumped)

A core file is left behind. 

Version information:
Postgresql version 7.2.1 on a Redhat 6.2 based system.
Postgresql installed from RPMS built from the official SRPMS.
(ie. rpm --rebuild postgresql-7.2.1-2PGDG.src.rpm)

Sample Code


No file was uploaded with this report

Re: Bug #714: pg_dump segfaults when given an invalid command

From
Bruce Momjian
Date:
I just tried with current CVS and got:

    $ aspg pg_dump  --someoptionthatdoesntexist somedb

    pg_dump: unrecognized option `--someoptionthatdoesntexist'
    Try 'pg_dump --help' for more information.

My guess is that there is something buggy with your libc getopt.  Can
someone else reproduce this error?

---------------------------------------------------------------------------

pgsql-bugs@postgresql.org wrote:
> Menno Smits (menno@oxcoda.com) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> pg_dump segfaults when given an invalid command line option
>
> Long Description
> pg_dump crashes with a segmentation fault and dumps core when given an invalid command line option.
>
> Example:
> $ pg_dump --someoptionthatdoesntexist somedb
> Segmentation fault (core dumped)
>
> A core file is left behind.
>
> Version information:
> Postgresql version 7.2.1 on a Redhat 6.2 based system.
> Postgresql installed from RPMS built from the official SRPMS.
> (ie. rpm --rebuild postgresql-7.2.1-2PGDG.src.rpm)
>
> Sample Code
>
>
> No file was uploaded with this report
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>

--
  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: Bug #714: pg_dump segfaults when given an invalid command

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I just tried with current CVS and got:
>     $ aspg pg_dump  --someoptionthatdoesntexist somedb
>     pg_dump: unrecognized option `--someoptionthatdoesntexist'
>     Try 'pg_dump --help' for more information.
> My guess is that there is something buggy with your libc getopt.  Can
> someone else reproduce this error?

This is fixed since 7.2.

            regards, tom lane

Re: Bug #714: pg_dump segfaults when given an invalid command

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I just tried with current CVS and got:
> >     $ aspg pg_dump  --someoptionthatdoesntexist somedb
> >     pg_dump: unrecognized option `--someoptionthatdoesntexist'
> >     Try 'pg_dump --help' for more information.
> > My guess is that there is something buggy with your libc getopt.  Can
> > someone else reproduce this error?
>
> This is fixed since 7.2.

Oh, I rememberz now.  Was a bug in 7.2 and fixed in 7.2.1:

    revision 1.244
    date: 2002/03/21 05:47:14;  author: momjian;  state: Exp;  lines: +61 -62
    Fix pg_dump help option alignment.

--
  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: Bug #714: pg_dump segfaults when given an invalid command

From
Menno Smits
Date:
Sorry but I'm using 7.2.1 and am seeing the problem :).
It didn't occur on the same machine/libs with 7.1.2.

Regards,
Menno Smits

On Thu, Jul 18, 2002 at 11:00:58PM -0400, Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I just tried with current CVS and got:
> >     $ aspg pg_dump  --someoptionthatdoesntexist somedb
> >     pg_dump: unrecognized option `--someoptionthatdoesntexist'
> >     Try 'pg_dump --help' for more information.
> > My guess is that there is something buggy with your libc getopt.  Can
> > someone else reproduce this error?
>
> This is fixed since 7.2.
>
>             regards, tom lane