Re: [klee-dev] -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LP64

2017-07-08 Thread Nourah mmm
Hi,
Sorry to bother you again.  After using make and wllvm, KLEE stopped
working
and it generated this error:

 myklee --emit-all-errors --allow-external-sym-calls  --optimize
--libc=uclibc --posix-runtime --max-memory=1000 ./hmmer.bc
'/home/naloboud/SpecCPU2006/cpu2006/benchspec/CPU2006/456.hmmer/data/test/input/bombesin.hmm'
KLEE: NOTE: Using klee-uclibc :
/home/naloboud/klee/Release+Asserts/lib/klee-uclibc.bca
KLEE: NOTE: Using model:
/home/naloboud/klee/Release+Asserts/lib/libkleeRuntimePOSIX.bca
KLEE: output directory is
"/home/naloboud/klee/examples/hammer2_make/./klee-out-1"
Using STP solver backend
Terminator found in the middle of a basic block!
label %34
Broken module found, compilation aborted!
0  klee0x00cdc1d5 llvm::sys::PrintStackTrace(_IO_FILE*)
+ 37
1  klee0x00cdc61f
2  libpthread.so.0 0x7f2edccc4390
3  libc.so.6   0x7f2eda88a428 gsignal + 56
4  libc.so.6   0x7f2eda88c02a abort + 362
5  klee0x00c9750d
6  klee0x00c97331
7  klee0x00c7b863
llvm::FPPassManager::runOnFunction(llvm::Function&) + 547
8  klee0x00c7ba2b
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
9  klee0x00c7be3e
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 782
10 klee0x005a469c llvm::Optimize(llvm::Module*,
std::__cxx11::basic_string<char, std::char_traits,
std::allocator > const&) + 236
11 klee0x005a030b
klee::KModule::prepare(klee::Interpreter::ModuleOptions const&,
klee::InterpreterHandler*) + 3691
12 klee0x0054e416
klee::Executor::setModule(llvm::Module*, klee::Interpreter::ModuleOptions
const&) + 278
13 klee0x00531e99 main + 3561
14 libc.so.6   0x7f2eda875830 __libc_start_main + 240
15 klee0x005471d9 _start + 41
Aborted (core dumped)
--
However, when I use llvm-link it works but it generates this error:

/llvm2/Release/bin/llvm-link: link error in 'hmmsearch.bc': Linking globals
named 'main': symbol multiply defined!

attached is the make file.

Please advise

Thank you in advance


On 5 July 2017 at 02:43, asantosa1...@gmail.com <asantosa1...@gmail.com>
wrote:

> Sorry it was my mistake. Please replace "sudo apt install wllvm"  with the
> following two commands:
>
> sudo apt install python-pip
> sudo pip install wllvm
>
> Best,
> Andrew
>
>
>
> On Wednesday, July 5, 2017, 7:35:00 AM GMT+8, Nourah mmm <
> dnoo...@gmail.com> wrote:
>
>
> Thank you very much for your replay.
>
> I tried to do that, however, its print extract-bc: command not found.
>
> I'm trying to extract the bc from SPEC cpu2006 Integer benchmarks. So I
> did the following.
>
>1. sudo apt install wllvm
>2. LLVM_COMPILER=clang CC=wllvm make --> here I use clang version 3.4
>and I just write wllvm without a path.
>3. Then, it generate the .o files and an executable program(mcf)
>4. extract-bc mcf
>
> Thank you
> Nora
>
> On 4 July 2017 at 03:04, asantosa1...@gmail.com <asantosa1...@gmail.com>
> wrote:
>
> I suppose what you want is to produce a bitcode for running with KLEE. You
> can probably
> do a normal build procedure for the program, but with replacing your C
> compiler with wllvm.
> wllvm is available here: https://github.com/travitch/ whole-program-llvm
> <https://github.com/travitch/whole-program-llvm> See also an installation
> instruction as the Step 2 here: Testing Coreutils · KLEE
> <https://klee.github.io/tutorials/testing-coreutils/>
>
> Testing Coreutils · KLEE
>
> <https://klee.github.io/tutorials/testing-coreutils/>
>
>
> Alternatively, on Ubuntu 16.04, you can do
>
> sudo apt install wllvm
>
> to install wllvm.
>
> I assume you would normally build the program using "make". In that case,
> and assuming
> that both clang and wllvm are in your PATH, the following might work to
> produce the binary:
>
> LLVM_COMPILER=clang CC=wllvm make
>
> And then you can do:
>
> extract-bc program
>
> To get the program.bc for running with KLEE.
>
> Best,
> Andrew
> On Tuesday, July 4, 2017, 9:05:49 AM GMT+8, Nourah mmm <dnoo...@gmail.com>
> wrote:
>
>
> Hi,
>
> I'm testing a program that compress and decompress files.
> For C compilation I'm using these flags:
>
> -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LP64
>
> How could I use these in KLEE?
>
> Thank you
> Nora
> __ ___

Re: [klee-dev] -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LP64

2017-07-05 Thread Nourah mmm
Hi, sorry I notice that I used an the new version of Clang.
It works now. Many thanks

On 5 July 2017 at 02:43, asantosa1...@gmail.com <asantosa1...@gmail.com>
wrote:

> Sorry it was my mistake. Please replace "sudo apt install wllvm"  with the
> following two commands:
>
> sudo apt install python-pip
> sudo pip install wllvm
>
> Best,
> Andrew
>
>
>
> On Wednesday, July 5, 2017, 7:35:00 AM GMT+8, Nourah mmm <
> dnoo...@gmail.com> wrote:
>
>
> Thank you very much for your replay.
>
> I tried to do that, however, its print extract-bc: command not found.
>
> I'm trying to extract the bc from SPEC cpu2006 Integer benchmarks. So I
> did the following.
>
>1. sudo apt install wllvm
>2. LLVM_COMPILER=clang CC=wllvm make --> here I use clang version 3.4
>and I just write wllvm without a path.
>3. Then, it generate the .o files and an executable program(mcf)
>4. extract-bc mcf
>
> Thank you
> Nora
>
> On 4 July 2017 at 03:04, asantosa1...@gmail.com <asantosa1...@gmail.com>
> wrote:
>
> I suppose what you want is to produce a bitcode for running with KLEE. You
> can probably
> do a normal build procedure for the program, but with replacing your C
> compiler with wllvm.
> wllvm is available here: https://github.com/travitch/ whole-program-llvm
> <https://github.com/travitch/whole-program-llvm> See also an installation
> instruction as the Step 2 here: Testing Coreutils · KLEE
> <https://klee.github.io/tutorials/testing-coreutils/>
>
> Testing Coreutils · KLEE
>
> <https://klee.github.io/tutorials/testing-coreutils/>
>
>
> Alternatively, on Ubuntu 16.04, you can do
>
> sudo apt install wllvm
>
> to install wllvm.
>
> I assume you would normally build the program using "make". In that case,
> and assuming
> that both clang and wllvm are in your PATH, the following might work to
> produce the binary:
>
> LLVM_COMPILER=clang CC=wllvm make
>
> And then you can do:
>
> extract-bc program
>
> To get the program.bc for running with KLEE.
>
> Best,
> Andrew
> On Tuesday, July 4, 2017, 9:05:49 AM GMT+8, Nourah mmm <dnoo...@gmail.com>
> wrote:
>
>
> Hi,
>
> I'm testing a program that compress and decompress files.
> For C compilation I'm using these flags:
>
> -DSPEC_CPU -DNDEBUG -DSPEC_CPU_LP64
>
> How could I use these in KLEE?
>
> Thank you
> Nora
> __ _
> klee-dev mailing list
> klee-dev@imperial.ac.uk
> https://mailman.ic.ac.uk/ mailman/listinfo/klee-dev
> <https://mailman.ic.ac.uk/mailman/listinfo/klee-dev>
>
>
>
___
klee-dev mailing list
klee-dev@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev


[klee-dev] Out of bound pointer

2017-06-22 Thread Nourah mmm
Hi,
When the run reach the following part of code it results in
../klee/runtime/POSIX/fd.c:40: memory error: out of bound pointer.
.err
-
Error: memory error: out of bound pointer
File: /home/naloboud/klee/runtime/POSIX/fd.c
Line: 40
assembly.ll line: 4453
Stack:
#04453 in open (pathname=0, flags=0) at
/home/naloboud/klee/runtime/POSIX/fd.c:40
#12536 in _stdio_fopen (fname_or_mode=0, mode=45350704) at
/home/naloboud/klee-uclibc/libc/stdio/_fopen.c:146
#21602 in __user_main (argc=10, argv=39032928) at
/home/naloboud/klee-uclibc/libc/stdio/fopen.c:20
#34027 in main (=10, =39032928) at
/home/naloboud/klee-uclibc/libc/misc/internals/__uClibc_main.c:401
Info:
address: 0
next: object at 30964048 of size 18
MO50[18] allocated at main():  %k_termios.i.i1.i.i.i = alloca
%struct.__kernel_termios.448, align 4
---
The code:

float *h_A0;
float *h_Anext;

size=nx*ny*nz;
printf("2\n");

h_A0=(float*)malloc(sizeof(float)*size);
h_Anext=(float*)malloc(sizeof(float)*size);
FILE *fp = fopen(parameters->inpFiles[0], "rb");
read_data(h_A0, nx,ny,nz,fp);
fclose(fp);
printf("3\n");
memcpy (h_Anext,h_A0 ,sizeof(float)*size);
printf("4\n");

Please help
Thank you in advance
Nora
___
klee-dev mailing list
klee-dev@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev


[klee-dev] klee/runtime/POSIX/fd.c:40: memory error: out of bound pointer

2017-06-16 Thread Nourah mmm
Hi,

After running KLEE on Stencil Benchmark( within Parboil benchmarks). I
encountered this error:
---
klee --libc=uclibc --posix-runtime all.bc 128 128 32 100
'/home/parboil/datasets/stencil/small/input/128x128x32.bin'
KLEE: NOTE: Using klee-uclibc :
/home/klee/Release+Asserts/lib/klee-uclibc.bca
KLEE: NOTE: Using model:
/home/klee/Release+Asserts/lib/libkleeRuntimePOSIX.bca
KLEE: output directory is "/home/klee/examples/stencil/klee-out-36"
Using STP solver backend
KLEE: WARNING: undefined reference to function: klee_posix_prefer_cex
KLEE: WARNING ONCE: calling external: syscall(16, 0, 21505, 36697536)
KLEE: WARNING ONCE: calling __user_main with extra arguments.
KLEE: WARNING ONCE: calling external: printf(31963744)

CPU-based 7 points stencil codes
Original version by Li-Wen Chang  and I-Jui Sung<
sun...@illinois.edu>
This version maintained by Chris Rodrigues  ***
KLEE: WARNING ONCE: calling external: gettimeofday(30721744, 0)
KLEE: ERROR: /home/klee/runtime/POSIX/fd.c:40: memory error: out of bound
pointer
KLEE: NOTE: now ignoring this error at this location

KLEE: done: total instructions = 8411
KLEE: done: completed paths = 1
KLEE: done: generated tests = 1
-
Note that I'm I'm using LLVM 3.4.2.

The error pointing on the following line in fd.c:
  char c = pathname[0];

Is this consider as a bug in KLEE?

Best regards,
Nourah
___
klee-dev mailing list
klee-dev@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev


[klee-dev] failed external call: fgets

2017-06-16 Thread Nourah mmm
Hi,

I try to run KLEE on cutcp benchmark from (Parboil Benchmarks
). The benchmark
consists from the following program: main.c  parboil.c readatom.c cutcpu.c
excl.c output.c

First I compile it with the following command:
myclang -I /home/klee/klee_src/include -emit-llvm -c -g main.c  parboil.c
readatom.c cutcpu.c excl.c output.c

Then, I run KLEE with this command:
myklee --posix-runtime --libc=uclibc  --link-llvm-lib=parboil.bc
--link-llvm-lib=cutcpu.bc --link-llvm-lib=excl.bc --link-llvm-lib=output.bc
--link-llvm-lib=readatom.bc ./main.bc -i
/home/naloboud/parboil/datasets/cutcp/small/input/watbox.sl40.pqr

However I get this error:
KLEE: NOTE: Using model:
/home//klee/Release+Asserts/lib/libkleeRuntimePOSIX.bca
KLEE: Linking in library: parboil.bc.

KLEE: Linking in library: cutcpu.bc.

KLEE: Linking in library: excl.bc.

KLEE: Linking in library: output.bc.

KLEE: Linking in library: readatom.bc.

KLEE: output directory is "/home//klee/examples/cutcap/./klee-out-10"
Using STP solver backend
KLEE: WARNING: undefined reference to function: __isoc99_sscanf
KLEE: WARNING: undefined reference to function: ceilf
KLEE: WARNING: undefined reference to function: fabs
KLEE: WARNING: undefined reference to function: feof
KLEE: WARNING: undefined reference to function: fgets
KLEE: WARNING: undefined reference to function: floorf
KLEE: WARNING: undefined reference to function: fmaxf
KLEE: WARNING: undefined reference to function: fminf
KLEE: WARNING: undefined reference to function: klee_posix_prefer_cex
KLEE: WARNING: undefined reference to function: sprintf
KLEE: WARNING: undefined reference to function: sqrtf
KLEE: WARNING ONCE: calling external: syscall(16, 0, 21505, 53351024)
KLEE: WARNING ONCE: calling __user_main with extra arguments.
KLEE: WARNING ONCE: calling external: gettimeofday(53752832, 0)
KLEE: WARNING ONCE: calling external: fgets(53760304, 96, 53770848)
KLEE: ERROR: /home//klee/examples/cutcap/readatom.c:44: failed external
call: fgets
KLEE: NOTE: now ignoring this error at this location

KLEE: done: total instructions = 12343
KLEE: done: completed paths = 1
KLEE: done: generated tests = 1


Could you please help me with that?
Thanks
Nourah
___
klee-dev mailing list
klee-dev@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev


[klee-dev] C++ and file with .dat extension

2017-06-15 Thread Nourah mmm
Hi,

I'm trying to run a KLEE on Parboil benchmark. I would like to ask does
KLEE handle an input file with (.dat) extension?. Also, Can KLEE work on a
program written in C++.

Thank you
Nourah
___
klee-dev mailing list
klee-dev@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev