Process crash when calling openBucket()

Trying to migrate from PHP sdk 2.2.x to 2.3.x, I am seing PHP segfault:

Faulting application name: php-cgi.exe, version:, time stamp: 0x58a3607e
Faulting module name: php7.dll, version:, time stamp: 0x58a3656d
Exception code: 0xc0000005
Fault offset: 0x00000000001b25e7
Faulting process id: 0x4efc
Faulting application start time: 0x01d2bd93c76ec05f
Faulting application path: D:_webs\chf_envivo_tEB\runtime\php\php-cgi.exe
Faulting module path: D:_webs\chf_envivo_tEB\runtime\php\php7.dll
Report Id: 7ac5fc79-c189-498d-a885-e53159db2acd
Faulting package full name:
Faulting package-relative application ID:

The error is very easy to reproduce, the following script will make PHP segfault:

$cluster = new \CouchbaseCluster(‘couchbase://’, ‘’, ‘’);
$bucket = $cluster->openBucket(‘couch’, ‘couch’);

Environment is IIS (Internet Information Services) with the following PHP extensions:

     - {type: 'dl', uri: '', maps: {'*' : 'php/'}}
      - {type: 'dl', uri: '', maps: {'php_xdebug.dll':'php/ext/php_xdebug.dll'}}
      - {type: 'dl', uri: '' , maps: {'x64%2FRelease%2Fphp_tideways.dll':'php/ext/php_tideways.dll'}}
      - {type: 'dl', uri: '', maps: {'php_pcs.dll':'php/ext/php_pcs.dll'}}
      - {type: 'dl', uri: '', maps: {'php_igbinary.dll': 'php/ext/php_igbinary.dll'}}
      - {type: 'dl', uri: '', maps: {'php_couchbase.dll':'php/ext/php_couchbase.dll', 'libcouchbase.dll':'php/libcouchbase.dll'}}
      - {type: 'dl', uri: '', maps: {'php_pdo_sqlsrv.dll': 'php/ext/php_pdo_sqlsrv.dll'}}
      - {type: 'dl', uri: '', maps: {'php_wincache.dll': 'php/ext/php_wincache.dll'}}

could you try to instantiate cluster object with only one argument? you dont need those empty strings

That did the trick… but still it does not feel right:

  • It was working with previous versions of the driver
  • A process crash is not the way to deal with this (maybe a proper exception?)
  • The fact that there is a process crash makes me wonder if this is a very isolated bug, or a bad-coding-practice in the C extension lead to it, and if it will be present in other parts of the extension

jthe issue has been fixed on master already and will be included in the next release with the proper exception.

this one was only related to constructors. I’ve checked them all. in fact it reports the issue as php warning but by default continues execution leaving half-constructed object.


I’m porting the Drupal Couchbase Module to make it work with 2.3.x, and I’m finding tons of breaking changes. Will be reporting any weird issues as I come across them.

That’s great. Please keep us updated