I stumbled upon a reproductible segmentation fault when trying to get or set any options (like operationTimeout or httpTimeout).
The code is simple :
$cluster = new CouchbaseCluster('couchbase://10.0.0.100','test','');
$bucket = $cluster->openBucket('test');
var_dump($bucket->operationTimeout); // this crashes
This code does not crash under every test system, but when it does it is systematic.
Core dumps and strace available if needed.
Crashes on :
debian 7 64bits, php 5.3.29, php-couchbase 2.0.3 (2.0.2 also), libcouchbase 2.4.5 (2.4.3 also)
Does not crash on :
ubuntu 12.04 32bits, php 5.3.10, php-couchbase 2.0.3 (2.0.2 also), libcouchbase 2.4.5 (2.4.3 also)
In both cases the server is CE 3.0.1 with 1 node.
Are you able to provide the crash dump stack trace? This issue seems strange and is not something I’ve seen happen ever before.
i cannot upload the dump so i provide you with an url :
In the archive you will find :
- the php file
- the core dump
- the strace output
- the PHP binary used
Please tell me when you have downloaded the file that i can remove it.
I have a copy and am investigating.
Although we were not able to inspect the dump file as we need further information regarding your system type, and more of the libraries you have installed (libcouchbase and php-couchbase for instance). I believe I actually managed to locate the source of the issue, see here: https://github.com/couchbaselabs/php-couchbase/commit/5b65074a8e771070183223676f206d2cf2b0893e.
you nailed it ! I recompiled the php-couchbase extension using the master branch and the segfault is gone !
I also recompiled on a 64bit system and no change there (so all is good).
Thanks for the patch.
That’s great to hear! Let me know if you encounter any new issues and I’ll be happy to help.