def run(self):
<EOL>current_state = None<EOL>current_state_id = None<EOL>with WithKeyboardInterruptAs(self.shutdown):<EOL><INDENT>self._notify_start_run()<EOL>logger.debug("<STR_LIT>", os.getpid())<EOL>solver = Z3Solver()<EOL>while not self.is_shutdown():<EOL><INDENT>try:  <EOL><INDENT>try:  <EOL><INDENT>if current_state is None:<EOL><INDENT>with self._lock:<EOL><INDENT>self._notify_stop_run()<EOL>try:<EOL><INDENT>current_state_id = self.get()<EOL>if current_state_id is not None:<EOL><INDENT>self._publish('<STR_LIT>', current_state_id)<EOL>current_state = self._workspace.load_state(current_state_id)<EOL>self.forward_events_from(current_state, True)<EOL>self._publish('<STR_LIT>', current_state, current_state_id)<EOL>logger.info("<STR_LIT>", current_state_id)<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>self._notify_start_run()<EOL><DEDENT><DEDENT><DEDENT>if current_state is None:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>break<EOL><DEDENT>assert current_state is not None<EOL>assert current_state.constraints is current_state.platform.constraints<EOL>while not self.is_shutdown():<EOL><INDENT>if not current_state.execute():<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._publish('<STR_LIT>', current_state, current_state_id, TerminateState('<STR_LIT>'))<EOL>current_state = None<EOL><DEDENT><DEDENT>except Concretize as e:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>current_state = self.fork(current_state, e.expression, e.policy, e.setstate)<EOL><DEDENT>except TerminateState as e:<EOL><INDENT>self._publish('<STR_LIT>', current_state, current_state_id, e)<EOL>logger.debug("<STR_LIT>")<EOL>if e.testcase:<EOL><INDENT>self._publish('<STR_LIT>', current_state, message=str(e))<EOL><DEDENT>current_state = None<EOL><DEDENT>except SolverError as e:<EOL><INDENT>import traceback<EOL>trace = traceback.format_exc()<EOL>logger.error("<STR_LIT>", str(e), trace)<EOL>self._publish('<STR_LIT>', current_state, current_state_id, e)<EOL>if solver.check(current_state.constraints):<EOL><INDENT>self._publish('<STR_LIT>', current_state, message="<STR_LIT>" + str(e))<EOL><DEDENT>current_state = None<EOL><DEDENT><DEDENT>except (Exception, AssertionError) as e:<EOL><INDENT>import traceback<EOL>trace = traceback.format_exc()<EOL>logger.error("<STR_LIT>", str(e), trace)<EOL>self._publish('<STR_LIT>', current_state, current_state_id, e)<EOL>current_state = None<EOL><DEDENT><DEDENT>assert current_state is None or self.is_shutdown()<EOL>self._notify_stop_run()<EOL><DEDENT>
Entry point of the Executor; called by workers to start analysis.