Re: [klee-dev] Error while using C++ STL, libcxx

2020-05-27 Thread Namrata Jain

Thankyou Felix.

--
Namrata Jain

On 26.05.2020 22:02, Felix Rath wrote:

Hey,


As suggested, I ran "make check" from klee-build-directory and found
that 47 unexpected tests were failing.


That definitely sounds like something might have been broken there.


What this error is about? I also found this as an open issue on klee
github page.


I sadly cannot help with this, as I don't use KLEE's build scripts,
and am not really familiar with how they work at all. So I don't know
what the correct options, usage, etc. for building KLEE with libcxx
support are.

As you mentioned that libcxx support was not required for the example 
I
stated, I built klee (version 2.1) without enabling libcxx and was 
able

to see the output "12" with no errors.


Nice :) Then I would assume that LLVM 9 or 10 should definitely help
with running with `--libcxx`.


Are these due to not linking libcxx?



KLEE: WARNING: undefined reference to function: _ZSt9terminatev
KLEE: WARNING: undefined reference to function: __cxa_begin_catch
KLEE: WARNING: undefined reference to function: __gxx_personality_v0


I think these are from not linking libcxxabi, which can be part of
libcxx depending on how you build it.


KLEE: WARNING: undefined reference to function: __syscall_rt_sigaction
KLEE: WARNING: undefined reference to function: fcntl
KLEE: WARNING: undefined reference to function: fstat
KLEE: WARNING: undefined reference to function: ioctl
KLEE: WARNING: undefined reference to function: llvm.dbg.label
KLEE: WARNING: undefined reference to function: open
KLEE: WARNING: undefined reference to function: write
KLEE: WARNING: undefined reference to function: kill (UNSAFE)!


Some of these actually are provided by --posix-runtime (like `open`,
`ioctl` and maybe more), so that might help here. Others might not be
modeled for KLEE (yet), but they don't seem to be from libcxx, as
libcxx usually contains C++-mangled names (but they might appear in
the program because you #include'd  and ).


I also want to know about klee version-2.1-pre, is it the same as
version 2.0? This is because I have made some changes in my klee 
source

(2.1-pre) for a project and now I will be using version-2.1.


Can't really help with this, not really familiar with KLEE's release 
process.


Best,
Felix


From: Namrata Jain 
Sent: Tuesday, May 26, 2020 2:32 PM
To: Felix Rath
Cc: klee-dev@imperial.ac.uk
Subject: Re: [klee-dev] Error while using C++ STL, libcxx

Hello Felix,

Thankyou for the reply.
As suggested, I ran "make check" from klee-build-directory and found
that 47 unexpected tests were failing.
So, I installed llvm-10, but while installing libcxx from
klee-source-directory using the command:
LLVM_VERSION=10 SANITIZER_BUILD= BASE=
./scripts/build/build.sh libcxx

it generated output:

Detected OS: linux
OS=linux
Detected distribution: ubuntu
DISTRIBUTION=ubuntu
Detected version: 18.04
DISTRIBUTION_VER=18.04
Component sanitizer not found.
Component sanitizer not found.
ENABLE_OPTIMIZED Required but unset

What this error is about? I also found this as an open issue on klee
github page.

As you mentioned that libcxx support was not required for the example I
stated, I built klee (version 2.1) without enabling libcxx and was able
to see the output "12" with no errors.

(using the command: klee --libc=uclibc /experiment.bc)

Warnings that were generated:

KLEE: WARNING: undefined reference to function: _ZSt9terminatev
KLEE: WARNING: undefined reference to function: __cxa_begin_catch
KLEE: WARNING: undefined reference to function: __gxx_personality_v0
KLEE: WARNING: undefined reference to function: __syscall_rt_sigaction
KLEE: WARNING: undefined reference to function: fcntl
KLEE: WARNING: undefined reference to function: fstat
KLEE: WARNING: undefined reference to function: ioctl
KLEE: WARNING: undefined reference to function: llvm.dbg.label
KLEE: WARNING: undefined reference to function: open
KLEE: WARNING: undefined reference to function: write
KLEE: WARNING: undefined reference to function: kill (UNSAFE)!
KLEE: WARNING ONCE: calling external: ioctl(0, 21505, 94590150907232) 
at

libc/termios/tcgetattr.c:43 12
KLEE: WARNING ONCE: calling __user_main with extra arguments.

Are these due to not linking libcxx?

I also want to know about klee version-2.1-pre, is it the same as
version 2.0? This is because I have made some changes in my klee source
(2.1-pre) for a project and now I will be using version-2.1.

Thankyou.

--
Namrata Jain


On 25.05.2020 17:21, Felix Rath wrote:

Hello Namrata,

I worked a lot on the current C++ support in KLEE (the recent C++
support PRs to KLEE were by me), so I hope I can help. I think the
main problem is that llvm 6.0 is quite old, and your example should
pretty much work as-is if you switch to a recent llvm version (the
most recent being 10, which should work). I tried your example locally
with llvm (and libc++) 10 and it produced the expected output ("12").
You can also run 

[klee-dev] Klee LLVM10 docker image

2020-05-27 Thread Martins Eglitis

Hi,

Has anyone built Klee with the LLVM10 and, maybe, has a docker image 
available?


--
Best regards,
Martins Eglitis


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


Re: [klee-dev] Why KLEE still symbolic executing program after reaching max-fork?

2020-05-27 Thread Cristian Cadar

Hi,

This was the simplest way to implement --max-forks.  I agree you could 
improve this, depending also on what you want to achieve.


Best,
Cristian

On 25/05/2020 10:31, XIE Xuan wrote:

Hi all,

I am reading KLEE’s source code and find that if I set “-max-fork=n” 
when KLEE reach its fork limit n, it will still symbolic executing the 
program. In my understanding, when KLEE stops forking, there is no need 
to invoke SMT solver to check which branch is reachable or not, 
therefore it is also unnecessary to symbolic executing the program in 
order to set up more constraints. Thus I would like to know why KLEE not 
concretely running the program after reaching fork limit?


Thanks!


___
klee-dev mailing list
klee-dev@imperial.ac.uk
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