Skip to content

PHP: Segfault with version 3.11.2 and simple spanner call #7055

Closed
@bakins

Description

@bakins

What version of protobuf and what language are you using?
Version: 3.11.2
Language: php 7.3.13 (tested with other versions)

What operating system (Linux, Windows, ...) and version?
Linux - Ubuntu Buster

What runtime / compiler are you using (e.g., python version or gcc version)
php 7.3.13 with gcc 8.3.0

What did you do?

See example at https://github.com/bakins/php-protobuf-segfault

What did you expect to see

PHP script runs successfully with protobuf extension version 3.11.2

What did you see instead?

Segfault.

Works with extension version 3.10.0

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fcc8fe82a93 in zim_Descriptor_getClass (execute_data=0x7fcc9021e1a0, return_value=0x7fcc9021e0d0) at /usr/src/protobuf-3.11.2/def.c:138
138	  const char* classname = ZSTR_VAL(intern->klass->name);
[Current thread is 1 (Thread 0x7fcc9043f440 (LWP 7))]
(gdb) bt
#0  0x00007fcc8fe82a93 in zim_Descriptor_getClass (execute_data=0x7fcc9021e1a0, return_value=0x7fcc9021e0d0) at /usr/src/protobuf-3.11.2/def.c:138
#1  0x000055c446de88c7 in execute_ex ()
#2  0x000055c446d56616 in zend_call_function ()
#3  0x000055c446c72a8b in ?? ()
#4  0x000055c446de92c6 in execute_ex ()
#5  0x000055c446d8e542 in zend_generator_resume ()
#6  0x000055c446d8f2d2 in ?? ()
#7  0x000055c446da4542 in ?? ()
#8  0x000055c446dc9f23 in ?? ()
#9  0x000055c446de2d95 in execute_ex ()
#10 0x000055c446dea7e2 in zend_execute ()
#11 0x000055c446d64363 in zend_execute_scripts ()
#12 0x000055c446d05268 in php_execute_script ()
#13 0x000055c446decd3e in ?? ()
#14 0x000055c446a8029c in ?? ()
#15 0x00007fcc9326409b in __libc_start_main (main=0x55c446a7fe10, argc=2, argv=0x7fff869480d8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=0x7fff869480c8) at ../csu/libc-start.c:308
#16 0x000055c446a8097a in _start ()
(gdb)

Anything else we should know about your project / environment

Simple spanner example code from https://github.com/GoogleCloudPlatform/php-docs-samples/blob/master/spanner/quickstart.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions