thinkerou / grpc-php7 Goto Github PK
View Code? Open in Web Editor NEWUpgrading grpc PHP extensions from PHP5 to PHP7(PHP NG)
Upgrading grpc PHP extensions from PHP5 to PHP7(PHP NG)
Hi, thanks for the contribution. I was trying to look into this and ran into an issue. I took your branch, and the latest grpc master branch, and tried to compile this with PHP 7. I got around some fairly minor issue here and there but was stuck trying to debug this one:
So I was trying to run the unit tests via bin/run_tests.sh
. Some of the simpler tests run correctly, like TimevalTest.php
, CallTest.php
, ServerTest.php
. But EndToEndTest.php
failed. Here's the error I got
E0715 19:24:24.681174835 31243 compression.c:157] Unknown compression level 32643
./bin/run_tests.sh: line 41: 31243 Aborted php $extension_dir -d max_execution_time\
=300 $(which phpunit) -v --debug ../$1
That's because of this: https://github.com/grpc/grpc/blob/master/src/core/lib/compression/compression.c#L157
And I think that's because somehow this is_set
is true, which should not:
https://github.com/grpc/grpc/blob/master/src/core/lib/surface/call.c#L1414
The error originates from this Grpc\OP_SEND_STATUS_FROM_SERVER
array being set to something non-trivial.
https://github.com/grpc/grpc/blob/master/src/php/tests/unit_tests/EndToEndTest.php#L72
My guess is that somewhere in here: https://github.com/thinkerou/grpc-php7/blob/master/ext/grpc/call.c#L369 there's some leak setting up the internal metadata array.
Can you please look into it? Thanks
Have committed to grpc/grpc
grpc/grpc#7464
Hi @stanley-cheung , I list some thoughts about grpc-php7 merge grpc/src/php and begin to prepare work.
Because we will not create dir(like grpc/src/php/ext/grpc-php7
) but use macro, so we need to consider how reduce code and ensure security.
For reducing dup-code, we firstly need to do:
char*
and size_t or int
instead of zend_string
. it will crash if use int
about s
on php7.size_t
and int
to grpc_int
about s
ZEND_HASH_FOREACH_*_VAL
macro or use macro for differentiate php versionTSRMLS_*
macro for ensure code security on php5grpc_long
, it is zend_long
on php7 and is long
on php5return_value
, because it errors on php5
, like: ChannelCredentials::createDefault
zend_object_store_get_object
and Z_WRAPPED_XXX_P
MAKE_STD_ZVAL
use on php7free_wrapped_grpc_xxx
functiongrpc_php_wrap_xxx
functioncreate_wrapped_grpc_xxx
functionwrap object struct
by macroand wrap some macros....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.