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: 7.0.16.0, time stamp: 0x58a3607e
Faulting module name: php7.dll, version: 7.0.16.0, 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://127.0.0.1?detailed_errcodes=1’, ‘’, ‘’);
$bucket = $cluster->openBucket(‘couch’, ‘couch’);

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

     - {type: 'dl', uri: 'http://windows.php.net/downloads/releases/archives/php-7.0.16-nts-Win32-VC14-x64.zip', maps: {'*' : 'php/'}}
      - {type: 'dl', uri: 'http://windows.php.net/downloads/pecl/releases/xdebug/2.5.1/php_xdebug-2.5.1-7.0-nts-vc14-x64.zip', maps: {'php_xdebug.dll':'php/ext/php_xdebug.dll'}}
      - {type: 'dl', uri: 'https://ci.appveyor.com/api/buildjobs/7b47bfc24eynberd/artifacts/x64%2FRelease%2Fphp_tideways.dll' , maps: {'x64%2FRelease%2Fphp_tideways.dll':'php/ext/php_tideways.dll'}}
      - {type: 'dl', uri: 'http://windows.php.net/downloads/pecl/releases/pcs/1.3.3/php_pcs-1.3.3-7.0-nts-vc14-x64.zip', maps: {'php_pcs.dll':'php/ext/php_pcs.dll'}}
      - {type: 'dl', uri: 'http://windows.php.net/downloads/pecl/releases/igbinary/2.0.1/php_igbinary-2.0.1-7.0-nts-vc14-x64.zip', maps: {'php_igbinary.dll': 'php/ext/php_igbinary.dll'}}
      - {type: 'dl', uri: 'http://windows.php.net/downloads/pecl/releases/couchbase/2.3.1/php_couchbase-2.3.1-7.0-nts-vc14-x64.zip', maps: {'php_couchbase.dll':'php/ext/php_couchbase.dll', 'libcouchbase.dll':'php/libcouchbase.dll'}}
      - {type: 'dl', uri: 'http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/4.1.8preview/php_pdo_sqlsrv-4.1.8preview-7.0-nts-vc14-x64.zip', maps: {'php_pdo_sqlsrv.dll': 'php/ext/php_pdo_sqlsrv.dll'}}
      - {type: 'dl', uri: 'http://windows.php.net/downloads/pecl/releases/wincache/2.0.0.8/php_wincache-2.0.0.8-7.0-nts-vc14-x64.zip', 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.

Thanks!

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