这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Frick
Copy link
Contributor

@Frick Frick commented Aug 23, 2013

We were receiving segfaults regularly on reload, and I finally tracked it down to this line. A coworker, Jason, figured it had something to do with the fact that the hints' addrinfo struct wasn't complete (and doesn't need to be) and therefore who knows what's going on in freeaddrinfo(), but it wasn't happy. So we zeroed out hints (doesn't seem to matter where - anywhere between the malloc() and freeaddrinfo() works) and sure enough, the segfaults stopped.

@Frick
Copy link
Contributor Author

Frick commented Aug 23, 2013

Looking into it even further, hunch seems to be right... we're allocating memory for the hints addrinfo struct, but it's not empty memory (at least in the case of the segfaults). So within freeaddrinfo it is attempting to free addrinfo->ai_canonname and addrinfo->ai_addr if they are not null. When it's not null and it was never set, things go south...

@jib
Copy link
Owner

jib commented Sep 5, 2013

Thanks for this pull request - I added a bit of documentation to it (and added some improved diagnostics while I was in there), which is covered in #6. This has been pulled into master.

@jib
Copy link
Owner

jib commented Jan 17, 2014

@Frick, @savar, this should be all addressed with #6, so closing this pull request.

Please comment/reopen if needed, thanks!

@jib jib closed this Jan 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants