[DynInst_API:] Boost assertion when calling BPatch_point.isDynamic()


Date: Mon, 19 Oct 2015 13:44:45 -0700
From: Victor van der Veen <vvdveen@xxxxxxxxx>
Subject: [DynInst_API:] Boost assertion when calling BPatch_point.isDynamic()
Hi,

We found that on Dyninst 9.0.3, a call to BPatch_point.isDynamic() could trigger a boost assertion error:

/usr/include/boost/smart_ptr/shared_ptr.hpp:653: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = Dyninst::InstructionAPI::_expression_; typename boost::detail::sp_member_access<T>::type = Dyninst::InstructionAPI::_expression_*]: Assertion `px != 0' failed

It seems that the following patch fixes this:

--- DyninstAPI-9.0.3.orig/patchAPI/src/PatchBlock.CÂÂÂ 2015-08-26 09:13:07.000000000 -0700
+++ DyninstAPI-9.0.3/patchAPI/src/PatchBlock.CÂÂÂ 2015-10-19 13:36:34.297722647 -0700
@@ -249,6 +249,10 @@
ÂÂÂÂÂÂÂÂÂÂÂÂÂ } else { // check for register indirect
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ set<InstructionAST::Ptr> regs;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ _expression_::Ptr tExpr = insn->getControlFlowTarget();
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (!tExpr) {
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ return false;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
+
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ tExpr->getUses(regs);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ for (set<InstructionAST::Ptr>::iterator rit = regs.begin();
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ rit != regs.end(); rit++)


With kind regards,
Victor van der Veen
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] Boost assertion when calling BPatch_point.isDynamic(), Victor van der Veen <=