Closed prolic closed 3 years ago
The URL https://eventstore.org/downloads/ubuntu/EventStore-OSS-Linux-Ubuntu-16.04-v5.0.5.tar.gz
is not pointing to anything downloadable - can you please give me the correct URL?
I'm on macOS right now, so also tried https://eventstore.org/downloads/macos/EventStore-OSS-MacOS-macOS-v5.0.5.tar.gz
, but the URLs just give me:
404 Not Found
Code: NoSuchWebsiteConfiguration
Message: The specified bucket does not have a website configuration
BucketName: eventstore.org
RequestId: 8D7F81BC0C969BF2
HostId: Zr+4srDEmwc8k/TU3mMEx2IzQ48D3mhr7L1Wgke7m/UeadgpnMZT8Q42ieDoGPsh1f+UV+jMNNM=
FWIW: The bug may occur in general if a same file descriptor is used twice. e.g. if you use STDIN and then fopen("php://fd/0", "r"). … Anyway, I'll need to check out your code with the debugger … if I can get it to run :-)
@bwoebi Both of the URLs you posted work fine for me. Maybe it was some temporary problem on their server.
Yeah, works now.
@bwoebi Thank you very much. If you need anything, I try to provide whatever it takes.
The bad news is that it is a ticking time bomb which may or may not explode...
That it does not always happen at the same test case depends on when exactly the cycle collector gets invoked. You can work around your test suite issues by running gc_collect_cycles() after each test… I do recommend to use https://github.com/amphp/phpunit-util though, which takes care of that for you.
The issue is that the tcp stream resource gets freed (not part of the cycle or fclose()'d explicitly) and its file descriptor reused later for another tcp stream, while still being part of the loop (disabled, but still part of loop). The re-adding works fine (obviously, the other poll resource is disabled at that point). Then … the cycle collector decides to free the other poll resource, calls uv_close() on it … and the assertion sees another resource there. And explodes.
I think this is a bug in libuv TBH. I don't think the assertion should be checked at all if uv_poll_s.io_watcher.pevents == 0
. I'll open an issue on upstream.
Side-note: To debug the issue, I really needed to see the file descriptors on the poll objects. I've exposed them in debug_info (i.e. var_dump) now: https://github.com/bwoebi/php-uv/commit/9c08cdc984774fd2ae654e207b9e4b8c2c255ebc - Without this it's defacto impossible to debug this.
Wow, thanks a lot @bwoebi - actually I didn't expect this quick result. Absolutely awesome. Thank you. I'll try your suggestion and keep you posted.
@bwoebi I tried your suggestion using phpunit-util but I am running into problems. The loop won't stop and runs indefinitely, which hangs the test-suite then. Shall I submit an issue at phpunit-util repo? Or should I provide you with a branch where you can test that yourself?
I found out why the loop hangs: The event store connection is still running so the loop doesn't stop. I need to manually close the connection from within the test-case in order to bring to loop to a stop. This feels somehow wrong to me, when the task is completed, why should the loop still be running?
Also stuff like $this->expectException(StreamDeleted::class);
doesn't work with phpunit-util. I get an error like this: An exception was thrown from the test method or promise returned from test method failed, but the event loop continued to run; Prooph\EventStore\Exception\StreamDeleted
, although the exception was expected.
@bwoebi You can ignore my latest questions, as I got some response from amp team already.
Fixed in upstream, build their newest master or next release if you ever see that issue again :-)
When running the test suite of event-store-client
I'm always getting this segfault, but not always on the same test case and if the test case is tested seperately it's green. So I cannot reproduce a single failing test, but only that the test suite itself somehow fails to pass the tests.
Given what I could find about this on google, libuv source code (f.e. https://github.com/libuv/libuv/issues/2387), I have no idea where this can come from. For each test case I create a new event store connection via TCP protocol using
\Amp\Socket\connect
. As logger (another source where something could read / write) a NullLogger is used during the tests.Maybe it is also related to https://github.com/bwoebi/php-uv/issues/49 ?
Do you have any idea where I can look at?
System: Ubuntu 19.10 PHP: 7.4.2 uv: libuv1/eoan,now 1.30.1-1 amd64 [installed,automatic] (via Ubuntu's apt)
see also https://github.com/prooph/event-store-client/issues/75
GDB backtrace:
How can you reproduce this issue? (assuming Ubuntu 16.04 or higher)
wait for it...
you'll get this output:
It's possible that it is not a bug in php-uv but in the php library itself. I spent already more than 40 hours of my freetime debugging this issue and trying to find the root cause, without success so far.
I am totally fine with spending another 40+ hours debugging this problem, but currently I am stuck with this. We currently have 27325 downloads on packagist and a lot of users want to use php-uv as event loop extension. I need to tell them all to use amp's native driver instead. Would be absolutely cool if we can get this solved somehow.