protobuf-3.3.2 segment fault: 11
php-version: php 7.1.7 protobuf-vsesion:protobuf 3.3.2(https://pecl.php.net/package/protobuf/3.3.2)
Here is the proto file and backtrace message: //================================================= syntax = "proto3"; package com; message A { string str = 1; } message B { A a = 307001; string json_body_req = 308000; } //======================================================= php script is : $b = new \Com\B(); $a = new Com\A(); $a->setStr("hello"); $b->setJsonBodyReq("world"); $b->setA($a); $str = $b->serializeToString();
$b = new \Com\B();
$b->mergeFromString($str);
var_dump($b->getA()->getStr());
//=======================================================
Core was generated by `php Client.php'.
Program terminated with signal 11, Segmentation fault.
#0 stringdata_handler (closure=0x600000002, hd=0x322d2f0,
str=0x7efe59462419 "hello", len=5, handle=0x7fff883d3820)
at /root/protobuf-3.3.2/encode_decode.c:325
325 /root/protobuf-3.3.2/encode_decode.c: No such file or directory.
Missing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.26-20.el7_2.x86_64 glibc-2.17-157.el7_3.5.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.14.1-27.el7_3.x86_64 libcom_err-1.42.9-9.el7.x86_64 libcurl-7.29.0-35.el7.centos.x86_64 libidn-1.28-4.el7.x86_64 libjpeg-turbo-1.2.90-5.el7.x86_64 libmcrypt-2.5.8-13.el7.x86_64 libpng-1.5.13-7.el7_2.x86_64 libselinux-2.5-6.el7.x86_64 libssh2-1.4.3-10.el7_2.1.x86_64 libxml2-2.9.1-6.el7_2.3.x86_64 nspr-4.13.1-1.0.el7_3.x86_64 nss-3.28.4-1.2.el7_3.x86_64 nss-softokn-freebl-3.16.2.3-14.4.el7.x86_64 nss-util-3.28.4-1.0.el7_3.x86_64 openssl-libs-1.0.1e-60.el7_3.1.x86_64 pcre-8.32-15.el7_2.1.x86_64 xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) bt
#0 stringdata_handler (closure=0x600000002, hd=0x322d2f0,
str=0x7efe59462419 "hello", len=5, handle=0x7fff883d3820)
at /root/protobuf-3.3.2/encode_decode.c:325
#1 0x00007efe58ec4cc7 in upb_sink_putstring (handle=0x7fff883d3820, n=5,
buf=
Does this still happen with 3.4.0 release?
This issue can be closed, starting with version 3.4.0 the crash has vanished. See full testcase at https://github.com/jbq/protobuf-bug-3402