Обсуждение: BUG #2195: log_min_messages crash server when in DEBUG3 to 5

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

BUG #2195: log_min_messages crash server when in DEBUG3 to 5

От
"Jaime Casanova"
Дата:
The following bug has been logged online:

Bug reference:      2195
Logged by:          Jaime Casanova
Email address:      systemguards@gmail.com
PostgreSQL version: 8.1.1
Operating system:   Windows XP
Description:        log_min_messages crash server when in DEBUG3 to 5
Details:

Hi,

in my machine (win xp) i was trying to start psql (8.1.1) with
log_min_messages to debug5 (just to see the messages :) but even the
service start i cannot use psql nor pgadmin i receive an error of
server  closed the connection unexpectedly

postgres=# select version();
                                        version

----------------------------------------------------------------------------
--------------
 PostgreSQL 8.1.1 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
3.4.2 (mingw-special)
(1 fila)


Sorry, my postgres is in spanish but maybe you can recognize the message...
;)

C:\Archivos de programa\PostgreSQL\8.1\bin>psql -U postgres pruebas
psql: el servidor ha cerrado la conexión inesperadamente,
       probablemente porque terminó de manera anormal
       antes o durante el procesamiento de la petición.


is this expected on windows platforms?

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to 5

От
Tom Lane
Дата:
"Jaime Casanova" <systemguards@gmail.com> writes:
> in my machine (win xp) i was trying to start psql (8.1.1) with
> log_min_messages to debug5 (just to see the messages :) but even the
> service start i cannot use psql nor pgadmin i receive an error of
> server  closed the connection unexpectedly

Can't reproduce this on Linux using 8.1 branch tip, so either it's
Windows-specific or it's been fixed recently ...

            regards, tom lane

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to 5

От
"Milen A. Radev"
Дата:
Tom Lane writes:
> "Jaime Casanova" <systemguards@gmail.com> writes:
>> in my machine (win xp) i was trying to start psql (8.1.1) with
>> log_min_messages to debug5 (just to see the messages :) but even the
>> service start i cannot use psql nor pgadmin i receive an error of
>> server  closed the connection unexpectedly
>
> Can't reproduce this on Linux using 8.1 branch tip, so either it's
> Windows-specific or it's been fixed recently ...
>

 Should be windows-specific - I can reproduce it with 8.1.2 on WinXP SP2
and I can't reproduce it with 8.1.2 on Slackware Linux 9.1 (kernel 2.6.15).

By the way I have the crash report files Windows created -
postgres.exe.hdmp, postgres.exe.mdmp, appcompat.txt and manifest.txt.

--
Milen A. Radev

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Bruce Momjian
Дата:
Milen A. Radev wrote:
> Tom Lane writes:
> > "Jaime Casanova" <systemguards@gmail.com> writes:
> >> in my machine (win xp) i was trying to start psql (8.1.1) with
> >> log_min_messages to debug5 (just to see the messages :) but even the
> >> service start i cannot use psql nor pgadmin i receive an error of
> >> server  closed the connection unexpectedly
> >
> > Can't reproduce this on Linux using 8.1 branch tip, so either it's
> > Windows-specific or it's been fixed recently ...
> >
>
>  Should be windows-specific - I can reproduce it with 8.1.2 on WinXP SP2
> and I can't reproduce it with 8.1.2 on Slackware Linux 9.1 (kernel 2.6.15).
>
> By the way I have the crash report files Windows created -
> postgres.exe.hdmp, postgres.exe.mdmp, appcompat.txt and manifest.txt.

I was able to reproduce this on Unix by adding -DEXEC_BACKEND to the
compile line.  It errors out on DEBUG3 and higher.  I assume the problem
is that the debug system is not initialized properly in the EXEC_BACKEND
case.  Win32 uses -DEXEC_BACKEND so that is why Win32 is failing.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to 5

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I was able to reproduce this on Unix by adding -DEXEC_BACKEND to the
> compile line.  It errors out on DEBUG3 and higher.

Oh, OK, I'll take a look.

            regards, tom lane

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I was able to reproduce this on Unix by adding -DEXEC_BACKEND to the
> compile line.  It errors out on DEBUG3 and higher.

I tried on CVS tip and don't see a problem.  Which branch were you
testing?

            regards, tom lane

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I was able to reproduce this on Unix by adding -DEXEC_BACKEND to the
> > compile line.  It errors out on DEBUG3 and higher.
>
> I tried on CVS tip and don't see a problem.  Which branch were you
> testing?

Uh, CVS HEAD.  I put -DEXEC_BACKEND into Makefile.custom, and recompiled
and initdb'ed.  I then modified postgresql.conf and set log_min_messages
to "debug5".  Then stop and start the server.  The server log looks like
the server is running, but you cannot connect using psql, so something
died.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> I tried on CVS tip and don't see a problem.  Which branch were you
>> testing?

> Uh, CVS HEAD.  I put -DEXEC_BACKEND into Makefile.custom, and recompiled
> and initdb'ed.  I then modified postgresql.conf and set log_min_messages
> to "debug5".  Then stop and start the server.  The server log looks like
> the server is running, but you cannot connect using psql, so something
> died.

[ scratches head... ]  I put "#define EXEC_BACKEND 1" into pg_config.h
instead, and didn't bother to initdb, but otherwise the same.  Wonder
why it's not failing for me.  Something platform-specific maybe?

            regards, tom lane

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >> I tried on CVS tip and don't see a problem.  Which branch were you
> >> testing?
>
> > Uh, CVS HEAD.  I put -DEXEC_BACKEND into Makefile.custom, and recompiled
> > and initdb'ed.  I then modified postgresql.conf and set log_min_messages
> > to "debug5".  Then stop and start the server.  The server log looks like
> > the server is running, but you cannot connect using psql, so something
> > died.
>
> [ scratches head... ]  I put "#define EXEC_BACKEND 1" into pg_config.h
> instead, and didn't bother to initdb, but otherwise the same.  Wonder
> why it's not failing for me.  Something platform-specific maybe?

I just tested again using your pg_config.h modification, and I still
get the failure, so perhaps BSD/OS and Win32 have similar issues with
our code.

Trimming off the environment output, attached is the log file with the
sig11/segfault failure.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
DEBUG:  invoking IpcMemoryCreate(size=37224448)
DEBUG:  max_safe_fds = 112, usable_fds = 122, already_open = 6
LOG:  database system was shut down at 2006-01-26 13:52:54 EST
LOG:  checkpoint record is at 0/3444F8
LOG:  redo record is at 0/3444F8; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 570; next OID: 16385
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system is ready
LOG:  transaction ID wrap limit is 2147484146, limited by database "postgres"
DEBUG:  proc_exit(0)
DEBUG:  shmem_exit(0)
DEBUG:  exit(0)
DEBUG:  forked new backend, pid=13011 socket=7
DEBUG:  server process (PID 13011) was terminated by signal 11
LOG:  server process (PID 13011) was terminated by signal 11
LOG:  terminating any other active server processes
DEBUG:  sending SIGQUIT to process 12978
DEBUG:  sending SIGQUIT to process 12979
DEBUG:  proc_exit(0)
DEBUG:  shmem_exit(0)
DEBUG:  exit(0)
LOG:  all server processes terminated; reinitializing
DEBUG:  shmem_exit(0)
DEBUG:  invoking IpcMemoryCreate(size=37224448)
LOG:  database system was interrupted at 2006-01-26 13:52:55 EST
LOG:  checkpoint record is at 0/3444F8
LOG:  redo record is at 0/3444F8; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 570; next OID: 16385
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  record with zero length at 0/34453C
LOG:  redo is not required
LOG:  database system is ready
LOG:  transaction ID wrap limit is 2147484146, limited by database "postgres"
DEBUG:  proc_exit(0)
DEBUG:  shmem_exit(0)
DEBUG:  exit(0)

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I just tested again using your pg_config.h modification, and I still
> get the failure, so perhaps BSD/OS and Win32 have similar issues with
> our code.

Hmph.  I've just been trying to reproduce it on Linux (FC4), and it's
OK for me there as well as on HPUX where I tried first.  Odder and
odder.

> Trimming off the environment output, attached is the log file with the
> sig11/segfault failure.

Oh, if you're getting a segfault, could we see the backtrace?

            regards, tom lane

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Tom Lane
Дата:
I wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> I just tested again using your pg_config.h modification, and I still
>> get the failure, so perhaps BSD/OS and Win32 have similar issues with
>> our code.

> Hmph.  I've just been trying to reproduce it on Linux (FC4), and it's
> OK for me there as well as on HPUX where I tried first.  Odder and
> odder.

Actually, maybe the failure requires some configure option I'm not using
... what's your configure command?

            regards, tom lane

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Bruce Momjian
Дата:
Tom Lane wrote:
> I wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> >> I just tested again using your pg_config.h modification, and I still
> >> get the failure, so perhaps BSD/OS and Win32 have similar issues with
> >> our code.
>
> > Hmph.  I've just been trying to reproduce it on Linux (FC4), and it's
> > OK for me there as well as on HPUX where I tried first.  Odder and
> > odder.
>
> Actually, maybe the failure requires some configure option I'm not using
> ... what's your configure command?

configure \
    --with-x \
    --with-tcl \
    --with-perl \
    --enable-pltcl-unknown \
    --with-tclconfig=/u/lib \
    --with-tkconfig=/u/lib \
    --with-includes="/usr/local/include/readline /usr/contrib/include" \
    --with-libraries="/usr/local/lib /usr/contrib/lib" \
    --enable-locale \
    --enable-multibyte \
    --with-openssl \
    --enable-cassert \
    --enable-thread-safety \
    --enable-nls

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: BUG #2195: log_min_messages crash server when in DEBUG3 to

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> configure \
>     --with-x \
>     --with-tcl \
>     --with-perl \
>     --enable-pltcl-unknown \
>     --with-tclconfig=/u/lib \
>     --with-tkconfig=/u/lib \
>     --with-includes="/usr/local/include/readline /usr/contrib/include" \
>     --with-libraries="/usr/local/lib /usr/contrib/lib" \
>     --enable-locale \
>     --enable-multibyte \
>     --with-openssl \
>     --enable-cassert \
>     --enable-thread-safety \
>     --enable-nls

Still can't reproduce it here.  What stack trace do you get from the
crash?

            regards, tom lane