Closed hwde closed 11 years ago
Uhm, looking into the code, I see a few other int / (site_t*) usages, so you might need fix them too.
Best Heiko
@hwde Thanks very much for you patch, I will look into them this weekend :)
Cool, thanks.
Am 19.07.2013 um 15:20 schrieb Reeze Xia notifications@github.com:
@hwde Thanks very much for you patch, I will look into them this weekend :)
— Reply to this email directly or view it on GitHub.
I've added another test, maybe you'll find it useful.
Am 19.07.2013 um 16:05 schrieb Heiko Weber heiko@wecos.de:
Cool, thanks.
Am 19.07.2013 um 15:20 schrieb Reeze Xia notifications@github.com:
@hwde Thanks very much for you patch, I will look into them this weekend :)
— Reply to this email directly or view it on GitHub.
Hi Heiko, where is the test? and what do you mean by latest OSX version ? I'm using 10.8.4 and the tests passed. could you provide more info ? eg:
$ uname
$ php -i
Hi,
$ uname -a Darwin Heikos-MacBook-Pro.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
$ php -i phpinfo() PHP Version => 5.3.27
Installed via the ports collection.
Here is a small test C program, do demonstrate the difference:
int main() { printf("%ld %ld\n", sizeof(int), sizeof(size_t)); return 0; }
If I compile this on my Mac book pro I get:
$ gcc test.c
$ ./a.out 4 8
Cheers Heiko
Am 20.07.2013 um 14:47 schrieb Reeze Xia notifications@github.com:
Hi Heiko, where is the test? and what do you mean by latest OSX version ? I'm using 10.8.4 and the tests passed. could you provide more info ? eg:
$ uname $ php -i — Reply to this email directly or view it on GitHub.
Any news on this?
I get a segfault under the same $k => $v circumstances
This error shows up only if the sizeof(int) != 4
I can upload a patch which make it working for me.
@hwde Thanks a lot, it has been fixed in master
Hi Reeze, thanks. This issue is fixed, all tests passed.
I noticed the following tests fails with leveldb-1.12.0:
FAIL leveldb - iterate thought db [tests/005-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]
Digging into the source I noticed that int and size_t seems to be different on my Intel Mac running latest OS X, so here is a small patch, which allow to PASS all tests here (not sure how it will looks like here without a preview option)
Best Heiko
diff --git a/leveldb.c b/leveldb.c index bd64e56e08bd85e2dc45fbcc679aa5ead927a1f6..8e88544b70283b7594d7114a207778a08a8ba86d 100644 --- a/leveldb.c +++ b/leveldb.c @@ -1354,7 +1354,7 @@ PHP_METHOD(LevelDBIterator, getError) PHP_METHOD(LevelDBIterator, current) { char *value = NULL;
size_t value_len; leveldb_iterator_object *intern;
if (zend_parse_parameters_none() == FAILURE) { @@ -1365,11 +1365,11 @@ PHP_METHOD(LevelDBIterator, current) LEVELDB_CHECK_ITER_DB_NOT_CLOSED(intern);
if (!leveldb_iter_valid(intern->iterator) ||
}
@@ -1378,7 +1378,7 @@ PHP_METHOD(LevelDBIterator, current) PHP_METHOD(LevelDBIterator, key) { char *key = NULL;
size_t key_len; leveldb_iterator_object *intern;
if (zend_parse_parameters_none() == FAILURE) { @@ -1389,7 +1389,7 @@ PHP_METHOD(LevelDBIterator, key) LEVELDB_CHECK_ITER_DB_NOT_CLOSED(intern);
if (!leveldb_iter_valid(intern->iterator) ||