Skip to content
This repository was archived by the owner on Feb 3, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions src/s2e/Plugins/Searchers/SeedScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ void SeedScheduler::initialize() {
m_timeOfLastCrash = now;
m_timeOfLastHighPrioritySeed = now;
m_timeOfLastFetchedSeed = now;

#if defined(CONFIG_SYMBEX) && defined(CONFIG_SYMBEX_MP)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain in a comment why this is needed.

m_explorationState = WARM_UP;
#else
// warm up phase is intended for multi path mode only, in single path mode
// we do not want to waste cpu cycles to let guest waiting for seeds
m_explorationState = WAIT_FOR_NEW_SEEDS;
#endif

m_seeds = s2e()->getPlugin<SeedSearcher>();
m_seeds->onSeed.connect(sigc::mem_fun(*this, &SeedScheduler::onSeed));
Expand Down
12 changes: 9 additions & 3 deletions src/s2e/Plugins/Searchers/SeedSearcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ void SeedSearcher::update(klee::ExecutionState *current, const klee::StateSet &a

// This can only happen if state 0 dies for some reason
if (es == m_initialState) {
#if defined(CONFIG_SYMBEX) && defined(CONFIG_SYMBEX_MP)
s2e_warn_assert(cs, false, "Initial state no longer exists, seed look up is not possible");
#endif
m_initialState = NULL;
m_selectSeedState = false;
}
Expand Down Expand Up @@ -446,10 +448,10 @@ void SeedSearcher::handleGetSeedFile(S2EExecutionState *state, S2E_SEEDSEARCHER_

if (!m_selectSeedState) {
if (m_states.size() > 1 || alreadyExplored) {
cmd.GetFile.Result = 0;
cmd.GetFile.Result = SEED_GETFILE_FAIL_NO_FORK;
} else {
alreadyExplored = true;
cmd.GetFile.Result = 1;
cmd.GetFile.Result = SEED_GETFILE_FAIL_DO_FORK;
}

getDebugStream(state) << "no seeds available\n";
Expand All @@ -469,7 +471,11 @@ void SeedSearcher::handleGetSeedFile(S2EExecutionState *state, S2E_SEEDSEARCHER_

m_selectSeedState = false;

cmd.GetFile.Result = 2;
#if defined(CONFIG_SYMBEX) && defined(CONFIG_SYMBEX_MP)
cmd.GetFile.Result = SEED_GETFILE_SUCC_DO_FORK;
#else
cmd.GetFile.Result = SEED_GETFILE_SUCC_NO_FORK;
#endif

if (state == m_initialState) {
plgState->seedIndex = m_currentSeed.index;
Expand Down