Hi,

On Thu, 4 Apr 2024 00:32:02 +0530
Adarsh Sudheer <adarshs2...@gmail.com> wrote:

> Recently i tried to map the current the executionstate to it's left and
> right nodes using execution tree and all seemed fine until I encountered
> various segmentation errors. Firsty, in the ExecutionState class
> definition, i defined my new attribute as like this

I'm not sure what you are trying to achieve but keep in mind that only
leaf nodes in the execution tree carry a state.

> I tried to then insert the states like this
> 
> if(IS_OUR_NODE_VALID(p->left) && IS_OUR_NODE_VALID(p->right)){
> p->state->NextStates.push_back(p->left.getPointer()->state);
> p->state->NextStates.push_back(p->right.getPointer()->state);
> }
> else if(IS_OUR_NODE_VALID(p->left)){
> p->state->NextStates.push_back(p->left.getPointer()->state);
> p= p->left.getPointer();
> }
> else{
> p->state->NextStates.push_back(p->right.getPointer()->state);
> p= p->right.getPointer();
> }
> 
> 
> I was relieved when the build didn't raised any error but when i tried to
> get the intermediate results (not included) , I repeatedly get seg-fault.

The joys of C++. :)

>  #4 0x000055757d0c292e std::vector<klee::ExecutionState*,
> std::allocator<klee::ExecutionState*> >::push_back(klee::ExecutionState*
> const&) /usr/include/c++/11/bits/stl_vector.h:1189:20
>  #5 0x000055757d0c292e klee::RandomPathSearcher::selectState()

Seems that you modified the RandomPathSearcher. Can you show the rest of
the select() function?

> How can i include execution state as a template in maps and vectors

Putting pointers to ExecutionStates in a container is not an issue, we
do it all the time. It becomes an issue when states get terminated and
you still try to access them via their stale pointers.


Kind regards,

Frank

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

Reply via email to