-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event_base_free problems #3
Comments
Could you fork my repository, add some phpt unit tests files and make a pull request. Future migrations will be easier |
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 ... |
solved this problem include case 1 and case 2. see also attached patch file. 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. |
@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, |
@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. |
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 ! |
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? |
OS: Centos 7.2
PHP: 7.0.1
libevent: 1.4.3 or 2.0.21
The problems has 2 case. These cases has no problems under PHP 5.6.14 + mod_libevent-0.1.0.
_case 1_ codes:
_expected:_ no result
_result:_ segfault
_case 2_ codes:
_expected:_ no result
_result:_ $sock variable is modulated after calling the first event_base_free.
The text was updated successfully, but these errors were encountered: