|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45268 Incorrect DB4 error callback function prototype
Submitted: 2008-06-14 01:05 UTC Modified: 2008-06-19 22:43 UTC
From: Assigned:
Status: Closed Package: DBM/DBA related
PHP Version: 5.3CVS-2008-06-14 (CVS) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2008-06-14 01:05 UTC]
For BDB 4.7.25 (and probably earlier), the prototype
php_dba_db4_errcall_fcn() needs three arguments.

Documentation for the callback is at:

The expected prototype is:
void DB_ENV->set_errcall(DB_ENV *dbenv, void (*db_errcall_fcn)
  (const DB_ENV *dbenv, const char *errpfx, const char *msg));

In ext/dba/dba_db4.c:
static void php_dba_db4_errcall_fcn(const char *errpfx, char *msg)
should be:
static void php_dba_db4_errcall_fcn(const DB_ENV *dbenv, const char *errpfx, const char *msg)

Actual result:
Currently a compile warning is given:

/home/cjones/phpsrc/php53/ext/dba/dba_db4.c:99: warning: passing argument 2 of 'dbp->set_errcall' from incompatible pointer type


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-14 01:19 UTC]
BDB was built with ../dist/configure --prefix=$HOME/bdb-4.7.25
PHP was built with ... --enable-dba --with-db4=$HOME/bdb-4.7.25

 [2008-06-19 03:57 UTC]
The extra parameter was added in BDB 4.3, so the prototype code should be similar to:

static void php_dba_db4_errcall_fcn(
	const DB_ENV *dbenv, 
	const char *errpfx, const char *msg)

 [2008-06-19 22:43 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 20:01:29 2024 UTC