llvm::DwarfDebug::NonTypeUnitContext::NonTypeUnitContext(llvm::DwarfDebug *): Assertion `TypeUnitsUnderConstruction.empty() || !DD->AddrPool.hasBeenUsed()' failed.
| Bugzilla Link | 44685 |
| Resolution | FIXED |
| Resolved on | Dec 17, 2020 17:07 |
| Version | trunk |
| OS | Linux |
| Attachments | A reduced code example for reproducing the issue. |
| CC | @dwblaikie,@pogo59,@zygoloid |
Extended Description
Chrome failed to build during linking with thinlto on ChromeOS with the following assertion failure
chromeos-chrome-81.0.4001.0_rc-r1: ld.lld: /var/tmp/portage/sys-devel/llvm-10.0_pre370808_p20191029-r6/work/llvm-10.0_pre370808_p20191029/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2998: llvm::DwarfDebug::NonTypeUnitContext::NonTypeUnitContext(llvm::DwarfDebug *): Assertion `TypeUnitsUnderConstruction.empty() || !DD->AddrPool.hasBeenUsed()' failed.
I've attached a reduced example (repro.cpp). To reproduce, run
$ /path/to/clang++ -c -g -gsplit-dwarf -mllvm -generate-type-units repro.cpp
Sorry I just realized I've never confirmed. It fixed the issue on Chrome OS. Thanks!
Fixed by be3ef93bf58aa5546c7baadfb21d43b75fbb4e24 hopefully.
David, have you had a chance to look at this? If not, I can take a look.
Nah, this hasn't got to the top of my queue yet. More than welcome to have a go :)
Happy to chat (discord, IRC, whatever) if you've questions about how this code is supposed to work, etc.
David, have you had a chance to look at this? If not, I can take a look.
Thank you for the clarification!
Thanks for the reduced test case!
Doesn't seem to be specific to ThinLTO, as shown in the example you've attached.
I trimmed a little off the test case:
extern int foo;
namespace {
template
template <int *> struct S {
struct Inner {
wrap
Inner i; };
S<&foo> s;
& I'll look into a fix soon.