<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 26, 2016, at 1:13 PM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">IOW, marking it =delete() is no different than deleting the copy constructor above, but at least if you mark it delete, maybe someone will read the comment above it that explains why it's deleted :)</div></div></blockquote><div><br class=""></div>Got it, make sense.</div><div><br class=""></div><div>Thanks.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Aug 26, 2016 at 1:13 PM Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">I think so.  But in this case lldb::Address explicitly supplied a copy constructor that looked like this:<div class=""><br class=""></div><div class=""><div class="">    Address (const Address& rhs) :</div><div class="">        m_section_wp (rhs.m_section_wp),</div><div class="">        m_offset(rhs.m_offset.load())   // this is the std::atomic<></div><div class="">    {</div><div class="">    }</div></div><div class=""><br class=""></div><div class="">circumventing the problem.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Aug 26, 2016 at 1:11 PM Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 26, 2016, at 1:02 PM, Zachary Turner via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="m_1910360998722601880m_-5322755542700423481Apple-interchange-newline"><div class=""><div dir="ltr" class="">It seems to be.  I will also make the copy constructor =delete() to make sure this cannot happen again.</div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class="">Just curious: if a member has a deleted copy-ctor (like std::atomic right?), isn’t the copy constructor automatically deleted?</div><div class=""><br class=""></div><div class="">— </div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class="">Mehdi</div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">I'm still concerned that the std::atomic is unnecessary, but at that point at least it just becomes a performance problem and not a bug.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Aug 26, 2016 at 1:00 PM Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank" class="">gclayton@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So after speaking with local experts on the subject, we do indeed have a problem. Please convert all placed where we pass lldb_private::Address by value to pass by "const Address &". Anyone that is modifying the address should make a local copy and work with that.<br class="">
<br class="">
Is Address the only class that is causing problems?<br class="">
<br class="">
Greg<br class="">
<br class="">
> On Aug 26, 2016, at 10:51 AM, Zachary Turner via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class="">
><br class="">
> I recently updated to Visual Studio 2015 Update 3, which has improved its diagnostics.  As a result of this, LLDB is uncompilable due to a slew of errors of the following nature:<br class="">
><br class="">
> D:\src\llvm\tools\lldb\include\lldb/Target/Process.h(3256): error C2719: 'default_stop_addr': formal parameter with requested alignment of 8 won't be aligned<br class="">
><br class="">
> The issue comes down to the fact that lldb::Address contains a std::atomic<uint64_t>, and is being passed by value pervasively throughout the codebase.  There is no way to guarantee that this value is 8 byte aligned.  This has always been a bug, but until now the compiler just hasn't been reporting it.<br class="">
><br class="">
> Someone correct me if I'm wrong, but I believe this is a problem on any 32-bit platform, and MSVC is just the only one erroring.<br class="">
><br class="">
> I'm not really sure what to do about this.  Passing std::atomic<uint64>'s by value seems wrong to me.<br class="">
><br class="">
> Looking at the code, I don't even know why it needs to be atomic.  It's not even being used safely.  We'll have a single function write the value and later read the value, even though it could have been used in the meantime.  Maybe what is really intended is a mutex.  Or maybe it doesn't need to be atomic in the first place.<br class="">
><br class="">
> Does anyone have a suggestion on what to do about this?  I'm currently blocked on this as I can't compile LLDB.<br class="">
> _______________________________________________<br class="">
> lldb-dev mailing list<br class="">
> <a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a><br class="">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class="">
<br class="">
</blockquote></div>
_______________________________________________<br class="">lldb-dev mailing list<br class=""><a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class=""></div></blockquote></div></div></blockquote></div></blockquote></div>
</div></blockquote></div><br class=""></body></html>