reeze / php-leveldb

The PHP Binding for LevelDB
Other
239 stars 44 forks source link

PHP7 make test failure #25

Closed lexesv closed 6 years ago

lexesv commented 8 years ago

make test

PHP         : /usr/bin/php7.0 
PHP_SAPI    : cli
PHP_VERSION : 7.0.10-1~dotdeb+8.1
ZEND_VERSION: 3.0.0
PHP_OS      : Linux - Linux **** 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64
INI actual  : /home/build/php-leveldb/tmp-php.ini
More .INIs  :   
CWD         : /home/build/php-leveldb
Extra dirs  : 

PASS leveldb - basic: get(), set(), put(), delete() [tests/001-basic.phpt] 
PASS leveldb - db management [tests/002-db-management.phpt] 
PASS leveldb - open base dir [tests/003-openbasedir.phpt] 
PASS leveldb - write batch [tests/004-write-batch.phpt] 
FAIL leveldb - iterate thought db [tests/005-iterator.phpt] 
FAIL leveldb - iterate thought db by foreach [tests/006-iterator-foreach.phpt] 
FAIL leveldb - db close [tests/007-db-close.phpt] 
FAIL leveldb - options open options [tests/008-options.phpt] 
FAIL leveldb - custom comparator [tests/009-comparator.phpt] 
PASS leveldb - compression [tests/010-compression.phpt] 
FAIL leveldb - getApproximateSizes [tests/011-getApproximateSizes.phpt] 
PASS leveldb - getProperty [tests/012-getProperty.phpt] 
PASS leveldb - compactRange [tests/013-compactRange.phpt] 
FAIL leveldb - iterator destroy [tests/014-iterator-destroy.phpt] 
FAIL leveldb - Fixed bug segfault when double construct iterator [tests/015-double-iterator.phpt] 
FAIL leveldb - different iterators should not affect each other [tests/016-different-iterators-should-differ.phpt] 
FAIL leveldb - LevelDB::getIterator() [tests/017-db-getIterator.phpt] 
FAIL leveldb - snapshot [tests/018-snapshot.phpt] 
PASS leveldb - NULL comparator should not throw exception [tests/019-null-comparator.phpt] 
PASS leveldb - NULL snapshot should not throw exception [tests/020-null-snapshot.phpt] 

cat 006-iterator-foreach.sh

#!/bin/sh
export USE_ZEND_ALLOC=0
valgrind /usr/bin/php7.0  -n -c '/home/build/php-leveldb/tmp-php.ini'  -d "output_handler=" -d "open_basedir=" -d "safe_mode=0" -d "disable_functions=" -d "output_buffering=Off" -d "error_reporting=32767" -d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0" -d "html_errors=0" -d "track_errors=1" -d "report_memleaks=1" -d "report_zend_debug=0" -d "docref_root=" -d "docref_ext=.html" -d "error_prepend_string=" -d "error_append_string=" -d "auto_prepend_file=" -d "auto_append_file=" -d "ignore_repeated_errors=0" -d "precision=14" -d "memory_limit=128M" -d "log_errors_max_len=0" -d "opcache.fast_shutdown=0" -d "opcache.file_update_protection=0" -d "extension_dir=/home/build/php-leveldb/modules/" -d "extension=leveldb.so" -d "session.auto_start=0" -d "zlib.output_compression=Off" -f "/home/build/php-leveldb/tests/006-iterator-foreach.php"  2>&1

./006-iterator-foreach.sh

==3442== Memcheck, a memory error detector
==3442== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3442== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3442== Command: /usr/bin/php7.0 -n -c /home/build/php-leveldb/tmp-php.ini -d output_handler= -d open_basedir= -d safe_mode=0 -d disable_functions= -d output_buffering=Off -d error_reporting=32767 -d display_errors=1 -d display_startup_errors=1 -d log_errors=0 -d html_errors=0 -d track_errors=1 -d report_memleaks=1 -d report_zend_debug=0 -d docref_root= -d docref_ext=.html -d error_prepend_string= -d error_append_string= -d auto_prepend_file= -d auto_append_file= -d ignore_repeated_errors=0 -d precision=14 -d memory_limit=128M -d log_errors_max_len=0 -d opcache.fast_shutdown=0 -d opcache.file_update_protection=0 -d extension_dir=/home/build/php-leveldb/modules/ -d extension=leveldb.so -d session.auto_start=0 -d zlib.output_compression=Off -f /home/build/php-leveldb/tests/006-iterator-foreach.php
==3442== 
==3442== Invalid read of size 8
==3442==    at 0x71921E7: zim_LevelDBIterator___construct (leveldb.c:1316)
==3442==    by 0x35AA19: dtrace_execute_internal (in /usr/bin/php7.0)
==3442==    by 0x3EF90F: ??? (in /usr/bin/php7.0)
==3442==    by 0x3AACAA: execute_ex (in /usr/bin/php7.0)
==3442==    by 0x35A8A7: dtrace_execute_ex (in /usr/bin/php7.0)
==3442==    by 0x3FF596: zend_execute (in /usr/bin/php7.0)
==3442==    by 0x36AD32: zend_execute_scripts (in /usr/bin/php7.0)
==3442==    by 0x30B5CF: php_execute_script (in /usr/bin/php7.0)
==3442==    by 0x401249: ??? (in /usr/bin/php7.0)
==3442==    by 0x1F0FBC: main (in /usr/bin/php7.0)
==3442==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==3442== 
==3442== 
==3442== Process terminating with default action of signal 11 (SIGSEGV)
==3442==  Access not within mapped region at address 0x0
==3442==    at 0x71921E7: zim_LevelDBIterator___construct (leveldb.c:1316)
==3442==    by 0x35AA19: dtrace_execute_internal (in /usr/bin/php7.0)
==3442==    by 0x3EF90F: ??? (in /usr/bin/php7.0)
==3442==    by 0x3AACAA: execute_ex (in /usr/bin/php7.0)
==3442==    by 0x35A8A7: dtrace_execute_ex (in /usr/bin/php7.0)
==3442==    by 0x3FF596: zend_execute (in /usr/bin/php7.0)
==3442==    by 0x36AD32: zend_execute_scripts (in /usr/bin/php7.0)
==3442==    by 0x30B5CF: php_execute_script (in /usr/bin/php7.0)
==3442==    by 0x401249: ??? (in /usr/bin/php7.0)
==3442==    by 0x1F0FBC: main (in /usr/bin/php7.0)
==3442==  If you believe this happened as a result of a stack
==3442==  overflow in your program's main thread (unlikely but
==3442==  possible), you can try to increase the size of the
==3442==  main thread stack using the --main-stacksize= flag.
==3442==  The main thread stack size used in this run was 8388608.
==3442== 
==3442== HEAP SUMMARY:
==3442==     in use at exit: 1,533,083 bytes in 10,483 blocks
==3442==   total heap usage: 13,466 allocs, 2,983 frees, 2,013,084 bytes allocated
==3442== 
==3442== LEAK SUMMARY:
==3442==    definitely lost: 0 bytes in 0 blocks
==3442==    indirectly lost: 0 bytes in 0 blocks
==3442==      possibly lost: 663,211 bytes in 6,577 blocks
==3442==    still reachable: 869,872 bytes in 3,906 blocks
==3442==         suppressed: 0 bytes in 0 blocks
==3442== Rerun with --leak-check=full to see details of leaked memory
==3442== 
==3442== For counts of detected and suppressed errors, rerun with: -v
==3442== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 1 from 1)
./006-iterator-foreach.sh: line 5:  3442 Killed                  valgrind /usr/bin/php7.0 -n -c '/home/build/php-leveldb/tmp-php.ini' -d "output_handler=" -d "open_basedir=" -d "safe_mode=0" -d "disable_functions=" -d "output_buffering=Off" -d "error_reporting=32767" -d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0" -d "html_errors=0" -d "track_errors=1" -d "report_memleaks=1" -d "report_zend_debug=0" -d "docref_root=" -d "docref_ext=.html" -d "error_prepend_string=" -d "error_append_string=" -d "auto_prepend_file=" -d "auto_append_file=" -d "ignore_repeated_errors=0" -d "precision=14" -d "memory_limit=128M" -d "log_errors_max_len=0" -d "opcache.fast_shutdown=0" -d "opcache.file_update_protection=0" -d "extension_dir=/home/build/php-leveldb/modules/" -d "extension=leveldb.so" -d "session.auto_start=0" -d "zlib.output_compression=Off" -f "/home/build/php-leveldb/tests/006-iterator-foreach.php" 2>&1
lexesv commented 8 years ago

/home/build/leveldb/out-shared# ls db db_bench helpers libleveldb.so libleveldb.so.1 libleveldb.so.1.19 port table util

roncemer commented 7 years ago

"make test" is failing several tests on Ubuntu 16.04 LTS 64-bit. Please fix. There are a lot of people using LevelDB, and this is the only PHP extension that comes close to working. PHP 5.x to 7 migrations using LevelDB are impossible without this driver working.

Also, the PHP7 versions should be the main version, and should be the version which PECL is serving. PHP 5.x is dead.

Here's the result of "make test" for a build of the latest PHP 7 snapshot of the code, built against the latest LevelDB library:

=====================================================================
PHP         : /usr/bin/php7.0 
PHP_SAPI    : cli
PHP_VERSION : 7.0.22-0ubuntu0.16.04.1
ZEND_VERSION: 3.0.0
PHP_OS      : Linux - Linux util502 4.4.0-1038-aws #47-Ubuntu SMP Thu Sep 28 20:05:35 UTC 2017 x86_64
INI actual  : /opt/leveldb-pecl/php-leveldb-PHP7/tmp-php.ini
More .INIs  :   
CWD         : /opt/leveldb-pecl/php-leveldb-PHP7
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2017-10-19 07:36:00
=====================================================================
PASS leveldb - basic: get(), set(), put(), delete() [tests/001-basic.phpt] 
PASS leveldb - db management [tests/002-db-management.phpt] 
PASS leveldb - open base dir [tests/003-openbasedir.phpt] 
PASS leveldb - write batch [tests/004-write-batch.phpt] 
FAIL leveldb - iterate thought db [tests/005-iterator.phpt] 
FAIL leveldb - iterate thought db by foreach [tests/006-iterator-foreach.phpt] 
FAIL leveldb - db close [tests/007-db-close.phpt] 
FAIL leveldb - options open options [tests/008-options.phpt] 
FAIL leveldb - custom comparator [tests/009-comparator.phpt] 
PASS leveldb - compression [tests/010-compression.phpt] 
FAIL leveldb - getApproximateSizes [tests/011-getApproximateSizes.phpt] 
PASS leveldb - getProperty [tests/012-getProperty.phpt] 
PASS leveldb - compactRange [tests/013-compactRange.phpt] 
FAIL leveldb - iterator destroy [tests/014-iterator-destroy.phpt] 
FAIL leveldb - Fixed bug segfault when double construct iterator [tests/015-double-iterator.phpt] 
FAIL leveldb - different iterators should not affect each other [tests/016-different-iterators-should-differ.phpt] 
FAIL leveldb - LevelDB::getIterator() [tests/017-db-getIterator.phpt] 
FAIL leveldb - snapshot [tests/018-snapshot.phpt] 
PASS leveldb - NULL comparator should not throw exception [tests/019-null-comparator.phpt] 
PASS leveldb - NULL snapshot should not throw exception [tests/020-null-snapshot.phpt] 
=====================================================================
TIME END 2017-10-19 07:36:02

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   14
---------------------------------------------------------------------

Number of tests :   20                20
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   11 ( 55.0%) ( 55.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    9 ( 45.0%) ( 45.0%)
---------------------------------------------------------------------
Time taken      :    2 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
leveldb - iterate thought db [tests/005-iterator.phpt]
leveldb - iterate thought db by foreach [tests/006-iterator-foreach.phpt]
leveldb - db close [tests/007-db-close.phpt]
leveldb - options open options [tests/008-options.phpt]
leveldb - custom comparator [tests/009-comparator.phpt]
leveldb - getApproximateSizes [tests/011-getApproximateSizes.phpt]
leveldb - iterator destroy [tests/014-iterator-destroy.phpt]
leveldb - Fixed bug segfault when double construct iterator [tests/015-double-iterator.phpt]
leveldb - different iterators should not affect each other [tests/016-different-iterators-should-differ.phpt]
leveldb - LevelDB::getIterator() [tests/017-db-getIterator.phpt]
leveldb - snapshot [tests/018-snapshot.phpt]
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.  You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]: ^CMakefile:134: recipe for target 'test' failed
roncemer commented 7 years ago

Also, I'm seeing segfaults when running this LevelDB extension under PHP7.0 on Ubuntu 16.04 LTS 64-bit.