<div dir="ltr"><br><br><br><div class="gmail_quote"><div dir="ltr">On Thu, 8 Mar 2018 at 02:46, Davide Italiano <<a href="mailto:dccitaliano@gmail.com">dccitaliano@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Mar 7, 2018 at 6:39 PM, Jim Ingham <<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>> wrote:<br>
> The hashing algorithm gives different values - at least for foobár - between the two implementations.  So if you build with an older clang, and test with a new lldb, the type lookup fails.<br>
><br></blockquote><div>When I landed this patch, the two algorithms were identical, but this wasn't always the case. The llvm's version of the algorithm used to be nondeterministic (as in, it's result depended on the signedness of char on your platform). This was recently fixed, and this patch was meant to make sure they always stay in sync.</div><div><br></div><div>We considered a couple of options when we noticed this discrepancy, but since this had never really worked (llvm and lldb had always disagreed on the hash value of strings with high bit set) and nobody noticed, we decided to just fix the llvm implementation. The other option was to create a signedDJBHash function, and make lldb&llvm always use that for apple accelerator tables. I guess it's still not too late to do that....</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
This is not my case, I think? I'm building from the monorepo so clang<br>
and lldb are supposed to be in sync (in fact, the version of clang in<br>
my test is 7.0).<br><br></blockquote><div><br></div><div>My best (and only) guess would be that this is because of different versions of dsymutil (we are using the system dsymutil to build the dsym bundle), though I'm not sure then why the test doesn't fail for me as well, as I have the stock dsymutil that ships which XCode, which presumably still has the broken hash function.</div><div><br></div><div>Could you send me the main.o and a.out.dSYM files that are built by this test (or at least the output of running llvm-dwarfdump -apple-types on them), so I can compare them with mine? The interesting question is what does "foobár" hash to (for me it's 0xba721fe1 in both files).</div><div><br></div><div><br></div><div> </div></div></div>