Обсуждение: BUG #7955: argv=0x0 on program start

Поиск
Список
Период
Сортировка

BUG #7955: argv=0x0 on program start

От
dweber@htw-saarland.de
Дата:
The following bug has been logged on the website:

Bug reference:      7955
Logged by:          Damian Weber
Email address:      dweber@htw-saarland.de
PostgreSQL version: 9.2.3
Operating system:   FreeBSD 9.1-STABLE, arch i386
Description:        =


My program compiled with system compiler gcc-4.2.1 and ecpg from PostgreSQL
version 9.2.3 terminates by receiving SIGSEGV. The gdb debugger shows
argv=3D0x0 (see below). On PostgreSQL version 8.4.16 it runs without troubl=
e.

Debugger output:
b$ gdb  bin/prog prog.core =

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `prog'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/pgsql/lib/libecpg.so.6...done.
Loaded symbols for /usr/local/pgsql/lib/libecpg.so.6
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/pgsql/lib/libpgtypes.so.3...done.
Loaded symbols for /usr/local/pgsql/lib/libpgtypes.so.3
Reading symbols from /usr/local/pgsql/lib/libpq.so.5...done.
Loaded symbols for /usr/local/pgsql/lib/libpq.so.5
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libthr.so.3...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x08048eec in main (argc=3D-1077949560, argv=3D0x0) at prog.pgc:87
87      {
[New Thread 44004300 (LWP 100115/prog)]

Re: BUG #7955: argv=0x0 on program start

От
Michael Meskes
Дата:
On Sat, Mar 16, 2013 at 12:12:49PM +0000, dweber@htw-saarland.de wrote:
> My program compiled with system compiler gcc-4.2.1 and ecpg from Postgr=
eSQL
> version 9.2.3 terminates by receiving SIGSEGV. The gdb debugger shows
> argv=3D0x0 (see below). On PostgreSQL version 8.4.16 it runs without tr=
ouble.
>=20
> Debugger output:
> b$ gdb  bin/prog prog.core=20
> GNU gdb 6.1.1 [FreeBSD]
> ...
> Program terminated with signal 11, Segmentation fault.
> ...
> #0  0x08048eec in main (argc=3D-1077949560, argv=3D0x0) at prog.pgc:87
> 87      {

Hmm, this looks like the program didn't even start. Honestly I fail to se=
e how
this could be a bug in PostgreSQL. Are the libraries and the program comp=
iled
with threading enabled? What happens if you use a very small test case in=
stead
of your program?

Michael
--=20
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at gmail dot com
VfL Borussia! For=C3=A7a Bar=C3=A7a! Go SF 49ers! Use Debian GNU/Linux, P=
ostgreSQL

Re: BUG #7955: argv=0x0 on program start

От
Damian Weber
Дата:
On Sun, 17 Mar 2013, Michael Meskes wrote:

> Date: Sun, 17 Mar 2013 11:04:26 +0100
> From: Michael Meskes <meskes@postgresql.org>
> To: dweber@htw-saarland.de
> Cc: pgsql-bugs@postgresql.org
> Subject: Re: [BUGS] BUG #7955: argv=0x0 on program start
>
> On Sat, Mar 16, 2013 at 12:12:49PM +0000, dweber@htw-saarland.de wrote:
> > My program compiled with system compiler gcc-4.2.1 and ecpg from PostgreSQL
> > version 9.2.3 terminates by receiving SIGSEGV. The gdb debugger shows
> > argv=0x0 (see below). On PostgreSQL version 8.4.16 it runs without trouble.
> >
> > Debugger output:
> > b$ gdb  bin/prog prog.core
> > GNU gdb 6.1.1 [FreeBSD]
> > ...
> > Program terminated with signal 11, Segmentation fault.
> > ...
> > #0  0x08048eec in main (argc=-1077949560, argv=0x0) at prog.pgc:87
> > 87      {
>
> Hmm, this looks like the program didn't even start. Honestly I fail to see how
> this could be a bug in PostgreSQL. Are the libraries and the program compiled
> with threading enabled? What happens if you use a very small test case instead
> of your program?

while narrowing things down, I installed PostgresQL 8.4.16, 9.0.12,
9.1.8 and 9.2.23 and I got several different symptoms
along the way, a) being a case where it shows something unrelated
to PostgresQL, so you may close the issue on the PostgresQL bug tracking
system

a) some non-postgres function (print_usage()) commented out -> program works
b) some non-postgres function (print_usage()) active -> program crashes with argv=0x0
c) postgres function (select cursor, open, fetch, close) commented out -> program works
d) postgres function (select cursor, open, fetch, close) active -> program crashes with argv=0x0

mysteriously no crashes using PostgresQL 8.4.16, so perhaps a change
in ecpg from 8.4 to 9.0 triggered that kind of bug, maybe some kind
of size limit which prevented the program to execute in the first place

after a reboot of the machine I cannot reproduce the symptom anymore

anyway, sorry for the noise

Best regards

  Damian