NULL pointer dereference Problem in UVM

In reply to UVM_LOVE:

Your problem is here:

  task pre_body();
    starting_phase.raise_objection(this, get_type_name());
    `uvm_info(get_type_name(), "raise objection", UVM_MEDIUM)
  endtask : pre_body

  task post_body();
    starting_phase.drop_objection(this, get_type_name());
    `uvm_info(get_type_name(), "drop objection", UVM_MEDIUM)
  endtask : post_body

The starting phase has not been set. When commenting out both tasks. It works.
3 additional things:
(1) be carefull using the obhection mechanism. The best place is the test.
(2) when using `uvm_do the pre_body and post_body task are not executed automatically.
(3) in the build_phase the UVM components will be constructed. The sequences are uvm_objects and not components. They will be constructed on the body task.