When a member function of "track" such as "track->GetCreatorProcess()" is called in "G4UserTrackingAction::PostUserTrackingAction(const G4Track* track)", i.e., "fpUserTrackingAction->PostUserTrackingAction(fpTrack);" in "G4TrackingManager::ProcessOneTrack(G4Track* apValueG4Track)", a "segmentation fault" error will ocuur.
UserTrackingAction is what you provided. Debug your code, please.
Created attachment 744 [details] The class I derived from G4UserTrackingAction The header of the class I derived from G4UserTrackingAction
Created attachment 745 [details] The definition of "PostUserTrackingAction(const G4Track*)"
Created attachment 746 [details] The program crashed
Maybe I didn't make it clear. I created "class TrackingAction" derived from "G4UserTrackingAction". Then I overrode the member function "virtual void PostUserTrackingAction(const G4Track*)", where I call the member functions of "G4Track", for example, "G4String creatorProcessName = track->GetCreatorProcess()->GetProcessName();" Then the program crashed。 You can see the pictures I submitted.
Please debug your program by yourself. I cannot afford to help you privately. We, developers, are unpaid volunteers.