Re: segfault on rollback

From: "Sergey E(dot) Koposov" <math(at)sai(dot)msu(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: segfault on rollback
Date: 2006-08-13 05:34:34
Message-ID: Pine.LNX.4.64.0608130921500.1391@lnfm1.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 12 Aug 2006, Tom Lane wrote:

> "Sergey E. Koposov" <math(at)sai(dot)msu(dot)ru> writes:
>> I recently have seen the segfault with Postgres 8.1.4.
>
> I'm betting that portal->sourceText has already been deallocated when
> exec_execute_message tries to print the log message. Getting an actual
> segfault from that would very probably be hard to reproduce, but if you
> build with --enable-cassert it should not be too hard to reproduce
> corruption of the log message, ie, display of garbage instead of
> "ROLLBACK" as the command text. Please try that and see if you can
> generate a self-contained test case.

I succeeded to get the self contained case, but in java (it is just 15
lines, but it crashes the backend). (probably I should forward the mail
pgsql-jdbc...)

import java.sql.*;
public class xx
{
public static void main(String args[]) throws Exception
{
Class.forName("org.postgresql.Driver");
Connection dbcon = DriverManager.getConnection("jdbc:postgresql://localhost:5432/template1","postgres","");
dbcon.setAutoCommit(false);
Statement stmt = dbcon.createStatement();
stmt.execute("create table xx(a int, b double precision)");
dbcon.rollback();
}
}

I'm not sure that it is possible to reproduce without java, since JDBC do
its own query preparing and a lot of other stuff internally which
should be non trivial to reproduce without jdbc...

Regards,
Sergey

*******************************************************************
Sergey E. Koposov
Max Planck Institute for Astronomy/Sternberg Astronomical Institute
Tel: +49-6221-528-349
Web: http://lnfm1.sai.msu.ru/~math
E-mail: math(at)sai(dot)msu(dot)ru

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-08-13 06:16:19 Updatable views
Previous Message Lamar Owen 2006-08-13 05:00:49 The long-lost pg_upgrade (was:Re: 8.2 features status)