Coder Social home page Coder Social logo

grpc-php7's People

Contributors

stanley-cheung avatar thinkerou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grpc-php7's Issues

Error when running EndToEndTest.php unit test

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

TODO for making grpc supports php5 and php7

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:

  • use char* and size_t or int instead of zend_string. it will crash if use int about s on php7.
  • unify size_t and int to grpc_int about s
  • not use ZEND_HASH_FOREACH_*_VAL macro or use macro for differentiate php version
  • use TSRMLS_* macro for ensure code security on php5
  • define macro grpc_long, it is zend_long on php7 and is long on php5
  • unify return_value, because it errors on php5, like: ChannelCredentials::createDefault
  • unify zend_object_store_get_object and Z_WRAPPED_XXX_P
  • make MAKE_STD_ZVAL use on php7
  • unify free_wrapped_grpc_xxx function
  • unify grpc_php_wrap_xxx function
  • unify create_wrapped_grpc_xxx function
  • unify wrap object struct by macro

and wrap some macros....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.