<div dir="ltr">I believe you are correct. We should create an in_addr on the stack and memcpy into it.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 13, 2016 at 10:52 AM Ted Woodward via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72" class="gmail_msg"><div class="m_689384165608567355WordSection1 gmail_msg"><p class="MsoNormal gmail_msg">TCPSocket::Connect has this line:<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"> host_str = ::inet_ntoa (*(struct in_addr *)*host_entry->h_addr_list);<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">host_entry->h_addr_list is a char**, while struct in_addr contains a uint32_t. Casting like this (char * to uint_32t *) could cause a bus error on systems that don’t allow non-aligned loads. I think we need to memcpy the data into a struct in_addr variable.<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">Anyone have any thoughts on this?<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">--<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">Qualcomm Innovation Center, Inc.<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p></div></div>_______________________________________________<br class="gmail_msg">
lldb-dev mailing list<br class="gmail_msg">
<a href="mailto:lldb-dev@lists.llvm.org" class="gmail_msg" target="_blank">lldb-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class="gmail_msg">
</blockquote></div>