|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2398 'END' command to PostgresSQL causing SEGV.
Submitted: 1999-09-28 14:44 UTC Modified: 2002-06-16 08:58 UTC
From: lucas at slf dot cx Assigned:
Status: Not a bug Package: Reproducible Crash
PHP Version: 3.0.12 OS: linux 2.2.12
Private report: No CVE-ID: None
 [1999-09-28 14:44 UTC] lucas at slf dot cx
Performing a pg_exec($database,"end") on a connection causes the child pid to exit with a SEGV. This may have something to do with PostgreSQL sending a notice message through libpg.

 In the interactive client, psql, there is normally a NOTICE sent to the client:

 webdb=> commit;
 webdb => end;
 NOTICE:  EndTransactionBlock and not inprogress/abort state
 webdb => \q

...and in the backtrace (from running http -X inside gdb), the last mentioned function is 'defaultNoticeProcessor()':

#0  0x40222ee1 in ?? ()
#1  0x40185605 in ?? ()
#2  0x4018ceb3 in ?? ()
#3  0x4031fd1b in defaultNoticeProcessor () from /usr/local/pgsql/lib/
#4  0x40320cf0 in getNotice () from /usr/local/pgsql/lib/
#5  0x403202ff in parseInput () from /usr/local/pgsql/lib/
#6  0x40320b4e in PQgetResult () from /usr/local/pgsql/lib/
#7  0x40320ca3 in PQexec () from /usr/local/pgsql/lib/
#8  0x40291a4c in php3_pgsql_exec () at functions/pgsql.c:124

All tested scripts worked 100% when I removed the 'BEGIN'/'COMMIT'/'END' pg_exec() statements.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-16 08:58 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately, PHP 3 is no longer supported. Please download
the latest version of PHP 4 from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 28 16:01:26 2020 UTC