<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Tue, Jul 30, 2019 at 7:53 AM Brian Gesiak <<a href="mailto:modocache@gmail.com">modocache@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Thank you for the link and the suggestion to try master! I did so and<br>
discovered that it reproduces on master for me as well. The repro<br>
script I used (unchanged from before) and the output can be found<br>
here: <a href="https://gist.github.com/modocache/d9700166067f4a155820bc57d9bee1f3" rel="noreferrer" target="_blank">https://gist.github.com/modocache/d9700166067f4a155820bc57d9bee1f3</a><br>
<br>
(Note that the output looks nearly identical, but it's using clang-10<br>
from the master branch of llvm-project.)<br>
<br>
I wonder why the buildbots would begin passing again, whereas locally<br>
the issue reproduces... very strange. Looking at the CMake invocation<br>
in the build logs that Akira linked to, I can see that<br>
'-DLLVM_ENABLE_MODULES=On' is being used. Could it be one of the other<br>
options is masking the error I'm seeing on master?<br>
<br></blockquote><div><br></div><div>Sorry, I didn't notice that someone had disabled modules by passing '-DLLVM_ENABLE_MODULES=Off' to cmake. I think that's why we haven't seen the failure since July 19th.</div><div> </div><div><a href="http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/4172/consoleText">http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/4172/consoleText</a><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
- Brian Gesiak<br>
<br>
On Mon, Jul 29, 2019 at 1:51 PM Akira Hatanaka <<a href="mailto:ahatanak@gmail.com" target="_blank">ahatanak@gmail.com</a>> wrote:<br>
><br>
> This is probably the same failure we've been seeing here:<br>
><br>
> <a href="http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/4124/console" rel="noreferrer" target="_blank">http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/4124/console</a><br>
><br>
> But it looks like the bot has turned green since July 19th, so I'm wondering whether you are still seeing the same failure if you use trunk?<br>
><br>
> If I remember correctly, there was a MemberExpr node in the AST that was referencing the anonymous union in class Expected, but the parent class (class Expected) didn't contain the AST node for the anonymous union.<br>
><br>
> On Mon, Jul 29, 2019 at 6:41 AM Brian Gesiak via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> I ran into an LLVM/Clang crash when attempting to do the following:<br>
>><br>
>> 1. Build Clang from the release/9.x branch source.<br>
>> 2. Use the Clang from (1) to build clangd on the release/9.x branch,<br>
>> with LLVM_ENABLE_MODULES=On.<br>
>><br>
>> I wrote a script to reproduce the crash:<br>
>> <a href="https://gist.github.com/modocache/ac366ca9673b93bb21e75d3e72162608" rel="noreferrer" target="_blank">https://gist.github.com/modocache/ac366ca9673b93bb21e75d3e72162608</a><br>
>><br>
>> At the above URL, you'll find a script `repro.sh` that reproduces the<br>
>> crash, and a file `out.txt` that contains the build output and the<br>
>> stack trace.<br>
>><br>
>> I used the script to bisect, and bisect determined the first "bad" commit was:<br>
>> <a href="https://github.com/llvm/llvm-project/commit/baae41ff76f662987f31447686ba819dcd748b3f" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/baae41ff76f662987f31447686ba819dcd748b3f</a><br>
>><br>
>> The stack trace appears to crash when generating code for an<br>
>> `llvm::Expected` declaration, and the commit above seems to add a few<br>
>> of them, so that seems suspicious. The stack trace is in the GitHub<br>
>> gist URL above, but I'll also paste the relevant portion here:<br>
>><br>
>> ```<br>
>> Stack dump:<br>
>> 0. Program arguments: ...<br>
>> 1. <eof> parser at end of file<br>
>> 2. Per-file LLVM IR generation<br>
>> 3. /home/modocache/Source/llvm/git/dev/llvm-project/llvm/include/llvm/Support/Error.h:625:17:<br>
>> Generating code for declaration<br>
>> 'llvm::Expected<std::__cxx11::basic_string<char> >::getStorage'<br>
>> /home/modocache/Source/llvm/git/dev/build-s1/bin/clang-9(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x2a)[0x557bc131549a]<br>
>> /home/modocache/Source/llvm/git/dev/build-s1/bin/clang-9(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x557bc13131b4]<br>
>> /home/modocache/Source/llvm/git/dev/build-s1/bin/clang-9(+0x1649335)[0x557bc1313335]<br>
>> /lib/x86_64-linux-gnu/libpthread.so.0(+0x13f40)[0x7f3bc780af40]<br>
>> /home/modocache/Source/llvm/git/dev/build-s1/bin/clang-9(_ZN5clang7CodeGen15CodeGenFunction18EmitLValueForFieldENS0_6LValueEPKNS_9FieldDeclE+0x8ad)[0x557bc1749abd]<br>
>> ```<br>
>><br>
>> I have an immediate workaround -- I can turn off LLVM_ENABLE_MODULES,<br>
>> and the crash goes away. However, I think it might be worth looking<br>
>> into the commit above and determining why it crashes when using<br>
>> `-fmodules`. At first glance, I don't see the problem, but I've cc'ed<br>
>> the author, in case they might know more.<br>
>><br>
>> Does anyone have any ideas on how to fix the underlying crash?<br>
>><br>
>> - Brian Gesiak<br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div></div></div>