[llvm-bugs] [Bug 45181] New: Assertion `(!CombinedExpr || CombinedExpr->isValid()) && "Combined debug expression is invalid"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 12 02:49:23 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45181

            Bug ID: 45181
           Summary: Assertion `(!CombinedExpr || CombinedExpr->isValid())
                    && "Combined debug expression is invalid"' failed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: david.stenberg at ericsson.com
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

Found by Manoj Gupta.

https://reviews.llvm.org/D73534#1918890

File:

struct type *a(type *, type *, long, long);
enum b {};
static int empty_array(type *, int c) { type *d = a(__null, d, c, c - 1); }
long e;
b f() { empty_array(0, e); }

Command:

$ clang -cc1 -triple x86_64-linux-gnu -emit-obj -disable-free
-mrelocation-model pic -pic-level 2 -pic-is-pie -mthread-model posix
-mframe-pointer=all -mconstructor-aliases -munwind-tables -dwarf-column-info
-debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -O2 -x c++

gives:

clang:
/home/edasten/upstream/monorepo/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:630:
void addToFwdRegWorklist(FwdRegWorklist&, unsigned int, const
llvm::DIExpression*, llvm::ArrayRef<FwdRegParamInfo>): Assertion
`CombinedExpr->isValid() && "Combined debug expression is invalid"' failed.
Stack dump:
0.      Program arguments: ./build/bin/clang -cc1 -triple x86_64-linux-gnu
-emit-obj -disable-free -mrelocation-model pic -pic-level 2 -pic-is-pie
-mthread-model posix -mframe-pointer=all -mconstructor-aliases -munwind-tables
-dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -O2 -x c++ combined.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'combined.c'.
4.      Running pass 'X86 Assembly Printer' on function
'@_ZL11empty_arrayP4typei'

The invalid DIExpression is produced by appending together the following two
expressions:

Expr: !DIExpression(DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_LLVM_convert,
64, DW_ATE_signed, DW_OP_stack_value)
Param.Expr: !DIExpression(DW_OP_constu, 1, DW_OP_minus, DW_OP_LLVM_convert, 32,
DW_ATE_signed, DW_OP_LLVM_convert, 64, DW_ATE_signed, DW_OP_stack_value)

That results in a DW_OP_stack_value being in the middle of a DIExpression,
which is invalid.

The DW_OP_stack_values are added to the expressions due to use of
DIExpression::appendExt() which in turn uses appendToStack(). I don't think
that the describeLoadedValue() hook should return DIExpressions using
DW_OP_stack_value, since that will be used to produce DW_AT_call_values, which
are implicitly stack operations.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200312/c0a6c2ff/attachment-0001.html>


More information about the llvm-bugs mailing list