Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

bugpoint crashes after it breaks debug info #4746

Open Quuxplusone opened 15 years ago

Quuxplusone commented 15 years ago
Bugzilla Link PR4255
Status NEW
Importance P normal
Reported by Török Edwin (edwin+bugs@etorok.eu)
Reported on 2009-05-24 03:55:29 -0700
Last modified on 2019-09-06 06:31:08 -0700
Version trunk
Hardware PC Linux
CC anton@korobeynikov.info, devang.patel@gmail.com, efriedma@quicinc.com, kuba.staszak@gmail.com, llvm-bugs@lists.llvm.org, nicholas@mxc.ca
Fixed by commit(s)
Attachments ginit.bc (664 bytes, application/octet-stream)
Blocks
Blocked by
See also
$ opt bugpoint-reduced-simplified.bc -inline -scalarrepl
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

opt: /home/edwin/llvm-svn/llvm/include/llvm/GlobalVariable.h:99:
llvm::Constant* llvm::GlobalVariable::getInitializer(): Assertion
`hasInitializer() && "GV doesn't have initializer!"' failed.
0   opt 0x084ce4e8
Stack dump:
0.      Running pass 'CallGraph Pass Manager' on module 'bugpoint-reduced-
simplified.bc'.
Aborted
Quuxplusone commented 15 years ago

Attached ginit.bc (664 bytes, application/octet-stream): bugpoint-reduced-simplified.bc

Quuxplusone commented 15 years ago

I'm tempted to say bugpoint is at fault here; we don't have a debug info verifier, but it appears the debug info is invalid.

Quuxplusone commented 15 years ago
Subregion is external, thus DbgGV->hasInitializer() = false (DebugInfo.cpp:108)
which makes that TAG is improper (0 != RequiredTag(46)).

In DIDescriptor::DIDescriptor (DebugInfo.cpp) we can see the condition:
  82   if (GV && getTag() != RequiredTag)
  83     DbgGV = 0;

which makes isNull() = true.
Quuxplusone commented 15 years ago

Is this still a problem with the mdnodification of debug info?

Quuxplusone commented 15 years ago
(In reply to comment #4)
> Is this still a problem with the mdnodification of debug info?
>

No in the sense that bugpoint doesn't remove metadata and leave the dbginst
behind, Yes in the sense that the attached malformed .bc still crashes opt.

opt -verify doesn't catch that this is an invalid.bc, and opt -inline still
crashes on that malformed .bc:

opt: /home/edwin/llvm2.6/llvm-2.6/lib/Transforms/Utils/InlineFunction.cpp:218:
const llvm::DbgRegionEndInst* findFnRegionEndMarker(const llvm::Function*):
Assertion `SP.isNull() == false && "Invalid llvm.dbg.func.start"' failed.