-
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
Segmentation fault: 11 error #14
Comments
Hi @jilieryuyi, I'll take a look at this issue tonight |
Has it been fixed? This bug still happen after recompile |
Not yet, the night may be long :) |
Just a question, if you want to use it as a timer, why don't you use <?php
function tick() {
echo 'tick';
}
// create ressources
$base = event_base_new();
$event = event_timer_new();
// configure
event_timer_set($event, 'tick');
event_base_set($event, $base);
event_add($event, 1000);
// run
event_base_loop($base, EVLOOP_ONCE); The segmentation fault comes from the fact that the 500000 is considered as a long and tries to convert it to a ressource (old legacy code). IMO it would just raise a warning, return false, and I should remove the long argument type in order to be more strict. Need to digg in order to be sure what usecase could be possible for a ressource -> long Please, tell me if it's OK with the timer functions |
Just a test ! thank you for your answer ! |
Hi @jilieryuyi, It's fixed, could help with snippets like these. You can make PHPT files here : https://github.com/expressif/pecl-event-libevent/tree/master/tests and send me a pull request, it would greatly improve the library stability |
I got an error Segmentation fault: 11
run with code :
$base = event_base_new();
$event = event_new();
event_set($event, 0, EV_TIMEOUT, function() {
echo "function called";
});
event_base_set($event, $base);
event_add($event, 5000000);
event_base_loop($base);
The text was updated successfully, but these errors were encountered: