Coder Social home page Coder Social logo

Comments (7)

ichiriac avatar ichiriac commented on August 21, 2024

Could you fork my repository, add some phpt unit tests files and make a pull request. Future migrations will be easier

from pecl-event-libevent.

ichiriac avatar ichiriac commented on August 21, 2024

Hi,

the bug comes from an allocation problem and the garbage collector, at the second pass, it destroys the event buffer BEFORE attaching it to the $ev.

After some investigations, it problably comes from a bad GC counter on the $base variable and an edge bug on php7.

I have no more time to work on this right now (I do this on my spare time), I'll come back on it maybe in a few weeks ...

from pecl-event-libevent.

Joungkyun avatar Joungkyun commented on August 21, 2024

solved this problem include case 1 and case 2. see also attached patch file.
And, confirm no memory leak with valgrind.

also, fixed compile error too. follow code has compile error.

-php_sock = (php_socket *)zend_fetch_resource_ex(fd, NULL, php_sockets_le_socket());
+php_sock = (php_socket *)zend_fetch_resource2_ex(fd, NULL, php_sockets_le_socket());

event_base_free__problems_no.3.diff.txt

P.S.
I have not yet accustomed github system. So instead of push, attach patch file. Thx.
The patch file has unix format(\n). On windows, use wordpad instead of notepad.

from pecl-event-libevent.

ichiriac avatar ichiriac commented on August 21, 2024

@Joungkyun thanks for the patch, it works, i've released the code and tests according but seems to have some leaks :

https://travis-ci.org/expressif/pecl-event-libevent/jobs/101288331

To work with github click on "fork" button on the top of this page, a fork project will be created on your own profile.

Checkout your fork, make changes commit & push, and when you are ready, create a pull request from the pull requests tab (on your fork project).

Thanks again for your help,
Best Regards,
Ioan

from pecl-event-libevent.

Joungkyun avatar Joungkyun commented on August 21, 2024

@ichiriac For libevent001 and libevent002, I think that PHP 7.1 environment seems to be the problem. Plez check again on PHP 7.0 environment.

And libevent003 seems there is a problem in event_base_free.

from pecl-event-libevent.

ichiriac avatar ichiriac commented on August 21, 2024

I'm actually using the master branch of PHP to run tests - it's in principle the 'stable' branch of latests release ... I've put an comment dirrectly on your pull request about the memory leaks, you can take a look at the travis logs.

By the way, thanks a lot helping me to solve this problem !

from pecl-event-libevent.

Joungkyun avatar Joungkyun commented on August 21, 2024

Is really master branch 'stable' branch of latests relelase? The master branch is PHP 7.1 stream and I know that PHP 7.1 stream is not stable. is the lastest stable stream PHP-7.0 branch?

from pecl-event-libevent.

Related Issues (17)

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.