wmkhoo / taintgrind

A taint-tracking plugin for the Valgrind memory checking tool
GNU General Public License v2.0
247 stars 42 forks source link

error in make: incompatible type for argument 1 of ‘vgPlain_get_fnname’ #19

Closed yasaminmahmoodi closed 6 years ago

yasaminmahmoodi commented 6 years ago

I am trying to build taintgrind. in make and make install steps it gives 2 errors: error: incompatible type for argument 1 of ‘vgPlain_getfnname’ VG(get_fnname)(pc, buf);

error: too few arguments to function ‘vgPlain_get_fnname’

define VG(str) VGAPPEND(vgPlain, str)

wmkhoo commented 6 years ago

May I ask which version of valgrind you're using? Valgrind-3.10 and below defines get_fnname(Addr a,HChar* fnname,Int n_fnname), which has 3 arguments. Valgrind-3.11 and above defines get_fnname(Addr a,const HChar** fnname), which has only 2.

yasaminmahmoodi commented 6 years ago

You are right. Now with latest version of valgrind I could make and install taintgrind. Still another problem. it made exe file of taintgrind-amd64-linux in inst/lib/valgrind. but when I try to use taintgrind tool it give this error: failed to start tool 'taintgrind-amd64-linux' for platform 'amd64-linux': No such file or directory

wmkhoo commented 6 years ago

Can you post the commands you used to make, install and run valgrind and taintgrind? That will help to debug the issue.

yasaminmahmoodi commented 6 years ago

exactly the same as the comment is posted here, ./autogen.sh ./configure --prefix=pwd/inst make && make install for valgrind. and: ../autogen.sh ./configure --prefix=pwd/../inst make && make install for taintgrind

vanhauser-thc commented 6 years ago

My guess is you are executing the wrong binary or your paths are mixed up.

try this to be sure:

wget ftp://sourceware.org/pub/valgrind/valgrind-3.13.0.tar.bz2
tar xjf valgrind-3.13.0.tar.bz2 || exit 1
cd valgrind-3.13.0 || exit 1
INST_DIR=`pwd`
mkdir -p $INST_DIR 2> /dev/null
./autogen.sh
./configure --prefix=$INST_DIR
make
make install

git clone https://github.com/wmkhoo/taintgrind
cd taintgrind
../autogen.sh
./configure --prefix=$INST_DIR
make
make install

cd $INST_DIR/bin
./valgrind -t taintgrind -- ls
yasaminmahmoodi commented 6 years ago

Everything is fine until the end line. But when I type this command: ./valgrind -t taintgrind -- ls, it says command not found

vanhauser-thc commented 6 years ago

then it looks like your valgrind is not compiling. in my bin directory are: callgrind_annotate callgrind_control cg_annotate cg_diff cg_merge ms_print valgrind valgrind-di-server valgrind-listener vgdb

wmkhoo commented 6 years ago

For the last line, instead of ./valgrind -t taintgrind -- ls try ./valgrind --tool=taintgrind -- ls

wmkhoo commented 6 years ago

Closing for now. If there are further related issues, reopen it.