Message: Re: Segmentation fault with Geant4 10.1 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Segmentation fault with Geant4 10.1 

Forum: Geometry
Re: None Segmentation fault with Geant4 10.1 (Marco Pinto)
Re: None Re: Segmentation fault with Geant4 10.1 (Makoto Asai)
Date: 06 Mar, 2015
From: Marco Pinto <Marco Pinto>

Dear Makoto Asai,

thank you for your prompt reply.

However, I do not think that what you proposed is the problem. Both the HadrontherapySteppingAction source file and my code make the check if the step was in the target and not in the world.

For example, in my code I have (world volume has copy number -1):

G4VPhysicalVolume* preStepPhysical = preStepPoint->GetPhysicalVolume();
G4VPhysicalVolume* postStepPhysical = postStepPoint->GetPhysicalVolume();

// The track does not exist
if(preStepPhysical == 0 || postStepPhysical == 0) return;
// Both steps are in the World
if(preStepPhysical->GetCopyNo() == -1 && postStepPhysical->GetCopyNo() == -1) return;

const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
const G4int ix = touchable->GetReplicaNumber(1);
const G4int iy = touchable->GetReplicaNumber(2);
const G4int iz = touchable->GetReplicaNumber(0);

In addition, in the hadrontherapy example I check the volumes as well and this segmentation fault does not happen in the world. Moreover, all the codes work with Geant4 versions 10.00.p2 and 10.00.p3 (the ones I tested). If indeed the problem was a null pointer coming from a world step, the problem would happen as well for those versions, right?

Best regards,

 Add Message Add Message
to: "Re: Segmentation fault with Geant4 10.1"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]