wmkhoo / taintgrind

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

I met a error in vgTaintgrind_get_fnname when building taintgrind in docker. #23

Closed JodieAllen closed 6 years ago

JodieAllen commented 6 years ago

Hi, I used following commands to build taintgrind in docker.

~$ git clone http://github.com/wmkhoo/taintgrind
~$ cd taintgrind 
~/taintgrind$ docker build -t taintgrind .

However, I met a error in function 'vgTaintgrind_get_fnname', the error log as following:

tnt_syswrap.c: In function 'vgTaintgrind_get_fnname':
tnt_syswrap.c:408:12: error: unknown type name 'DiEpoch'
            DiEpoch  ep = VG_(current_DiEpoch)();
            ^~~~~~~
In file included from tnt_syswrap.c:29:0:
../include/pub_tool_basics.h:70:30: warning: implicit declaration of function 'vgPlain_current_DiEpoch'; did you mean 'vgPlain_client_fname'? [-Wimplicit-function-declaration]
 #define VG_(str)    VGAPPEND(vgPlain_,          str)
                              ^
../include/pub_tool_basics.h:68:29: note: in definition of macro 'VGAPPEND'
 #define VGAPPEND(str1,str2) str1##str2
                             ^~~~
tnt_syswrap.c:408:26: note: in expansion of macro 'VG_'
            DiEpoch  ep = VG_(current_DiEpoch)();
                          ^~~
tnt_syswrap.c:409:25: warning: passing argument 2 of 'vgPlain_get_fnname' makes pointer from integer without a cast [-Wint-conversion]
     VG_(get_fnname)(ep, pc, buf);
                         ^~
In file included from tnt_syswrap.c:29:0:
../include/pub_tool_basics.h:70:30: note: expected 'const HChar ** {aka const char **}' but argument is of type 'UInt {aka unsigned int}'
 #define VG_(str)    VGAPPEND(vgPlain_,          str)
                              ^
../include/pub_tool_basics.h:68:29: note: in definition of macro 'VGAPPEND'
 #define VGAPPEND(str1,str2) str1##str2
                             ^~~~
../include/pub_tool_debuginfo.h:80:13: note: in expansion of macro 'VG_'
 extern Bool VG_(get_fnname)   ( Addr a, const HChar** fnname );
             ^~~
../include/pub_tool_basics.h:70:30: error: too many arguments to function 'vgPlain_get_fnname'
 #define VG_(str)    VGAPPEND(vgPlain_,          str)
                              ^
../include/pub_tool_basics.h:68:29: note: in definition of macro 'VGAPPEND'
 #define VGAPPEND(str1,str2) str1##str2
                             ^~~~
tnt_syswrap.c:409:5: note: in expansion of macro 'VG_'
     VG_(get_fnname)(ep, pc, buf);
     ^~~
../include/pub_tool_basics.h:70:30: note: declared here
 #define VG_(str)    VGAPPEND(vgPlain_,          str)
                              ^
../include/pub_tool_basics.h:68:29: note: in definition of macro 'VGAPPEND'
 #define VGAPPEND(str1,str2) str1##str2
                             ^~~~
../include/pub_tool_debuginfo.h:80:13: note: in expansion of macro 'VG_'
 extern Bool VG_(get_fnname)   ( Addr a, const HChar** fnname );
             ^~~
Makefile:1041: recipe for target 'taintgrind_amd64_linux-tnt_syswrap.o' failed.

Can you give me some advices how to solve this problem? Thanks a lot! Have a nice day!

wmkhoo commented 6 years ago

Thanks for the bug report. Please see if this patch fixes the issue.

JodieAllen commented 6 years ago

Thanks for replying. The patch works well and I have built taintgrind successfully.

PriyankaPanigrahi commented 5 years ago

I am getting the same error when I run 'make' command to build taintgrind. Can you give me some advice how to solve this problem? Advance thank you. Good day !