php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40418 PQfreemem does not exist prior to Postgresql 7.4
Submitted: 2007-02-09 17:04 UTC Modified: 2007-02-11 23:27 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: wdierkes at 5dollarwhitebox dot org Assigned: iliaa
Status: Closed Package: PostgreSQL related
PHP Version: 5.2.1 OS: Redhat EL 3 (i386 and x86_64)
Private report: No CVE-ID:
 [2007-02-09 17:04 UTC] wdierkes at 5dollarwhitebox dot org
Description:
------------
This is sortof related to a previous bug:

http://bugs.php.net/bug.php?id=33813


However, in that bug report the compile fails due to the 
PQfreemem call.  A patch was submitted to cvs that to check 
for PQfreemem, and if HAVE_PQFREEMEM = 0  use 'efree' 
instead.

As of php-5.2.1 this change seems to have been reverted, and 
systems with Postgresql < 7.4 will fail to load php-pgsql 
with the following error (or similar):

PHP Warning:  PHP Startup: Unable to load dynamic library '/
usr/lib/php/modules/pdo_pgsql.so' - /usr/lib/php/modules/
pdo_pgsql.so: undefined symbol: PQfreemem in Unknown on line 
0
PHP Warning:  PHP Startup: Unable to load dynamic library '/
usr/lib/php/modules/pgsql.so' - /usr/lib/php/modules/
pgsql.so: undefined symbol: PQfreemem in Unknown on line 0



php-5.2.0 source used 'free' rather than PQfreemem.  
Therefore, the following is a proposed patch:

http://5dollarwhitebox.org/tmp/php-5.2.1-PQfreemem.patch





Reproduce code:
---------------
Build php-5.2.1 with '--with-pgsql', install, and run a simple test with 'php -v' in order to load the pgsql.so.

Expected result:
----------------
No errors when loading pgsql.co.

Actual result:
--------------
you@linuxbox ~/]# php -v

PHP Warning:  PHP Startup: Unable to load dynamic library '/
usr/lib/php/modules/pdo_pgsql.so' - /usr/lib/php/modules/
pdo_pgsql.so: undefined symbol: PQfreemem in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/
usr/lib/php/modules/pgsql.so' - /usr/lib/php/modules/pgsql.so: 
undefined symbol: PQfreemem in Unknown on line 0
PHP 5.2.1 (cli) (built: Feb  8 2007 21:37:29) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-11 23:27 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 10:02:06 2014 UTC