[API 2] remove with persist_to crashes

The following code crashes (segmentation fault) every time :


    <?php
    $var = 'crash__'.getmypid().'_'.time();
    $options = array('persist_to' => 1, 'replicate_to' => 0);

    $cluster = new CouchbaseCluster('couchbase://10.0.0.100','test','');
    $bucket = $cluster->openBucket('test');

    $resp = $bucket->insert($var, 123456, $options);
    $bucket->remove($var,$options); // remove crashes if persist_to is set !

If persist_to is not set in $options then remove works as expected.
I can provide a core dump / stack trace if necessary.


The couchbase cluster i used for testing has only 1 node.
The server is Couchbase CE 3.0.1.

This was reproduced on 2 clients with different configurations :

OS : Ubuntu 12.04 32bit - Linux 3.5.0-54-generic #81~precise1-Ubuntu SMP Tue Jul 15 04:05:58 UTC 2014 i686 i686 i386 GNU/Linux
PHP :
PHP 5.3.10-1ubuntu3.15 with Suhosin-Patch (cli) (built: Oct 29 2014 12:16:30)
Copyright © 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2012 Zend Technologies
PHP module : 2.0.2 from "deb http://packages.couchbase.com/ubuntu precise precise/main"
libcouchbase : 2.4.5

and :

OS : Debian 7 64bit - Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux
PHP :
PHP 5.3.29-1~dotdeb.0 with Suhosin-Patch (cli) (built: Aug 14 2014 19:55:20)
Copyright © 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2014 Zend Technologies
PHP module : 2.0.2
libcouchbase : 2.4.3

Tracking this issue here: https://issues.couchbase.com/browse/PCBC-318

Cheers, Brett