ID:               51086
 Updated by:       [email protected]
 Reported By:      seanius at debian dot org
-Status:           Open
+Status:           Feedback
 Bug Type:         DBM/DBA related
 Operating System: Debian (and others)
 PHP Version:      5.3.1
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------

[2010-02-18 23:46:46] seanius at debian dot org

a little more info:  afaict the file is being created with zero size
via some stream functions in dba.c.  when db->open() is called with
DB_CREATE|DB_TRUNCATE libdb4.8 tries to read some metadata from the
existing file and fails horribly.  i tried playing around with the flags
(passing only DB_TRUNCATE does not work, passing only DB_CREATE seems to
work but still produces the error message).

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

[2010-02-18 23:41:52] seanius at debian dot org

Description:
------------
while the configure changes needed to get php to build against libdb4.8
are pretty trivial, there's unfortunately a significant behavior change
in how libdb's db->open() reacts when called with DB_CREATE|DB_TRUNCATE
on an existing zero-sized file.  this also breaks other apps, such as
sendmail or nvi, which use similar "locking hacks" (i'm guessing that's
what's going on here) on db files.

it's possible that this might be fixed in a later release of libdb4.8
in which case it might be good to refuse building against earlier
versions of 4.8 when the fix does come out.  in the meantime i'm
wondering about the options for someone who can't back out to 4.7 :/

for reference:

similar bug in sendmail:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=565242

similar bug in nvi (gentoo dev "I'm not sure if this is a bug or a
feature"): http://bugs.gentoo.org/286352

Reproduce code:
---------------
run ext/dba/tests/bug36436.phpt, for example, or probably any other db4
related code after building against 4.8.



Expected result:
----------------
PASS

Actual result:
--------------
FAIL, with error messages like:

PHP Notice:  dba_popen(): fop_read_meta:
/home/sean/debian/php/ext/dba/tests/test0.dbm: unexpected file type or
format in /home/sean/debian/php/ext/dba/tests/bug36436.php on line 6



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


-- 
Edit this bug report at http://bugs.php.net/?id=51086&edit=1

Reply via email to