Discussion:
failed external call
Alexandru Ionut Diaconescu
2013-05-01 11:51:54 UTC
Permalink
Hello everyone,

I am trying to use the taint analysis from the following project:
http://cs.famaf.unc.edu.ar/~rcorin/kleecrypto/ . They have a KLEE program
that is doing taint analysis, it is in the examples folder.

I receive the following KLEE error : *failed external call:
klee_set_pc_taint*. In my entire KLEE "root" folder, klee_set_pc_taint
appears only in their .c program:
*#define TEST(x) { printf("testing " #x " \n"); klee_set_pc_taint(0);
test_##x(); }*
by using the linux command grep -r "klee_set_pc_taint" *
So it is defined only there (not appearing in any header file).

My question is : klee_set_pc_taint is
*1.* their own definition, only in the .c file and it is a problem with the
project program
*2.* It should be defined in the *klee/Release+Asserts/lib* folder, where I
had another problem. I was able to install KLEE, but when I was trying to
run the taint analysis example, it failed requiring for *
klee/Release+Asserts/lib/libkleeRuntimeIntrinsic.bca* , which was not in
the folder. So I renamed the libkleeRuntimeIntrinsic.a file to
libkleeRuntimeIntrinsic.bca and the problem was apparently removed. Maybe
this has any link with their own defined klee_set_pc_taint ? I suppose I
set up good the PATH with llvm-gcc, since I had no problems with building.

Thank for your any advice !
Paul Thomson
2013-05-01 12:00:46 UTC
Permalink
Hi,

If you search the "PATCH OF KLEE"
http://keeda.stanford.edu/pipermail/klee-dev/attachments/20121007/6b3c595b/attachment-0001.obj
for:
add("klee_set_taint"

...you will see that it is handled in
"klee/lib/Core/SpecialFunctionHandler.cpp".

Thanks,
Paul


On 1 May 2013 12:51, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
Hello everyone,
http://cs.famaf.unc.edu.ar/~rcorin/kleecrypto/ . They have a KLEE program
that is doing taint analysis, it is in the examples folder.
klee_set_pc_taint. In my entire KLEE "root" folder, klee_set_pc_taint
#define TEST(x) { printf("testing " #x " \n"); klee_set_pc_taint(0);
test_##x(); }
by using the linux command grep -r "klee_set_pc_taint" *
So it is defined only there (not appearing in any header file).
My question is : klee_set_pc_taint is
1. their own definition, only in the .c file and it is a problem with the
project program
2. It should be defined in the klee/Release+Asserts/lib folder, where I had
another problem. I was able to install KLEE, but when I was trying to run
the taint analysis example, it failed requiring for
klee/Release+Asserts/lib/libkleeRuntimeIntrinsic.bca , which was not in the
folder. So I renamed the libkleeRuntimeIntrinsic.a file to
libkleeRuntimeIntrinsic.bca and the problem was apparently removed. Maybe
this has any link with their own defined klee_set_pc_taint ? I suppose I set
up good the PATH with llvm-gcc, since I had no problems with building.
Thank for your any advice !
_______________________________________________
klee-dev mailing list
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev
Alexandru Ionut Diaconescu
2013-05-01 12:40:21 UTC
Permalink
---------- Forwarded message ----------
From: Alexandru Ionut Diaconescu <alexandruionutdiaconescu-***@public.gmane.org>
Date: Wed, May 1, 2013 at 2:40 PM
Subject: Re: [klee-dev] failed external call
To: Paul Thomson <pault543-***@public.gmane.org>


It seems that the patch is not applying correctly. In their shell script
from http://cs.famaf.unc.edu.ar/~rcorin/kleecrypto/ , where is the part of
applying that patch?

Sorry for asking this question but how can I apply
http://keeda.stanford.edu/pipermail/klee-dev/attachments/20121007/6b3c595b/attachment-0001.obj
patch?
I am a beginner in LLVM.

Thank you kindly !
--
Best regards,
Alexandru Ionut Diaconescu
Alexandru Ionut Diaconescu
2013-05-01 12:42:30 UTC
Permalink
I was trying again to use wget and patch but it seems it doesn't work. I
will look for the warnings received during installation.

Sorry for the beginner questions, I will try to solve it.
Daniel Liew
2013-05-01 12:46:54 UTC
Permalink
You can apply the patch as follows

$ cd klee_root # this is where the include/, lib/ and other folders are
$ patch -p1 < the_patch_to_apply.patch

If you're using git you can also use

$ git apply the_patch_to_apply.patch

I've not tried actually applying the patch so I can't tell you if it
will apply cleanly.


On 1 May 2013 13:42, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
I was trying again to use wget and patch but it seems it doesn't work. I
will look for the warnings received during installation.
Sorry for the beginner questions, I will try to solve it.
Alexandru Ionut Diaconescu
2013-05-01 12:49:00 UTC
Permalink
---------- Forwarded message ----------
From: Alexandru Ionut Diaconescu <alexandruionutdiaconescu-***@public.gmane.org>
Date: Wed, May 1, 2013 at 2:48 PM
Subject: Re: [klee-dev] failed external call
To: Daniel Liew <daniel.liew-AQ/***@public.gmane.org>


Yes, I saw in the script the patch usage and I didn't received any error
during running their script. And still, I have the original KLEE files,
their patch being not applied..
Post by Daniel Liew
You can apply the patch as follows
$ cd klee_root # this is where the include/, lib/ and other folders are
$ patch -p1 < the_patch_to_apply.patch
If you're using git you can also use
$ git apply the_patch_to_apply.patch
I've not tried actually applying the patch so I can't tell you if it
will apply cleanly.
On 1 May 2013 13:42, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
I was trying again to use wget and patch but it seems it doesn't work. I
will look for the warnings received during installation.
Sorry for the beginner questions, I will try to solve it.
--
Best regards,
Alexandru Ionut Diaconescu
--
Best regards,
Alexandru Ionut Diaconescu
Alexandru Ionut Diaconescu
2013-05-01 13:46:39 UTC
Permalink
I started to apply the installation script from the beginning. And KLEE is
not installing anymore, having :

patching file lib/Module/KModule.cpp
patching file tools/klee/main.cpp
*patch unexpectedly ends in middle of line*
Hunk #3 succeeded at 1314 with fuzz 1.
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
...
*configure: error: Unable to use stp/c_interface.h header*
Makefile:15: Makefile.config: No such file or directory
Makefile.common:3: Makefile.config: No such file or directory
Makefile.common:6: /Makefile.config: No such file or directory
Makefile.common:21: /Makefile.rules: No such file or directory
*make: *** No rule to make target `/Makefile.rules'. Stop.*
/home/pc/Desktop/llvm/NEWKLEE
run . ./setenv.sh for setting up the environment
Done. Try:
cd klee/examples/taint
make

In the script from http://cs.famaf.unc.edu.ar/~rcorin/kleecrypto/ , all the
steps from installing KLEE seem to be respected...

On Wed, May 1, 2013 at 2:49 PM, Alexandru Ionut Diaconescu <
Post by Alexandru Ionut Diaconescu
---------- Forwarded message ----------
Date: Wed, May 1, 2013 at 2:48 PM
Subject: Re: [klee-dev] failed external call
Yes, I saw in the script the patch usage and I didn't received any error
during running their script. And still, I have the original KLEE files,
their patch being not applied..
Post by Daniel Liew
You can apply the patch as follows
$ cd klee_root # this is where the include/, lib/ and other folders are
$ patch -p1 < the_patch_to_apply.patch
If you're using git you can also use
$ git apply the_patch_to_apply.patch
I've not tried actually applying the patch so I can't tell you if it
will apply cleanly.
On 1 May 2013 13:42, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
I was trying again to use wget and patch but it seems it doesn't work. I
will look for the warnings received during installation.
Sorry for the beginner questions, I will try to solve it.
--
Best regards,
Alexandru Ionut Diaconescu
--
Best regards,
Alexandru Ionut Diaconescu
--
Best regards,
Alexandru Ionut Diaconescu
Daniel Liew
2013-05-01 14:05:23 UTC
Permalink
I'm not sure your patch is applying cleanly there but the bigger
problem is that the configure step can't find the STP header file
hence nothing can be built.

Take a look at config.log (generated when running configure in the
KLEE directory) for hints about what went wrong but it looks like
configure had trouble with your STP installation (STP is the
constraint solver KLEE uses and it is separate from KLEE).

Given that you've got this far it is probably better to try to do the
rest by hand instead of rerunning the installation script.

1. Check STP built and installed correctly (if you run make again,
make sure you use the arguments used in the script - with the
variables expanded of course)
2. Reperform the configure command for KLEE
3. If the above succeeds you should be able to build KLEE.

I glanced at the patch for KLEE and it doesn't look like it changes
any part of the build system so you could actually build KLEE first
apply the patch and then build again to be sure that the patch did not
break the build.


On 1 May 2013 14:46, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
I started to apply the installation script from the beginning. And KLEE is
patching file lib/Module/KModule.cpp
patching file tools/klee/main.cpp
patch unexpectedly ends in middle of line
Hunk #3 succeeded at 1314 with fuzz 1.
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
...
configure: error: Unable to use stp/c_interface.h header
Makefile:15: Makefile.config: No such file or directory
Makefile.common:3: Makefile.config: No such file or directory
Makefile.common:6: /Makefile.config: No such file or directory
Makefile.common:21: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.
/home/pc/Desktop/llvm/NEWKLEE
run . ./setenv.sh for setting up the environment
cd klee/examples/taint
make
In the script from http://cs.famaf.unc.edu.ar/~rcorin/kleecrypto/ , all the
steps from installing KLEE seem to be respected...
On Wed, May 1, 2013 at 2:49 PM, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
---------- Forwarded message ----------
Date: Wed, May 1, 2013 at 2:48 PM
Subject: Re: [klee-dev] failed external call
Yes, I saw in the script the patch usage and I didn't received any error
during running their script. And still, I have the original KLEE files,
their patch being not applied..
Post by Daniel Liew
You can apply the patch as follows
$ cd klee_root # this is where the include/, lib/ and other folders are
$ patch -p1 < the_patch_to_apply.patch
If you're using git you can also use
$ git apply the_patch_to_apply.patch
I've not tried actually applying the patch so I can't tell you if it
will apply cleanly.
On 1 May 2013 13:42, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
I was trying again to use wget and patch but it seems it doesn't work. I
will look for the warnings received during installation.
Sorry for the beginner questions, I will try to solve it.
--
Best regards,
Alexandru Ionut Diaconescu
--
Best regards,
Alexandru Ionut Diaconescu
--
Best regards,
Alexandru Ionut Diaconescu
Alexandru Ionut Diaconescu
2013-05-01 14:49:58 UTC
Permalink
Yes, that's why I was afraid for, the patch breaking the build. thank you a
lot for the detailed information !

I will try and hope it works
Post by Daniel Liew
I'm not sure your patch is applying cleanly there but the bigger
problem is that the configure step can't find the STP header file
hence nothing can be built.
Take a look at config.log (generated when running configure in the
KLEE directory) for hints about what went wrong but it looks like
configure had trouble with your STP installation (STP is the
constraint solver KLEE uses and it is separate from KLEE).
Given that you've got this far it is probably better to try to do the
rest by hand instead of rerunning the installation script.
1. Check STP built and installed correctly (if you run make again,
make sure you use the arguments used in the script - with the
variables expanded of course)
2. Reperform the configure command for KLEE
3. If the above succeeds you should be able to build KLEE.
I glanced at the patch for KLEE and it doesn't look like it changes
any part of the build system so you could actually build KLEE first
apply the patch and then build again to be sure that the patch did not
break the build.
On 1 May 2013 14:46, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
I started to apply the installation script from the beginning. And KLEE
is
Post by Alexandru Ionut Diaconescu
patching file lib/Module/KModule.cpp
patching file tools/klee/main.cpp
patch unexpectedly ends in middle of line
Hunk #3 succeeded at 1314 with fuzz 1.
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
...
configure: error: Unable to use stp/c_interface.h header
Makefile:15: Makefile.config: No such file or directory
Makefile.common:3: Makefile.config: No such file or directory
Makefile.common:6: /Makefile.config: No such file or directory
Makefile.common:21: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.
/home/pc/Desktop/llvm/NEWKLEE
run . ./setenv.sh for setting up the environment
cd klee/examples/taint
make
In the script from http://cs.famaf.unc.edu.ar/~rcorin/kleecrypto/ , all
the
Post by Alexandru Ionut Diaconescu
steps from installing KLEE seem to be respected...
On Wed, May 1, 2013 at 2:49 PM, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
---------- Forwarded message ----------
Date: Wed, May 1, 2013 at 2:48 PM
Subject: Re: [klee-dev] failed external call
Yes, I saw in the script the patch usage and I didn't received any error
during running their script. And still, I have the original KLEE files,
their patch being not applied..
Post by Daniel Liew
You can apply the patch as follows
$ cd klee_root # this is where the include/, lib/ and other folders are
$ patch -p1 < the_patch_to_apply.patch
If you're using git you can also use
$ git apply the_patch_to_apply.patch
I've not tried actually applying the patch so I can't tell you if it
will apply cleanly.
On 1 May 2013 13:42, Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
I was trying again to use wget and patch but it seems it doesn't
work.
Post by Alexandru Ionut Diaconescu
Post by Alexandru Ionut Diaconescu
Post by Daniel Liew
Post by Alexandru Ionut Diaconescu
I
will look for the warnings received during installation.
Sorry for the beginner questions, I will try to solve it.
--
Best regards,
Alexandru Ionut Diaconescu
--
Best regards,
Alexandru Ionut Diaconescu
--
Best regards,
Alexandru Ionut Diaconescu
--
Best regards,
Alexandru Ionut Diaconescu
Continue reading on narkive:
Loading...