wmkhoo / taintgrind

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

undefined reference to `is_IRExpr_VECRET_or_GSPTR' #13

Closed vanhauser-thc closed 6 years ago

vanhauser-thc commented 6 years ago

I did:

INST_DIR=`pwd`

curl http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2 | tar xj
cd valgrind-3.12.0
./autogen.sh
./configure --prefix=$INST_DIR
make
make install

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

the make of taintgrind fails for me with:

In file included from tnt_translate.c:28:0:
tnt_translate.c: In function 'do_shadow_Dirty':
tnt_translate.c:4977:50: warning: implicit declaration of function 'is_IRExpr_VECRET_or_GSPTR'; did you mean 'is_IRExpr_VECRET_or_BBPTR'? [-Wimplicit-function-declaration]
       if (d->cee->mcx_mask & (1<<i) || UNLIKELY( is_IRExpr_VECRET_or_GSPTR(arg) ) ) {
                                                  ^
../include/pub_tool_basics.h:433:43: note: in definition of macro 'UNLIKELY'
 #  define UNLIKELY(x) __builtin_expect(!!(x), 0)
...
taintgrind_amd64_linux-tnt_translate.o: In function `checkForBogusLiterals':
/prg/tmp/valgrind-3.12.0/taintgrind/tnt_translate.c:5739: undefined reference to `is_IRExpr_VECRET_or_GSPTR'
taintgrind_amd64_linux-tnt_translate.o: In function `do_shadow_Dirty':
/prg/tmp/valgrind-3.12.0/taintgrind/tnt_translate.c:4977: undefined reference to `is_IRExpr_VECRET_or_GSPTR'
collect2: error: ld returned 1 exit status

I tried an easy fix and included valgrind/libvex_ir.h in tnt_translate.c - which makes it then compile, but running it always abort with the assert: Taintgrind: tnt_translate.c:351 (assignNew): Assertion 'tyE == ty' failed.

so I am stumped how to get this running ...

wmkhoo commented 6 years ago

I did some investigating. valgrind-3.13/libvex_ir.h defines is_IRExpr_VECRET_or_GSPTR(), whereas valgrind-3.12/libvex_ir.h defines is_IRExpr_VECRET_or_BBPTR()

So if you're going with valgrind-3.12, try using is_IRExpr_VECRET_or_BBPTR(). See if that works.

vanhauser-thc commented 6 years ago

thanks a lot!

this seems to work :)

on 3.13 (on a different machine) and 3.12 I hit the same issue afterwards:

valgrind --tool=taintgrind --taint-network=yes -- nc -lnvp 80 Taintgrind: tnt_main.c:3102 (vgTaintgrind_h64_put_t): Assertion 'reg < RI_MAX' failed. but that is from the experimental network taint feature.

however on normal usage it crashes for me as well: valgrind --tool=taintgrind --file-filter='*' -- cat /etc/lsb-release ... Taintgrind: tnt_main.c:3921 (processDescr1): Assertion 'varEnd != NULL' failed.

do you want to me to create extra issues for that?

wmkhoo commented 6 years ago

It'll help me keep track of bugs if you opened new issues for those. Thanks I'm closing this issue then.