sociomantic-tsunami / libdrizzle-redux

The next generation of Libdrizzle with a simplified API and support for more features of the protocol
Other
13 stars 12 forks source link

Prevent segfault upon running out of addresses #314

Closed tiyash-basu-sociomantic closed 5 years ago

tiyash-basu-sociomantic commented 6 years ago

Previously, addrinfo_next was not checked to be null before de-referencing to get ai_next. This would often result in segfaults.

In this PR, upon running out of addresses (i.e., addrinfo_next == nullptr), getaddrinfo is be called again (via drizzle_state_addrinfo) to refresh the list of addresses.

tiyash-basu-sociomantic commented 6 years ago

Updated to return DRIZZLE_RETURN_COULD_NOT_CONNECT while reading when addrinfo_next == nullptr

andreas-bok-sociomantic commented 5 years ago

Closed as problem was resolved at the user's side

tiyash-basu-sociomantic commented 5 years ago

Closed as problem was resolved at the user's side

This is not resolved with [redacted] yet.

bokchan commented 5 years ago

@tiyash-basu-sociomantic, did you get more details about this from your side?

tiyash-basu-sociomantic commented 5 years ago

@tiyash-basu-sociomantic, did you get more details about this from your side?

I have been using this fix in my tests and have not encountered any segfault so far.

bokchan commented 5 years ago

@tiyash-basu-sociomantic

I have been using this fix in my tests and have not encountered any segfault so far.

Great. I suggest that we do a v6.1.6 patch release as soon as possible. Then subsequently v6.2.0 should soon be ready for release

tiyash-basu-sociomantic commented 5 years ago

Great. I suggest that we do a v6.1.6 patch release as soon as possible. Then subsequently v6.2.0 should soon be ready for release

Absolutely! Please let me know if can help with anything.

bokchan commented 5 years ago

@tiyash-basu-sociomantic could you rebase on v6.1.x?

tiyash-basu-sociomantic commented 5 years ago

@tiyash-basu-sociomantic could you rebase on v6.1.x?

Sure! I'll change the target branch and rebase (the target branch is v6.x.x atm).

Edit: Done!

bokchan commented 5 years ago

@tiyash-basu-sociomantic try to rebase locally on the updated v6.1.x and force push

tiyash-basu-sociomantic commented 5 years ago

@tiyash-basu-sociomantic try to rebase locally on the updated v6.1.x and force push

It's already on v.6.1.x branch, and the diff confirms that. Not sure why this failure happens.

libdrizzle-redux-container | make: *** No rule to make target 'api-sanity-checker'.  Stop.
libdrizzle-redux-container exited with code 2
bokchan commented 5 years ago

It's already on v.6.1.x branch, and the diff confirms that. Not sure why this failure happens.

No a bit strange. I tried to clear the build cache on travis.org and manually start a new build. Hopefully that solves the issue

bokchan commented 5 years ago

Nope. travis is for some reason still using the config file with the api-sanity-checker build. Could you try to do a force-push, just some random whitespace change, to force a new build on travis?

bokchan commented 5 years ago

Yep. Now it is working. Just revert if you did any changes and it is good to go :)

tiyash-basu-sociomantic commented 5 years ago

Yep. Now it is working. Just revert if you did any changes and it is good to go :)

Nice! :) I just made a harmless updated to a comment: Try the next address, if available. => Try the next address, if it is available.

tiyash-basu-sociomantic commented 5 years ago

Thanks!