From bchen158 at ucr.edu Mon Aug 8 20:30:24 2022 From: bchen158 at ucr.edu (Biqian Cheng) Date: Mon, 8 Aug 2022 12:30:24 -0700 Subject: [klee-dev] KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca failed: Invalid record Message-ID: Hi, I've recently ran into this error when using klee --libc=uclibc --posix-runtime --external-calls=all program.bc The error message is: KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca failed: Invalid record I configure KLEE with llvm 11, and compile these C programs with Clang 11. What are the potential solutions for solving this error? Thank you! Biqian Cheng -------------- next part -------------- HTML attachment scrubbed and removed From f.busse at imperial.ac.uk Mon Aug 8 20:56:10 2022 From: f.busse at imperial.ac.uk (Frank Busse) Date: Mon, 8 Aug 2022 20:56:10 +0100 Subject: [klee-dev] KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca failed: Invalid record In-Reply-To: References: Message-ID: <20220808205610.758442a9@haengemotte.localdomain> Hi, On Mon, 8 Aug 2022 12:30:24 -0700 Biqian Cheng wrote: > The error message is: > > KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca > failed: Invalid record This happens typically when you mix different LLVM versions. See step 5: https://klee.github.io/build-llvm11/ and make sure you're using the right llvm-config (and don't put '#' in the command). Kind regards, Frank From bchen158 at ucr.edu Mon Aug 8 21:18:54 2022 From: bchen158 at ucr.edu (Biqian Cheng) Date: Mon, 8 Aug 2022 13:18:54 -0700 Subject: [klee-dev] KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca failed: Invalid record In-Reply-To: <20220808205610.758442a9@haengemotte.localdomain> References: <20220808205610.758442a9@haengemotte.localdomain> Message-ID: Hi Frank, Thanks for your reply. I typed this command as you suggested previously: ./configure --make-llvm-lib --with-cc clang-11 --with-llvm-config llvm-config-11 Here are what I got after typing that command: INFO:Forcing C compiler to be...clang-11 INFO:Absolute path to compiler.../usr/bin/clang-11 INFO:Disabling assertions INFO:Configuring for Debug build INFO:Configuring for LLVM bitcode archive INFO:Using llvm-config at.../usr/bin/llvm-config-11 INFO:Using llvm tool dir.../usr/lib/llvm-11/bin INFO:Found "/usr/lib/llvm-11/bin/llvm-nm". INFO:Found "/usr/lib/llvm-11/bin/llvm-ar". INFO:Found "/usr/lib/llvm-11/bin/llvm-link". INFO:Found "/usr/lib/llvm-11/bin/llvm-objdump". INFO:Using LLVM Bitcode Compiler specified by CC .../usr/bin/clang-11 INFO:Testing LLVM Bitcode compiler.../usr/bin/clang-11 INFO:Compiler /usr/bin/clang-11 works INFO:Checking for ncurses... INFO:Removing template destination "/home/biqiancheng/klee-uclibc/Makefile.klee" INFO:Writing templated file to "/home/biqiancheng/klee-uclibc/Makefile.klee" WARNING:Removing existing config file.../home/biqiancheng/klee-uclibc/.config INFO:Setting up pre-made configure for...x86_64 INFO:Installing .config file INFO:Looking for kernel include path... INFO:Found "/usr/include/x86_64-linux-gnu" This should mean I have configured it correctly, right? After doing that, I still get the same error message: KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca failed: Invalid record I checked LLVM versions that are installed by running this command: apt list --installed | grep -i llvm WARNING: apt does not have a stable CLI interface. Use with caution in scripts. libllvm10/focal,now 1:10.0.0-4ubuntu1 amd64 [installed,automatic] libllvm11/unknown,now 1:11.1.0~++20211011094159+1fdec59bffc1-1~exp1~20211011214622.5 amd64 [installed,automatic] llvm-10-dev/focal,now 1:10.0.0-4ubuntu1 amd64 [installed,automatic] llvm-10-runtime/focal,now 1:10.0.0-4ubuntu1 amd64 [installed,automatic] llvm-10-tools/focal,now 1:10.0.0-4ubuntu1 amd64 [installed,automatic] llvm-10/focal,now 1:10.0.0-4ubuntu1 amd64 [installed,automatic] llvm-11-dev/unknown,now 1:11.1.0~++20211011094159+1fdec59bffc1-1~exp1~20211011214622.5 amd64 [installed] llvm-11-doc/unknown,unknown,now 1:11.1.0~++20211011094159+1fdec59bffc1-1~exp1~20211011214622.5 all [installed,automatic] llvm-11-linker-tools/unknown,now 1:11.1.0~++20211011094159+1fdec59bffc1-1~exp1~20211011214622.5 amd64 [installed,automatic] llvm-11-runtime/unknown,now 1:11.1.0~++20211011094159+1fdec59bffc1-1~exp1~20211011214622.5 amd64 [installed,automatic] llvm-11-tools/unknown,now 1:11.1.0~++20211011094159+1fdec59bffc1-1~exp1~20211011214622.5 amd64 [installed] llvm-11/unknown,now 1:11.1.0~++20211011094159+1fdec59bffc1-1~exp1~20211011214622.5 amd64 [installed] llvm-dev/focal,now 1:10.0-50~exp1 amd64 [installed] llvm-runtime/focal,now 1:10.0-50~exp1 amd64 [installed,automatic] llvm/focal,now 1:10.0-50~exp1 amd64 [installed] I used clang-11 to get .bc files, and build KLEE with LLVM 11. Based on this, do I mix different LLVM versions? Thank you! Biqian Cheng On Mon, Aug 8, 2022 at 12:56 PM Frank Busse wrote: > Hi, > > > On Mon, 8 Aug 2022 12:30:24 -0700 > Biqian Cheng wrote: > > > The error message is: > > > > KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca > > failed: Invalid record > > This happens typically when you mix different LLVM versions. See step 5: > https://klee.github.io/build-llvm11/ > > and make sure you're using the right llvm-config (and don't put '#' in > the command). > > > Kind regards, > > Frank > -------------- next part -------------- HTML attachment scrubbed and removed From f.busse at imperial.ac.uk Mon Aug 8 21:30:51 2022 From: f.busse at imperial.ac.uk (Frank Busse) Date: Mon, 8 Aug 2022 21:30:51 +0100 Subject: [klee-dev] KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca failed: Invalid record In-Reply-To: References: <20220808205610.758442a9@haengemotte.localdomain> Message-ID: <20220808213051.19b3b54a@haengemotte.localdomain> Hi, On Mon, 8 Aug 2022 13:18:54 -0700 Biqian Cheng wrote: > Thanks for your reply. I typed this command as you suggested > previously: ./configure --make-llvm-lib --with-cc clang-11 > --with-llvm-config llvm-config-11 > > Here are what I got after typing that command: Looks good. Did you rebuild it (make) in case it was wrong beforehand? Then check the LLVM version klee is linked against (e.g. ldd /bin/klee) and finally the build output of your program.bc (enable verbose mode for make/...). Does klee complain without "--libc=uclibc"? > libllvm10/focal,now 1:10.0.0-4ubuntu1 amd64 [installed,automatic] Given that LLVM10 is on your machine as well I think we're on the right path. ;) Kind regards, Frank From bchen158 at ucr.edu Tue Aug 9 02:24:27 2022 From: bchen158 at ucr.edu (Biqian Cheng) Date: Mon, 8 Aug 2022 18:24:27 -0700 Subject: [klee-dev] KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca failed: Invalid record In-Reply-To: <20220808213051.19b3b54a@haengemotte.localdomain> References: <20220808205610.758442a9@haengemotte.localdomain> <20220808213051.19b3b54a@haengemotte.localdomain> Message-ID: Hi Frank, Did you rebuild it (make) in case it was wrong beforehand? Yes, I tried to use "cmake -DENABLE_POSIX_RUNTIME=ON -DENABLE_KLEE_UCLIBC=ON -DKLEE_UCLIBC_PATH=/home/klee-uclibc .." then "make -j2" to rebuild it. Then check the LLVM version klee is linked against (e.g. ldd > /bin/klee) I used "ldd /usr/local/bin/klee", it gives me: linux-vdso.so.1 (0x00007fff2cba9000) libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f1841e90000) libz3.so.4 => /lib/x86_64-linux-gnu/libz3.so.4 (0x00007f18408f0000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f18408d4000) libtcmalloc.so.4 => /lib/x86_64-linux-gnu/libtcmalloc.so.4 (0x00007f18406dd000) libLLVM-10.so.1 => /usr/lib/llvm-10/lib/libLLVM-10.so.1 (0x00007f183c049000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f183be67000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f183bd16000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f183bb24000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f183bb01000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f183bafb000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f183bae0000) /lib64/ld-linux-x86-64.so.2 (0x00007f1842332000) libunwind.so.8 => /lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f183bac3000) libffi.so.7 => /lib/x86_64-linux-gnu/libffi.so.7 (0x00007f183bab5000) libedit.so.2 => /lib/x86_64-linux-gnu/libedit.so.2 (0x00007f183ba7d000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f183ba73000) libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f183ba43000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f183ba1a000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f183b9fe000) Is this indicating I'm using LLVM-10, while I'm supposed to use LLVM-11? and finally the build output of your program.bc (enable verbose mode for > make/...). Does this mean make -j2? > Does klee complain without "--libc=uclibc"? No, when I deleted "--libc=uclibc". The issue disappears. Thank you for your help! --Biqian On Mon, Aug 8, 2022 at 1:30 PM Frank Busse wrote: > Hi, > > > On Mon, 8 Aug 2022 13:18:54 -0700 > Biqian Cheng wrote: > > > Thanks for your reply. I typed this command as you suggested > > previously: ./configure --make-llvm-lib --with-cc clang-11 > > --with-llvm-config llvm-config-11 > > > > Here are what I got after typing that command: > > Looks good. Did you rebuild it (make) in case it was wrong beforehand? > Then check the LLVM version klee is linked against (e.g. ldd > /bin/klee) and finally the build output of your program.bc > (enable verbose mode for make/...). Does klee complain > without "--libc=uclibc"? > > > libllvm10/focal,now 1:10.0.0-4ubuntu1 amd64 [installed,automatic] > > Given that LLVM10 is on your machine as well I think we're on the right > path. ;) > > > Kind regards, > > Frank > -------------- next part -------------- HTML attachment scrubbed and removed From f.busse at imperial.ac.uk Tue Aug 9 08:44:30 2022 From: f.busse at imperial.ac.uk (Frank Busse) Date: Tue, 9 Aug 2022 08:44:30 +0100 Subject: [klee-dev] KLEE: ERROR: Loading file /usr/local/lib/klee/runtime/klee-uclibc.bca failed: Invalid record In-Reply-To: References: <20220808205610.758442a9@haengemotte.localdomain> <20220808213051.19b3b54a@haengemotte.localdomain> Message-ID: <20220809084430.43382384@haengemotte.localdomain> Hi, On Mon, 8 Aug 2022 18:24:27 -0700 Biqian Cheng wrote: > Did you rebuild it (make) in case it was wrong beforehand? > > Yes, I tried to use "cmake -DENABLE_POSIX_RUNTIME=ON > -DENABLE_KLEE_UCLIBC=ON -DKLEE_UCLIBC_PATH=/home/klee-uclibc .." then > "make -j2" to rebuild it. I meant uclibc. There is a "make -j2" line in step 5: https://klee.github.io/build-llvm11/ Here you are configuring KLEE. Do a "make clean" in KLEE's build directory and call cmake with your options again but add the path to your llvm-config-11: -DLLVM_CONFIG_BINARY=/bin/llvm-config-11 > Then check the LLVM version klee is linked against (e.g. ldd >> /bin/klee) > > > I used "ldd /usr/local/bin/klee", it gives me: > > ... > libLLVM-10.so.1 => /usr/lib/llvm-10/lib/libLLVM-10.so.1 > (0x00007f183c049000) libstdc++.so.6 => > ... > Is this indicating I'm using LLVM-10, while I'm supposed to use > LLVM-11? Yes. > and finally the build output of your program.bc (enable verbose mode > for > > make/...). > > > Does this mean make -j2? Depending on the Makefile for that program you can run "make VERBOSE=1" or use a hack like "make SHELL='sh -x'" to see what commands are executed. If it's just a single C file and you are using clang directly, you don't need that step. Kind regards, Frank From m.nowack at imperial.ac.uk Tue Aug 9 16:14:01 2022 From: m.nowack at imperial.ac.uk (Nowack, Martin) Date: Tue, 9 Aug 2022 15:14:01 +0000 Subject: [klee-dev] 3rd International KLEE Workshop on Symbolic Execution: Registration Open In-Reply-To: <7955C85D-E923-4E33-84D6-130E4DDB77FF@imperial.ac.uk> References: <7955C85D-E923-4E33-84D6-130E4DDB77FF@imperial.ac.uk> Message-ID: Hi all, A quick reminder: the early registration deadline is approaching fast - tomorrow, 10th August. Looking forward to welcome you in person. The KLEE 2022 Organisers > On 29. Jul 2022, at 16:00, Nowack, Martin wrote: > > Hi all, > > We are delighted to host this September the 3rd International KLEE Workshop on Symbolic Execution at Imperial: > > 3rd International KLEE Workshop on Symbolic Execution > 15?16 September 2022 ? London, UK and Online > https://srg.doc.ic.ac.uk/klee22/ > > In-person registration is now open at https://srg.doc.ic.ac.uk/klee22/registration.html. Early registration closes 10th August. > > Following on the first two successful KLEE workshops in 2018 and 2021, which have brought together people from six different continents spanning academia, industry and government, one of the main goals of the workshop is to get together KLEE developers and users to exchange ideas, understand each other?s interests and needs, and discuss the evolution of KLEE. A particular emphasis will be placed on connecting academic researchers working with KLEE and symbolic execution with industrial users interested in using KLEE to improve their software products. > > While a particular emphasis will be placed on the KLEE ecosystem, the workshop will also discuss recent developments in symbolic execution and related areas, such as fuzzing and constraint solving. > > The workshop has an exciting line-up of keynotes, regular presentations and posters: > https://srg.doc.ic.ac.uk/klee22/keynotes.html. > https://srg.doc.ic.ac.uk/klee22/accepted_contributions.html > > Big thanks to our sponsors this year: Bloomberg, Samsung, Google, Qualcomm, Trail Of Bits and Imperial College London! > > We are looking forward to welcome you in person. > > The KLEE 2022 Organisers From mingxuanyao at gatech.edu Thu Aug 11 17:05:34 2022 From: mingxuanyao at gatech.edu (Yao, Mingxuan) Date: Thu, 11 Aug 2022 16:05:34 +0000 Subject: [klee-dev] Understanding of KQuery Message-ID: Hi, I was going through the documentation of KQuery, and I got a little confused about Query Commands. The documentation says that query-expression? is the expression to determine the validity of the query. Does it mean that Klee evaluates query-expression? under the constraints defined in costraint-list? to see if it is satisfiable? If so, why the query below is invalid? From my understanding, the constraints were saying that (a != 0), and the query expression was saying that if it is possible that (a >= 0). In this case, should (a > 0) be the answer? array a[4] : w32 -> w8 = symbolic (query [(Eq false ????????????(Eq 0 ??????????????????N0:(ReadLSB w32 0 a)))] ??????(Eq false (Slt N0 0)) [] ??????[a]) And when I read the documentation, the examples given always have query-expression? assigned with false. What does it mean in the context of the query? The last question (sry, I have lots of questions lol) I have is the usage of eval-expr-list?. The documentation says, 'If a counterexample is desired for invalid queries, this is a list of expressions for which a possible value should be constructed.' Does it mean that klee only generate examples for invalid queries and how klee uses eval-expr-list? to generate test cases? Examples would be much appreciated! Best, Ming -------------- next part -------------- HTML attachment scrubbed and removed From c.cadar at imperial.ac.uk Tue Aug 16 16:50:08 2022 From: c.cadar at imperial.ac.uk (Cristian Cadar) Date: Tue, 16 Aug 2022 16:50:08 +0100 Subject: [klee-dev] KLEE 2022 Workshop: Free online registration now available & in-person registration still open Message-ID: <812ed056-39e1-b1b7-d4a3-f20bcca87c8e@imperial.ac.uk> Hi all, We have opened today the online registration for the KLEE'22 workshop, which is free for everyone! (but we might need to restrict the number of places) In-person registration is still available until 1st September; if you can make it to London, in-person participation is the best way to experience the workshop. https://srg.doc.ic.ac.uk/klee22/registration.html We have an exciting list of keynotes and accepted contributions, which you can find here: https://srg.doc.ic.ac.uk/klee22/keynotes.html https://srg.doc.ic.ac.uk/klee22/accepted_contributions.html I hope to see as many of you at the workshop! Cristian, on behalf of the KLEE'22 Organising Team From piyushnit15 at gmail.com Fri Aug 26 02:09:33 2022 From: piyushnit15 at gmail.com (Piyush Jha) Date: Thu, 25 Aug 2022 21:09:33 -0400 Subject: [klee-dev] Use KLEE with JAVA and C# Message-ID: Hi everyone, I'm looking for a tool for symbolic execution in C# or JAVA. Does Klee support C# or JAVA? I searched the mailing list archive and found the same question for JAVA posted several years back. Does anyone know if there are any updates regarding these? I would really appreciate any help you can provide. With kind regards, Piyush -------------- next part -------------- HTML attachment scrubbed and removed