<div dir="ltr"><div>This is probably the same failure we've been seeing here:</div><div><br></div><a href="http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/4124/console" target="_blank">http://green.lab.llvm.org/green/job/clang-stage2-coverage-R/4124/console</a><br><div><br></div><div>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></div><div><br></div><div><div>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.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2019 at 6:41 AM Brian Gesiak via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</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">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>