I'm doing the follow:
I work with model checking and I have to keep a trace ( e.g., a execution of the system, represented by a set of states). So, each state is a instance of aut_st.
An instance of aut_st has a variable dimension and info ( info is a pointer to int and can be any size).
Then, to keep all the states that belong to the same trace I declared a list of aut_st this way:
list<aut_st> trace;
Before call the method that will mount and keep the trace in the list I do the follow:
1 2 3 4 5
|
aut_st state;
state.create(ReachSS.Levels());
trace.push_back(state);
|
The code above declares a new instance of aut_st and set it up with a size defined by ReachSS.Levels(), for example, 3, then I push the state in the list trace. This first state represents the initial state of my system.
After this first step, I call the method that will keep mounting the trace ( mountTrace() ).
the code below is part of the method
1 2 3 4 5 6 7 8 9 10 11 12
|
//here I take the next state of that initial state, that is encoded by ka and pa
ReachSS.Intersection(ka, pa, kResults.front(), pResults.front(), ka, pa);
//here I set the state encoded by ka and pa in the local variable state
ReachSS.MTMDD::State(ka, pa, 0, state);
cout << "the state was added" << endl;
//here I push the state in the list
trace.push_back(state);
|
The error (core dumped or glibc detected) occurs exatly when I try to push the second state in the list, right after the
cout << "the state was added" << endl;
I don't know how to allocate memory to each state of the list before try to push, do you get it ? If it is the right thing to do.
I think that when I declared
list<aut_st> trace;
I did a list of empty objects aut_st, didn't ?