Bug #531: libpq: Operations following PQfinish() work.

Lists: pgsql-bugs
From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #531: libpq: Operations following PQfinish() work.
Date: 2001-12-06 18:35:49
Message-ID: 200112061835.fB6IZnx78865@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Anthony Chavez (anthony(at)xmission(dot)com) reports a bug with a severity of 4
The lower the number the more severe it is.

Short Description
libpq: Operations following PQfinish() work.

Long Description
The PGconn *conn argument to PQfinish() is not set to NULL. As a result, calling libpq functions---in particular, PQexec()---after PQfinish() has been called, continue to work until the following segmentation fault occurs:

Program received signal SIGSEGV, Segmentation fault.
0x4044dec7 in resetPQExpBuffer () from /usr/lib/libpq.so.2

This can be misleading, and it may be wise to set conn = NULL before PQfinish() returns.

Environment: PostgreSQL 7.1.3 / RedHat Linux 7.1.

Sample Code

No file was uploaded with this report


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: anthony(at)xmission(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #531: libpq: Operations following PQfinish() work.
Date: 2001-12-10 10:25:50
Message-ID: 200112101025.fBAAPoa03030@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


This is an interesting question. Should we clear these variables for
safety. I can't think of any other software that does this.

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

> Anthony Chavez (anthony(at)xmission(dot)com) reports a bug with a severity of 4
> The lower the number the more severe it is.
>
> Short Description
> libpq: Operations following PQfinish() work.
>
> Long Description
> The PGconn *conn argument to PQfinish() is not set to NULL. As a result, calling libpq functions---in particular, PQexec()---after PQfinish() has been called, continue to work until the following segmentation fault occurs:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x4044dec7 in resetPQExpBuffer () from /usr/lib/libpq.so.2
>
> This can be misleading, and it may be wise to set conn = NULL before PQfinish() returns.
>
> Environment: PostgreSQL 7.1.3 / RedHat Linux 7.1.
>
>
> Sample Code
>
>
> No file was uploaded with this report
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: anthony(at)xmission(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #531: libpq: Operations following PQfinish() work.
Date: 2001-12-10 14:36:20
Message-ID: 13327.1007994980@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> This is an interesting question. Should we clear these variables for
> safety.

Rather difficult considering that it's passed by value.

regards, tom lane