Bug #51062 [Bgs]: DBA DB4 build uses mismatched headers & libraries

2010-03-04 Thread sixd
Edit report at http://bugs.php.net/bug.php?id=51062&edit=1

 ID:   51062
 Updated by:   s...@php.net
 Reported by:  seanius at debian dot org
 Summary:  DBA DB4 build uses mismatched headers & libraries
 Status:   Bogus
 Type: Bug
 Package:  DBM/DBA related
 Operating System: Debian
 PHP Version:  5.3.1
 Assigned To:  sixd

 New Comment:

The change is in:
http://svn.php.net/viewvc?view=revision&revision=295844


Previous Comments:

[2010-03-05 06:39:12] s...@php.net

I added DB 4.7 & DB 4.8 to the autodetect list in config.m4

for PHP 5.2.14-dev, PHP 5.3.3-dev and PHP 6.

This changes the default behavior and may help many cases.

It certainly allowed DBA DB4 to work when I had 4.7 headers and

4.7 & 4.6 libraries, and built using "--with-db4".  Without the

change I saw the corrupted output you reported.



Config.m4 still doesn't check the library version matches the

header version.


[2010-02-19 08:57:34] seanius at debian dot org

actually it's fairly common (at least on debian-derived systems,
couldn't speak for others) to have multiple versions of libdb installed.
 The problem is that the code that does the testing of headers will
match against a generic "db.h" and then will happily link against any
other version of libdb that it finds (and it doesn't seem to be
searching includes/libs in the same order).  i'd argue that the
configure detection ought to be a bit more thorough in this regard but
won't press the point.


[2010-02-19 08:46:22] j...@php.net

-Status: Open
+Status: Bogus

No need for several reports on basically same issue, and regarding the
header issues: That's nothing we can or will do about. If you mess your
system with multiple libs and headers, that's your problem.


[2010-02-17 22:40:04] seanius at debian dot org

some more investigation reveals that the problem was caused by having
db4.8 headers alongside db4.6 and db4.8 runtime libraries (i.e. having
installed libdb4.6, libdb4.8, and libdv-dev (which is 4.8 in latest
debian/ubuntu)).  the build scripts find the the headers from the db4.8
package, and the 4.6 libraries since there is no code for testing for
versions > 4.6.  strangely enough it's able to build/link.



having the libdb4.6 headers installed instead of the 4.8 headers removes
the problem and the tests pass, but i would argue that this is still a
bug.  namely:



 * php doesn't support building against db4.8 (i could report a seperate
bug about this if it's better)

 * php wrongly builds against headers for one version of libdb and links
against another.


[2010-02-16 21:52:06] seanius at debian dot org

Description:

Tested against the debian 5.3.1 packages as well as a recent 5.3
snapshot.  fails on a variety of BE/LE and 32/64bit archs.  note that
the failure is different from the snapshot (Segfaults in some cases) and
from 5.3.1 (various warnings about invalid parameters).  i don't want to
flood the description so i'll only include the 5.3 snapshot output
here.



=

PHP : ./sapi/cli/php 

PHP_SAPI: cli

PHP_VERSION : 5.3.3-dev

ZEND_VERSION: 2.3.0

PHP_OS  : Linux - Linux rangda 2.6.32-trunk-amd64 #1 SMP Sun Jan 10
22:40:40 UTC 2010 x86_64

INI actual  : /home/sean/Download/php5.3-201002160730

More .INIs  :  

CWD : /home/sean/Download/php5.3-201002160730

Extra dirs  : 

VALGRIND: Not used

=

Running selected tests.

TEST 1/25 [ext/dba/tests/bug36436.phpt]

DIFF

001+ DB->sync: method not permitted before handle's open method

002+ Segmentation fault

001- resource(%d) of type (dba persistent)

002- string(3) "XYZ"

003- string(1) "X"

004- string(1) "Y"

005- ===DONE===

DONE

FAIL Bug #36436 (DBA problem with Berkeley DB4)
[ext/dba/tests/bug36436.phpt] 

TEST 2/25 [ext/dba/tests/bug48240.phpt]

DIFF

001+ DB->sync: method not permitted before handle's open method

002- ===DONE===

003+ Segmentation fault

DONE

FAIL Bug #48240 (DBA Segmentation fault dba_nextkey)
[ext/dba/tests/bug48240.phpt] 

TEST 3/25 [ext/dba/tests/bug49125.phpt]

DIFF

001+ DB->sync: method not permitted before handle's open method

001- bool(true)

002+ Segmentation fault

DONE

FAIL Bug #49125 (Error in dba_exists C code)
[ext/dba/tests/bug49125.phpt] 

PASS DBA File Creation Test [ext/dba/tests/dba001.phpt] 

PASS DBA Insert/Fetch Test [ext/dba/tests/dba002.phpt] 

PASS DBA Insert/Replace/Fetch Test

Bug #51062 [Bgs]: DBA DB4 build uses mismatched headers & libraries

2010-03-04 Thread sixd
Edit report at http://bugs.php.net/bug.php?id=51062&edit=1

 ID:   51062
 Updated by:   s...@php.net
 Reported by:  seanius at debian dot org
-Summary:  test failures in ext/dba
+Summary:  DBA DB4 build uses mismatched headers & libraries
 Status:   Bogus
 Type: Bug
 Package:  DBM/DBA related
 Operating System: Debian
 PHP Version:  5.3.1
 Assigned To:  sixd

 New Comment:

I added DB 4.7 & DB 4.8 to the autodetect list in config.m4

for PHP 5.2.14-dev, PHP 5.3.3-dev and PHP 6.

This changes the default behavior and may help many cases.

It certainly allowed DBA DB4 to work when I had 4.7 headers and

4.7 & 4.6 libraries, and built using "--with-db4".  Without the

change I saw the corrupted output you reported.



Config.m4 still doesn't check the library version matches the

header version.


Previous Comments:

[2010-02-19 08:57:34] seanius at debian dot org

actually it's fairly common (at least on debian-derived systems,
couldn't speak for others) to have multiple versions of libdb installed.
 The problem is that the code that does the testing of headers will
match against a generic "db.h" and then will happily link against any
other version of libdb that it finds (and it doesn't seem to be
searching includes/libs in the same order).  i'd argue that the
configure detection ought to be a bit more thorough in this regard but
won't press the point.


[2010-02-19 08:46:22] j...@php.net

-Status: Open
+Status: Bogus

No need for several reports on basically same issue, and regarding the
header issues: That's nothing we can or will do about. If you mess your
system with multiple libs and headers, that's your problem.


[2010-02-17 22:40:04] seanius at debian dot org

some more investigation reveals that the problem was caused by having
db4.8 headers alongside db4.6 and db4.8 runtime libraries (i.e. having
installed libdb4.6, libdb4.8, and libdv-dev (which is 4.8 in latest
debian/ubuntu)).  the build scripts find the the headers from the db4.8
package, and the 4.6 libraries since there is no code for testing for
versions > 4.6.  strangely enough it's able to build/link.



having the libdb4.6 headers installed instead of the 4.8 headers removes
the problem and the tests pass, but i would argue that this is still a
bug.  namely:



 * php doesn't support building against db4.8 (i could report a seperate
bug about this if it's better)

 * php wrongly builds against headers for one version of libdb and links
against another.


[2010-02-16 21:52:06] seanius at debian dot org

Description:

Tested against the debian 5.3.1 packages as well as a recent 5.3
snapshot.  fails on a variety of BE/LE and 32/64bit archs.  note that
the failure is different from the snapshot (Segfaults in some cases) and
from 5.3.1 (various warnings about invalid parameters).  i don't want to
flood the description so i'll only include the 5.3 snapshot output
here.



=

PHP : ./sapi/cli/php 

PHP_SAPI: cli

PHP_VERSION : 5.3.3-dev

ZEND_VERSION: 2.3.0

PHP_OS  : Linux - Linux rangda 2.6.32-trunk-amd64 #1 SMP Sun Jan 10
22:40:40 UTC 2010 x86_64

INI actual  : /home/sean/Download/php5.3-201002160730

More .INIs  :  

CWD : /home/sean/Download/php5.3-201002160730

Extra dirs  : 

VALGRIND: Not used

=

Running selected tests.

TEST 1/25 [ext/dba/tests/bug36436.phpt]

DIFF

001+ DB->sync: method not permitted before handle's open method

002+ Segmentation fault

001- resource(%d) of type (dba persistent)

002- string(3) "XYZ"

003- string(1) "X"

004- string(1) "Y"

005- ===DONE===

DONE

FAIL Bug #36436 (DBA problem with Berkeley DB4)
[ext/dba/tests/bug36436.phpt] 

TEST 2/25 [ext/dba/tests/bug48240.phpt]

DIFF

001+ DB->sync: method not permitted before handle's open method

002- ===DONE===

003+ Segmentation fault

DONE

FAIL Bug #48240 (DBA Segmentation fault dba_nextkey)
[ext/dba/tests/bug48240.phpt] 

TEST 3/25 [ext/dba/tests/bug49125.phpt]

DIFF

001+ DB->sync: method not permitted before handle's open method

001- bool(true)

002+ Segmentation fault

DONE

FAIL Bug #49125 (Error in dba_exists C code)
[ext/dba/tests/bug49125.phpt] 

PASS DBA File Creation Test [ext/dba/tests/dba001.phpt] 

PASS DBA Insert/Fetch Test [ext/dba/tests/dba002.phpt] 

PASS DBA Insert/Replace/Fetch Test [ext/dba/tests/dba003.phpt] 

PASS DBA Multiple Insert/Fetch Test [ext/dba/tests/dba004.phpt] 

PASS DBA FirstKey/NextKey Loop Test With 5