Martin J. O'Riordan via llvm-dev
2017-Sep-25 14:55 UTC
[llvm-dev] Assertion in 'DwarfDebug.cpp'
Since updating to the LLVM v5.0 Final tag, I am seeing a crash when I enable '-g'. With a Debug build this hits an assertion at line #923 in 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp': assert(EndLabel && "Forgot label after instruction ending a range!"); The values of related variables at this time are: 'Begin' is: DBG_VALUE %I23, %noreg, !"fp", <!345>; line no:381 'End' is: DBG_VALUE %I19, 88, !"ap", <!345>; line no:381 indirect 'StartLabel' is: .Ltmp327 'I19' is the stack-pointer, and it is the expression 'EndLabel getLabelAfterInsn(End)' that is returning 'nullptr'. This happens only when compiling 'vfprintf.c' or 'vfwprintf.c' from Newlib v2.5.0, and line #381 referenced is the location of the declaration of the function '_vfwprintf_r'. But our implementation does not directly do anything with Dwarf meta-data, so I don't understand what we could be doing that would cause this. Has this been seen before, and any suggestions on how I should debug this? Thanks, MartinO -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170925/86a946c5/attachment.html>
Robinson, Paul via llvm-dev
2017-Sep-25 17:44 UTC
[llvm-dev] Assertion in 'DwarfDebug.cpp'
Here are a couple things I would try to help triangulate on the problem. Try a vanilla upstream compiler for an in-tree target. (IIRC you have your own target.) If that fails, it's pretty optimal for you because you should be able to reduce a test case and file a PR. If it doesn't fail, that suggests it's either something your target does or doesn't do, or some bug in how you've done your adaptation to LLVM 5.0. You can also try compiling with -S and assembling the result; I have seen that behave differently from direct object generation sometimes. If that's the case here, it should be not terribly hard to work out how the paths are different. Good luck, --paulr From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Martin J. O'Riordan via llvm-dev Sent: Monday, September 25, 2017 7:56 AM To: 'LLVM Developers' Subject: [llvm-dev] Assertion in 'DwarfDebug.cpp' Since updating to the LLVM v5.0 Final tag, I am seeing a crash when I enable '-g'. With a Debug build this hits an assertion at line #923 in 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp': assert(EndLabel && "Forgot label after instruction ending a range!"); The values of related variables at this time are: 'Begin' is: DBG_VALUE %I23, %noreg, !"fp", <!345>; line no:381 'End' is: DBG_VALUE %I19, 88, !"ap", <!345>; line no:381 indirect 'StartLabel' is: .Ltmp327 'I19' is the stack-pointer, and it is the expression 'EndLabel = getLabelAfterInsn(End)' that is returning 'nullptr'. This happens only when compiling 'vfprintf.c' or 'vfwprintf.c' from Newlib v2.5.0, and line #381 referenced is the location of the declaration of the function '_vfwprintf_r'. But our implementation does not directly do anything with Dwarf meta-data, so I don't understand what we could be doing that would cause this. Has this been seen before, and any suggestions on how I should debug this? Thanks, MartinO -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170925/4b67c820/attachment.html>
Martin J. O'Riordan via llvm-dev
2017-Sep-25 19:40 UTC
[llvm-dev] Assertion in 'DwarfDebug.cpp'
Thanks Paul, Actually in my case (out of tree) I always compile to assembly. It does appear to crash only when my target is selected, I build the compiler with multiple targets enabled, and it does not crash for the other in-tree targets even with the same compiler binary. Strange, I can't think of anywhere in my target that handle debug information explicitly. Have to roll my sleeves up and go hunting ;-) MartinO From: Robinson, Paul [mailto:paul.robinson at sony.com] Sent: 25 September 2017 18:44 To: Martin J. O'Riordan <MartinO at theheart.ie> Cc: llvm-dev at lists.llvm.org Subject: RE: [llvm-dev] Assertion in 'DwarfDebug.cpp' Here are a couple things I would try to help triangulate on the problem. Try a vanilla upstream compiler for an in-tree target. (IIRC you have your own target.) If that fails, it's pretty optimal for you because you should be able to reduce a test case and file a PR. If it doesn't fail, that suggests it's either something your target does or doesn't do, or some bug in how you've done your adaptation to LLVM 5.0. You can also try compiling with -S and assembling the result; I have seen that behave differently from direct object generation sometimes. If that's the case here, it should be not terribly hard to work out how the paths are different. Good luck, --paulr From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Martin J. O'Riordan via llvm-dev Sent: Monday, September 25, 2017 7:56 AM To: 'LLVM Developers' Subject: [llvm-dev] Assertion in 'DwarfDebug.cpp' Since updating to the LLVM v5.0 Final tag, I am seeing a crash when I enable '-g'. With a Debug build this hits an assertion at line #923 in 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp': assert(EndLabel && "Forgot label after instruction ending a range!"); The values of related variables at this time are: 'Begin' is: DBG_VALUE %I23, %noreg, !"fp", <!345>; line no:381 'End' is: DBG_VALUE %I19, 88, !"ap", <!345>; line no:381 indirect 'StartLabel' is: .Ltmp327 'I19' is the stack-pointer, and it is the expression 'EndLabel getLabelAfterInsn(End)' that is returning 'nullptr'. This happens only when compiling 'vfprintf.c' or 'vfwprintf.c' from Newlib v2.5.0, and line #381 referenced is the location of the declaration of the function '_vfwprintf_r'. But our implementation does not directly do anything with Dwarf meta-data, so I don't understand what we could be doing that would cause this. Has this been seen before, and any suggestions on how I should debug this? Thanks, MartinO -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170925/9c93ca0e/attachment.html>
Possibly Parallel Threads
- Assertion in 'DwarfDebug.cpp'
- Semantics for non-byte-sized stores? (or whenever "store size in bits" is different than "size in bits")
- How Aggegate Data in R
- [LLVMdev] Two labels around one instruction in Codegen
- [LLVMdev] Two labels around one instruction in Codegen