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
connectTCP could crash if it was interrupted (libevent driver) #1331
Comments
Can anyone help me? |
s-ludwig
added a commit
that referenced
this issue
Nov 12, 2015
I've added a fix on master, can you verify if it works for you? |
s-ludwig
added a commit
that referenced
this issue
Nov 12, 2015
Thank you. I'll try it. |
Interrupted connection crash was fixed, but another crash introduced (most likely by commit 9b7b3f6).
Code import vibe.d;
shared static this() {
runTask({
requestHTTP("http://127.0.0.1:8080",
(scope HTTPClientRequest req) {},
(scope HTTPClientResponse res) {}
);
});
} Double |
Ping |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assertion point - https://github.com/rejectedsoftware/vibe.d/blob/v0.7.26/source/vibe/core/drivers/libevent2_tcp.d#L648
Looks like it happens when connection is actually established but right before dispatching
onSocketEvent
the vibe.d core interrupts the task, throws InterruptException, which is caught here - https://github.com/rejectedsoftware/vibe.d/blob/v0.7.26/source/vibe/core/drivers/libevent2.d#L311.TCPContext
is destroyed and after thatonSocketEvent
called by libevent with wrong context.Such a situation seems very unlikely, but in the real world we are confronted with it every few days.
We use something similar to this code:
The text was updated successfully, but these errors were encountered: