Thread: ...

...

From
Igor Shevchenko
Date:
Your name        :    Igor Shevchenko
Your email address    : igor@carcass.ath.cx


System Configuration
---------------------
  Architecture: Intel Pentium 4

  Operating System: 2.4.20-8 ELF

  PostgreSQL version: PostgreSQL-7.4beta4

  Compiler used: gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)


Please enter a FULL description of your problem:
------------------------------------------------
I have a GUI app which uses 2 connections and a server process (sserv) with
one connection to the database. One of sserv's tasks is to receive, parse and
store the incoming mail to the database. Each message is added to the
database in it's own single transaction, each transaction consists if 2-10
inserts (one per each message part plus some control records).
When the receiver is active with processing lots of incoming mail (for
example, my mail archive which I use for testing), and the GUI app reads the
database in parallel, postgresql server fails from time to time with the
following message (taken from the server's log):

WARNING:  CommitTransaction and not in in-progress state
TRAP: FailedAssertion("!(TopTransactionContext != ((void *)0))", File: "xact.
c", Line: 660)
LOG:  server process (PID 3499) was terminated by signal 6
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the
current transaction and exit, because a
nother server process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat
your command.
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the
current transaction and exit, because a
nother server process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat
your command.

The problem also happens with gcc 3.3.1 and gcc 2.95.3, some


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
The problem is repeatable when I run my program, especially if the postgresql
server and the sserv are on the same server, and the debugging is off.
Please let me know if you need more details, I'll try to narrow the conditions
to make a simple reproductible sequence of commands.


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------



--
Best regards,
Igor Shevchenko

Re:

From
Tom Lane
Date:
Igor Shevchenko <igor@carcass.ath.cx> writes:
> The problem is repeatable when I run my program, especially if the postgresql
> server and the sserv are on the same server, and the debugging is off.
> Please let me know if you need more details, I'll try to narrow the conditions
> to make a simple reproductible sequence of commands.

I think we're going to need a test case to make any progress on this
one.

            regards, tom lane

Re:

From
Igor Shevchenko
Date:
On Tuesday 14 October 2003 20:50, you wrote:
> Igor Shevchenko <igor@carcass.ath.cx> writes:
> > The problem is repeatable when I run my program, especially if the
> > postgresql server and the sserv are on the same server, and the debugging
> > is off. Please let me know if you need more details, I'll try to narrow
> > the conditions to make a simple reproductible sequence of commands.
>
> I think we're going to need a test case to make any progress on this
> one.

Here's a test case.

1. in t2.cc, replace table name "a" in "select * from a" with any other table
which has lots of data. In my setup, the table 'a' is :

            Table "public.a"
 Column |       Type        | Modifiers
--------+-------------------+-----------
 txt    | character varying |

It has ~50k of rows with the same value 'hello'.

2. compile t2.cc
3. run "while true; do echo "notify new_event" | psql; done" in one shell
4. run t2 in another shell

The t2's backend fails before the query is finished and the following is
printed in the postgresql's log:

WARNING:  CommitTransaction and not in in-progress state
TRAP: FailedAssertion("!(TopTransactionContext != ((void *)0))", File: "xact.
c", Line: 660)
LOG:  server process (PID 10622) was terminated by signal 6
LOG:  terminating any other active server processes

>
>             regards, tom lane

--
Best regards,
Igor Shevchenko

Re:

From
Tom Lane
Date:
Igor Shevchenko <igor@carcass.ath.cx> writes:
> On Tuesday 14 October 2003 20:50, you wrote:
>> I think we're going to need a test case to make any progress on this
>> one.

> Here's a test case.

Thanks.  Turns out to have been an interaction between NOTIFY and the
new V3 query protocol.  Fix committed.

            regards, tom lane