-
Notifications
You must be signed in to change notification settings - Fork 21
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
Coredump on Ubuntu when using polls #40
Comments
hmm. I have to take a look around php's "php://temp" implementation.
|
i does the same with any file, if i recall it right. will doublecheck tomorrow |
o.O. probably i missed something. i'll check this in this weekend. |
Yep, i confirm, <?php
$fd = fopen("testfile","w+");
$poll = uv_poll_init(uv_default_loop(), $fd);
uv_poll_start($poll, UV::WRITABLE, function($poll, $stat, $ev, $conn){
fwrite($conn, "Hello");
fclose($conn);
uv_poll_stop($poll);
});
uv_run(); results in the same thing. Same for UV::READABLE flag |
Looks like it enters if (uv__epoll_ctl(loop->backend_fd, op, w->fd, &e)) {
if (errno != EEXIST)
abort(); in linux.core.c, line 160 |
Alriiiight. It's a problem within libuv. When I asked about it on IRC, i got answered "not very nice, but uv_poll_t is not meant to work with files". Sooo, i don't really know what to do about it. Either someone (I'll give a look at it right now) fixes the issue on linux, or I have to find another way to do it, and I'm pretty positive I can't use uv_fs_poll since it doesn't take an fd, and for react I need it... |
@csaoh thank you for asking on IRC. I also realized it's libuv issue. it's able to work with node-v0.8.21 tag. for now, let's switch libuv version. |
Now it does nothing at all, both on OSX and linux. I also have this message [Thu Feb 28 14:24:31 2013] Script: '/Users/andrey/test.php'
/Users/andrey/www/php-libev/libev.c(396) : Freeing 0x10DAEAD88 (8 bytes), script=/Users/andrey/test.php
Last leak repeated 4 times
=== Total 5 memory leaks detected === |
hmm. my osx and ubuntu box passed the testcases.
and that error message did not (directly) relate php-uv. just php-libev doesn't free some emalloc'ed variables. |
Sorry, works fine ! |
Unfortunately, this issue is still present as of 1.0.0-rc2. I have added a test in my PR #59 to account for this. I think that it might make more sense to only allow fds that uv_poll_init can act on, and throw E_ERRORS for any stream types that are not of type *socket ? |
This code (the example code from uv_poll_start with only php://stdout replaced)
results in
It works fine on OS X though.
(I had to use gcc4.4 as described in #24 to make it work in the first place)
The text was updated successfully, but these errors were encountered: