andreiz / php-zookeeper

A PHP extension for interfacing with Apache ZooKeeper
Other
449 stars 215 forks source link

Segmentation fault when printing a node #10

Closed quipo closed 12 years ago

quipo commented 12 years ago

I get a segmentation fault when printing (using var_dump() or print_r()) a non-leaf node in zookeeper. Reproducing script:

<?php
$path = '/brokers';

$zookeeper = new Zookeeper('localhost:2181');
var_dump($zookeeper->exists($path));

$node = $zookeeper->get($path);
var_dump($node);

output:

array(11) {
  ["czxid"]=>
  float(4294967318)
  ["mzxid"]=>
  float(4294967318)
  ["ctime"]=>
  float(1323252256252)
  ["mtime"]=>
  float(1323252256252)
  ["version"]=>
  int(0)
  ["cversion"]=>
  int(2)
  ["aversion"]=>
  int(0)
  ["ephemeralOwner"]=>
  float(0)
  ["dataLength"]=>
  int(0)
  ["numChildren"]=>
  int(2)
  ["pzxid"]=>
  float(4294967323)
}

string(-1) "Segmentation fault

if I set the $path to '/brokers/' (with the trailing slash) there's no segmentation fault.

Tested on CentOS release 5.7 (Final), x86_64. PHP 5.3.14.