-
Notifications
You must be signed in to change notification settings - Fork 284
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
Segfault on connection close #1452
Comments
Do you have a reproduction case for this? I couldn't directly reproduce it and there are several active connection closes in the test suite, but all seem to pass. |
Hmm, I don't have an isolated one, this is just running our main web app. It happens for example, if the server fails to listen on a port (because it's already in use), or if I CTRL+C while it's listening. This started in 0.7.27, and was also one of the reasons I didn't upgrade then. Basically we spawn a background thread sending HTTPS requests every 15 secs - because of leaks in 0.7.25 we are manually sending header I also tried to debug it myself but there are no callstacks... Here is a full log - maybe it will ring a bell:
Thanks Sönke! |
Also, the other obvious difference from my stable build is that it uses DMD 2.7.x instead of 2.69.2. |
Interesting, so the connection close looks like it's done in a finalizer on program exit. It's really unfortunate that memory operation errors generally don't produce a stack trace. They are extremely involved to debug for that reason. I wonder if the reason for the error appearing is that the |
mysql-lited's |
TCP connection should not crash the program if they are closed from within a finalizer. Instead, give a warning if such a class has leaked.
Okay, some more details: It happens because an assertion is fired due to the event driver already being shut down. I've proposed a fix in #1454, because this case seems rather easy to trigger, but at the same time the application needs to make sure that TCPConnections are not closed in GC finalizers, ideally all connections should be closed explicitly before shutdown (or not at all, letting the OS clean up). The same in theory applies to all other event primitives, they should never be used after |
Nice! I can just safely drop the finalizer for now as it will this seems to fix my case. See my comment on #1454 for additional concerns. |
Did you submit it? Can't see any comment over there. |
TCP connection should not crash the program if they are closed from within a finalizer. Instead, give a warning if such a class has leaked. (cherry picked from commit 2c0adbc)
0.7.28
Ubuntu 64-bit
libevent2
Whenever a connection is closed, logs get spammed with the following forever:
Will stay on 0.7.25 for now
The text was updated successfully, but these errors were encountered: