I am testing some thing related to parallelization stuff and I ran into
problem. I have a global object A that is an instance of some class B. The
class has a member C which is a pointer to another object D. In the
constructor for class B, dynamically memory is allocated and the address
is stored in C. Since A is a global object, so the constructor is called
very early (before the sim_objects have been constructed in C++ code). The
object A was being used somewhere in the construction of some sim_object.
The execution incurred a segmentation fault when it tried to access the
memory pointed to by C. In fact gdb tells me that the value in C is 0x0.

Is such behaviour expected? Or is it that I am doing something wrong and
not able to make out the error I am doing?

--
Nilay

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to