php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5817 PHP Core Dumps when pg_errormessage() is called.
Submitted: 2000-07-27 16:39 UTC Modified: 2000-07-31 11:14 UTC
From: ac001 at figment dot net Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0.1pl2 OS: Solaris 8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ac001 at figment dot net
New email:
PHP Version: OS:

 

 [2000-07-27 16:39 UTC] ac001 at figment dot net
The PostgreSQL version is: 7.0.2

My current configuration is a follow:
'./configure' '--with-pgsql=/usr/local/pgsql' '--bindir=/usr/local/apache/cgi-bin'
                                   '--with-dbase=yes' '--enable-force-cgi-redirect=yes' '--enable-ftp=yes'
                                   '--with-mysql=no' '--with-gd=no' '--with-imap=/usr/local'

By writing a file with only a single line such as <? pg_errormessage(); ?> and running php-4.0.1pl2 on it, php immediately returns a Sementation Fault and core dumps.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-27 20:48 UTC] ac001 at figment dot net
I have narrowed the crash down to the zend_fetch_resource() function within the zend_list.c file.  It appears to crash as soon as it hits the:
 
    if (!passed_id) {

...line.  I am suspecting that it is really crashing on the line:

     } else if ((*passed_id)->type != IS_RESOURCE) {

...because the passed_id referenced memory location is not valid for some reason.  I am not able to narrow it down any further as I am not familiar with the use of gdb and do not have it installed on this system.  (I guess I have been spoiled by MS.)

 [2000-07-29 08:12 UTC] jah@php.net
Fixed in CVS. (I'm really wondering why you are doing something as
stupid as calling a function that needs an open connection to
PostgreSQL server, but at least it helps to catch those places
where a variable could be used uninitialized...)
 [2000-07-31 11:14 UTC] ac001 at figment dot net
Dear Jah,

      A package called phpPgAdmin uses this function.  How else would you recommend the accessing of PostgreSQL data if we did not use "something as stupid as calling a function that needs an open connection to PostgreSQL server"?

Sincerely,

Albert.


You wrote:
> ID: 5817
> Updated by: jah
> Reported By: ac001@figment.net
> Status: Closed
> Bug Type: PostgreSQL related
> Assigned To: 
> Comments:
> 
> Fixed in CVS. (I'm really wondering why you are doing something as
> stupid as calling a function that needs an open connection to
> PostgreSQL server, but at least it helps to catch those places
> where a variable could be used uninitialized...)
> 
> Full Bug description available at: http://bugs.php.net/?id=5817
> 
> 

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 16:08:09 2025 UTC