passlab / DCFG

Dynamic ControlFlow Graph and DataFlow Graph for Binary-based Optimization
18 stars 4 forks source link

Compilation Error #1

Open iamdeeban opened 4 years ago

iamdeeban commented 4 years ago

I downloaded the DCFG to visualize CFG of a particular binary in DOT format. I think I have already installed the dyninst and the dynamic libraries successfully. However, I still come across the following compilation problem

angr@BinWorks:~/Desktop/dyninst-install/dyninst_CFG$ make
[ 25%] Building CXX object CMakeFiles/CFG.dir/CFG.cpp.o
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp: In function ‘void PrintBlockInfo(Dyninst::ParseAPI::Block*)’:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: error: no match for ‘operator=’ (operand types are ‘Dyninst::InstructionAPI::Instruction::Ptr {aka boost::shared_ptr<Dyninst::InstructionAPI::Instruction>}’ and ‘Dyninst::InstructionAPI::Instruction’)
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:524:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<T>&) [with T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr const & r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:524:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘const boost::shared_ptr<Dyninst::InstructionAPI::Instruction>&’
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:533:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<Y>&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=(shared_ptr<Y> const & r) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:533:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘const boost::shared_ptr<X>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:544:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::auto_ptr<Y> & r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:544:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::auto_ptr<Y>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:553:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::auto_ptr<Y> && r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:553:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::auto_ptr<Y>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:575:18: note: candidate: template<class Y, class D> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::unique_ptr<_Up, _Ep>&&) [with Y = Y; D = D; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::unique_ptr<Y, D> && r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:575:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::unique_ptr<_Tp, _Dp>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:584:18: note: candidate: template<class Y, class D> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::movelib::unique_ptr<Y, D>) [with Y = Y; D = D; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:584:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘boost::movelib::unique_ptr<Y, D>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:632:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::shared_ptr<T>&&) [with T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr && r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:632:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘boost::shared_ptr<Dyninst::InstructionAPI::Instruction>&&’
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:639:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::shared_ptr<Y>&&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr<Y> && r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:639:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘boost::shared_ptr<X>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:649:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::detail::sp_nullptr_t) [with T = Dyninst::InstructionAPI::Instruction; boost::detail::sp_nullptr_t = std::nullptr_t]
     shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT // never throws
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:649:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘boost::detail::sp_nullptr_t {aka std::nullptr_t}’
CMakeFiles/CFG.dir/build.make:62: recipe for target 'CMakeFiles/CFG.dir/CFG.cpp.o' failed
make[2]: *** [CMakeFiles/CFG.dir/CFG.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/CFG.dir/all' failed
make[1]: *** [CMakeFiles/CFG.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I am new to dyninst. Am I missing any library? does anyone know the reason? Thanks!

yanyh15 commented 4 years ago

The whole repo and work have not been updated. From our error msg, it is likely versioning if you are using different version of Boost, gcc/g++.

iamdeeban commented 4 years ago

Thank you. I am using boost 1.65. What version would you suggest based on the code you developed and tested earlier?

1Husin-Alhaj commented 3 years ago

I have faced with the same error!! .. and here I do not see any solution or suggestion from the authors. Please tell us what is the best version of boost to be used with the CFG Tool.