Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
91468cf
Run KDAlloc/rusage unittest a few times to allow for swapfile interfe…
danielschemmel Mar 22, 2023
a91be77
remove obsolete header
danielschemmel Mar 22, 2023
fc3c937
stats: add InhibitedForks
251 Jan 7, 2022
7b881cd
stats: add QCacheHits/Misses
251 Jan 7, 2022
895f095
stats: add ExternalCalls
251 Jan 7, 2022
855d331
stats: rename numQueries/Queries -> SolverQueries, add Queries
251 Jan 7, 2022
a88a768
stats: add Allocations
251 Jan 7, 2022
ba58e4a
stats: rename States -> ActiveStates, add States
251 Jan 7, 2022
4749068
stats: add branch type stats
251 Jan 7, 2022
a6f0612
tests: add Feature/KleeStatsBranches.c
251 Jan 10, 2022
3a1965c
stats: add termination class stats
251 Jan 11, 2022
58d4546
tests: add Feature/KleeStatsTermClasses.c
251 Jan 11, 2022
0ca2dc8
Remove model_version from the POSIX runtime, as we have never used it.
ccadar Mar 21, 2023
76f0573
fix unused variable warning
danielschemmel Mar 22, 2023
c9ce3b4
Transition to GitHub Container Registry hosting
MartinNowack Mar 23, 2023
721b2fc
Fix detection and installation of Ubuntu-provided llvm/clang packages
MartinNowack Mar 23, 2023
7c9ce86
fix unused variables warning
danielschemmel Mar 24, 2023
67ec447
tests: add some missing headers
251 Mar 24, 2023
89ebbb9
(gcc-13) include cstdint for *int*_t
Mar 22, 2023
dfd2aea
Core/Executor: long double on i686 must be aligned to 4 bytes
lzaoral Mar 25, 2023
13cfabb
ci(lint): add shell linter - Differential ShellCheck
jamacku Sep 11, 2022
66e1044
fix CMake: -UNDEBUG
jbuening Mar 29, 2023
2aa5b7b
Prevent fallthrough warning
danielschemmel Mar 24, 2023
bf55c0b
new: persistent ptree (-write-ptree) and klee-ptree
251 Mar 24, 2023
2ac759d
SearcherTest: remove redundant root init, fix branch type
251 Mar 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
# Defaults for building KLEE
env:
BASE_IMAGE: ubuntu:jammy-20230126
REPOSITORY: klee
REPOSITORY: ghcr.io/klee
COVERAGE: 0
DISABLE_ASSERTIONS: 0
ENABLE_DOXYGEN: 0
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/differential-shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Doc: https://github.com/redhat-plumbers-in-action/differential-shellcheck#usage
---

name: Differential ShellCheck
on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest

permissions:
security-events: write

steps:
- name: Repository checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Differential ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@v4
with:
severity: warning
token: ${{ secrets.GITHUB_TOKEN }}
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
option(ENABLE_KLEE_ASSERTS "Enable KLEE assertions" ON)
if (ENABLE_KLEE_ASSERTS)
message(STATUS "KLEE assertions enabled")
# We have to add the undefine to the flags, otherwise "-D-UDNDEBUG" will be added
list(APPEND KLEE_COMPONENT_CXX_FLAGS "-UDNDEBUG")
# We have to undefine `NDEBUG` (which CMake adds by default) using `FLAGS`
# and not `DEFINES` since `target_compile_definitions` does not support `-U`.
list(APPEND KLEE_COMPONENT_CXX_FLAGS "-UNDEBUG")
else()
message(STATUS "KLEE assertions disabled")
list(APPEND KLEE_COMPONENT_CXX_DEFINES "-DNDEBUG")
Expand Down Expand Up @@ -319,6 +320,16 @@ if (NOT SQLITE3_FOUND)
message( FATAL_ERROR "SQLite3 not found, please install" )
endif()

find_program(
SQLITE_CLI
NAMES "sqlite3"
DOC "Path to sqlite3 tool"
)

if (NOT SQLITE_CLI)
set(SQLITE_CLI "")
endif()

################################################################################
# Detect libcap
################################################################################
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM klee/llvm:110_O_D_A_ubuntu_jammy-20230126 as llvm_base
FROM klee/gtest:1.11.0_ubuntu_jammy-20230126 as gtest_base
FROM klee/uclibc:klee_uclibc_v1.3_110_ubuntu_jammy-20230126 as uclibc_base
FROM klee/tcmalloc:2.9.1_ubuntu_jammy-20230126 as tcmalloc_base
FROM klee/stp:2.3.3_ubuntu_jammy-20230126 as stp_base
FROM klee/z3:4.8.15_ubuntu_jammy-20230126 as z3_base
FROM klee/libcxx:110_ubuntu_jammy-20230126 as libcxx_base
FROM klee/sqlite:3400100_ubuntu_jammy-20230126 as sqlite3_base
FROM ghcr.io/klee/llvm:110_O_D_A_ubuntu_jammy-20230126 as llvm_base
FROM ghcr.io/klee/gtest:1.11.0_ubuntu_jammy-20230126 as gtest_base
FROM ghcr.io/klee/uclibc:klee_uclibc_v1.3_110_ubuntu_jammy-20230126 as uclibc_base
FROM ghcr.io/klee/tcmalloc:2.9.1_ubuntu_jammy-20230126 as tcmalloc_base
FROM ghcr.io/klee/stp:2.3.3_ubuntu_jammy-20230126 as stp_base
FROM ghcr.io/klee/z3:4.8.15_ubuntu_jammy-20230126 as z3_base
FROM ghcr.io/klee/libcxx:110_ubuntu_jammy-20230126 as libcxx_base
FROM ghcr.io/klee/sqlite:3400100_ubuntu_jammy-20230126 as sqlite3_base
FROM llvm_base as intermediate
COPY --from=gtest_base /tmp /tmp/
COPY --from=uclibc_base /tmp /tmp/
Expand Down
33 changes: 20 additions & 13 deletions include/klee/Core/BranchTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

/// \cond DO_NOT_DOCUMENT
#define BRANCH_TYPES \
BTYPE(NONE, 0U) \
BTYPE(ConditionalBranch, 1U) \
BTYPE(IndirectBranch, 2U) \
BTYPEDEFAULT(NONE, 0U) \
BTYPE(Conditional, 1U) \
BTYPE(Indirect, 2U) \
BTYPE(Switch, 3U) \
BTYPE(Call, 4U) \
BTYPE(MemOp, 5U) \
Expand All @@ -25,7 +25,7 @@
BTYPE(Realloc, 8U) \
BTYPE(Free, 9U) \
BTYPE(GetVal, 10U) \
MARK(END, 10U)
BMARK(END, 10U)
/// \endcond

/** @enum BranchType
Expand All @@ -34,8 +34,8 @@
* | Value | Description |
* |---------------------------------|----------------------------------------------------------------------------------------------------|
* | `BranchType::NONE` | default value (no branch) |
* | `BranchType::ConditionalBranch` | branch caused by `br` instruction with symbolic condition |
* | `BranchType::IndirectBranch` | branch caused by `indirectbr` instruction with symbolic address |
* | `BranchType::Conditional` | branch caused by `br` instruction with symbolic condition |
* | `BranchType::Indirect` | branch caused by `indirectbr` instruction with symbolic address |
* | `BranchType::Switch` | branch caused by `switch` instruction with symbolic value |
* | `BranchType::Call` | branch caused by `call` with symbolic function pointer |
* | `BranchType::MemOp` | branch caused by memory operation with symbolic address (e.g. multiple resolutions, out-of-bounds) |
Expand All @@ -46,13 +46,20 @@
* | `BranchType::GetVal` | branch caused by user-invoked concretization while seeding |
*/
enum class BranchType : std::uint8_t {
/// \cond DO_NOT_DOCUMENT
#define BTYPE(N,I) N = (I),
#define MARK(N,I) N = (I),
/// \cond DO_NOT_DOCUMENT
#define BTYPEDEFAULT(N,I) N = (I),
#define BTYPE(N,I) N = (I),
#define BMARK(N,I) N = (I),
BRANCH_TYPES
#undef BTYPE
#undef MARK
/// \endcond
/// \endcond
};

#endif

#undef BTYPEDEFAULT
#undef BTYPE
#undef BMARK
#define BTYPEDEFAULT(N,I)
#define BTYPE(N,I)
#define BMARK(N,I)

#endif
1 change: 1 addition & 0 deletions include/klee/Core/Interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef KLEE_INTERPRETER_H
#define KLEE_INTERPRETER_H

#include <cstdint>
#include <map>
#include <memory>
#include <set>
Expand Down
110 changes: 72 additions & 38 deletions include/klee/Core/TerminationTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,85 @@

#include <cstdint>


#define TERMINATION_CLASSES \
TCLASS(Exit, 1U) \
TCLASS(Early, 2U) \
TCLASS(SolverError, 3U) \
TCLASS(ProgramError, 4U) \
TCLASS(UserError, 5U) \
TCLASS(ExecutionError, 6U) \
TCLASS(EarlyAlgorithm, 7U) \
TCLASS(EarlyUser, 8U)

///@brief Termination classes categorize termination types
enum class StateTerminationClass : std::uint8_t {
/// \cond DO_NOT_DOCUMENT
#define TCLASS(N,I) N = (I),
TERMINATION_CLASSES
/// \endcond
};


// (Name, ID, file suffix)
#define TERMINATION_TYPES \
TTYPE(RUNNING, 0U, "") \
TTYPE(Exit, 1U, "") \
MARK(NORMAL, 1U) \
TTYPE(Interrupted, 2U, "early") \
TTYPE(MaxDepth, 3U, "early") \
TTYPE(OutOfMemory, 4U, "early") \
TTYPE(OutOfStackMemory, 5U, "early") \
MARK(EARLY, 5U) \
TTYPE(Solver, 8U, "solver.err") \
MARK(SOLVERERR, 8U) \
TTYPE(Abort, 10U, "abort.err") \
TTYPE(Assert, 11U, "assert.err") \
TTYPE(BadVectorAccess, 12U, "bad_vector_access.err") \
TTYPE(Free, 13U, "free.err") \
TTYPE(Model, 14U, "model.err") \
TTYPE(Overflow, 15U, "overflow.err") \
TTYPE(Ptr, 16U, "ptr.err") \
TTYPE(ReadOnly, 17U, "read_only.err") \
TTYPE(ReportError, 18U, "report_error.err") \
TTYPE(InvalidBuiltin, 19U, "invalid_builtin_use.err") \
TTYPE(ImplicitTruncation, 20U, "implicit_truncation.err") \
TTYPE(ImplicitConversion, 21U, "implicit_conversion.err") \
TTYPE(UnreachableCall, 22U, "unreachable_call.err") \
TTYPE(MissingReturn, 23U, "missing_return.err") \
TTYPE(InvalidLoad, 24U, "invalid_load.err") \
TTYPE(NullableAttribute, 25U, "nullable_attribute.err") \
MARK(PROGERR, 25U) \
TTYPE(User, 33U, "user.err") \
MARK(USERERR, 33U) \
TTYPE(Execution, 35U, "exec.err") \
TTYPE(External, 36U, "external.err") \
MARK(EXECERR, 36U) \
TTYPE(Replay, 37U, "") \
TTYPE(Merge, 38U, "") \
TTYPE(SilentExit, 39U, "") \
MARK(END, 39U)
TTMARK(EXIT, 1U) \
TTYPE(Interrupted, 10U, "early") \
TTYPE(MaxDepth, 11U, "early") \
TTYPE(OutOfMemory, 12U, "early") \
TTYPE(OutOfStackMemory, 13U, "early") \
TTMARK(EARLY, 13U) \
TTYPE(Solver, 20U, "solver.err") \
TTMARK(SOLVERERR, 20U) \
TTYPE(Abort, 30U, "abort.err") \
TTYPE(Assert, 31U, "assert.err") \
TTYPE(BadVectorAccess, 32U, "bad_vector_access.err") \
TTYPE(Free, 33U, "free.err") \
TTYPE(Model, 34U, "model.err") \
TTYPE(Overflow, 35U, "overflow.err") \
TTYPE(Ptr, 36U, "ptr.err") \
TTYPE(ReadOnly, 37U, "read_only.err") \
TTYPE(ReportError, 38U, "report_error.err") \
TTYPE(InvalidBuiltin, 39U, "invalid_builtin_use.err") \
TTYPE(ImplicitTruncation, 40U, "implicit_truncation.err") \
TTYPE(ImplicitConversion, 41U, "implicit_conversion.err") \
TTYPE(UnreachableCall, 42U, "unreachable_call.err") \
TTYPE(MissingReturn, 43U, "missing_return.err") \
TTYPE(InvalidLoad, 44U, "invalid_load.err") \
TTYPE(NullableAttribute, 45U, "nullable_attribute.err") \
TTMARK(PROGERR, 45U) \
TTYPE(User, 50U, "user.err") \
TTMARK(USERERR, 50U) \
TTYPE(Execution, 60U, "exec.err") \
TTYPE(External, 61U, "external.err") \
TTMARK(EXECERR, 61U) \
TTYPE(Replay, 70U, "") \
TTYPE(Merge, 71U, "") \
TTMARK(EARLYALGORITHM, 71U) \
TTYPE(SilentExit, 80U, "") \
TTMARK(EARLYUSER, 80U) \
TTMARK(END, 80U)


///@brief Reason an ExecutionState got terminated.
enum class StateTerminationType : std::uint8_t {
#define TTYPE(N,I,S) N = (I),
#define MARK(N,I) N = (I),
/// \cond DO_NOT_DOCUMENT
#define TTYPE(N,I,S) N = (I),
#define TTMARK(N,I) N = (I),
TERMINATION_TYPES
#undef TTYPE
#undef MARK
/// \endcond
};


// reset definitions

#undef TCLASS
#undef TTYPE
#undef TTMARK
#define TCLASS(N,I)
#define TTYPE(N,I,S)
#define TTMARK(N,I)

#endif
1 change: 1 addition & 0 deletions include/klee/Solver/SolverStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace klee {
namespace stats {

extern Statistic cexCacheTime;
extern Statistic solverQueries;
extern Statistic queries;
extern Statistic queriesInvalid;
extern Statistic queriesValid;
Expand Down
1 change: 1 addition & 0 deletions include/klee/Statistics/Statistic.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef KLEE_STATISTIC_H
#define KLEE_STATISTIC_H

#include <cstdint>
#include <string>

namespace klee {
Expand Down
Loading