Problem 740 - Two AtRestProcesses in Tandem
Summary: Two AtRestProcesses in Tandem
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: tracking (show other problems)
Version: 7.0
Hardware: PC Linux
: P4 normal
Assignee: gum
URL:
Depends on:
Blocks:
 
Reported: 2005-04-12 12:00 CEST by gum
Modified: 2005-04-29 00:58 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description gum 2005-04-12 12:00:04 CEST
I can crash exampleN06, (G4Scintillation and G4Decay AtRestDoIt)

#0  0x081753dc in G4SteppingManager::InvokeAtRestDoItProcs() ()
(gdb) where
#0  0x081753dc in G4SteppingManager::InvokeAtRestDoItProcs() ()
#1  0x081770dd in G4SteppingManager::Stepping() ()
#2  0x08169321 in G4TrackingManager::ProcessOneTrack(G4Track*) ()
#3  0x081572a0 in G4EventManager::DoProcessing(G4Event*) ()
#4  0x08142849 in G4RunManager::DoEventLoop(int, char const*, int) ()
#5  0x08142308 in G4RunManager::BeamOn(int, char const*, int) ()
#6  0x0814b2df in G4RunMessenger::SetNewValue(G4UIcommand*, G4String) ()
#7  0x08253abc in G4UIcommand::DoIt(G4String) ()
#8  0x0826167b in G4UImanager::ApplyCommand(char const*) ()
#9  0x0826a4ae in G4UIbatch::SessionStart() ()
#10 0x0825f8cd in G4UImanager::ExecuteMacroFile(char const*) ()
#11 0x0826f117 in G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) ()
#12 0x08253abc in G4UIcommand::DoIt(G4String) ()
#13 0x0826167b in G4UImanager::ApplyCommand(char const*) ()
#14 0x0804f98b in main ()
#15 0x42015704 in __libc_start_main () from /lib/tls/libc.so.6

 by changing in ExN06PhysicsList.cc to:

void ExN06PhysicsList::ConstructGeneral()
{
  // Add Decay Process
  G4Decay* theDecayProcess = new G4Decay();
  theParticleIterator->reset();
  while( (*theParticleIterator)() ){
    G4ParticleDefinition* particle = theParticleIterator->value();
    G4ProcessManager* pmanager = particle->GetProcessManager();
    if (theDecayProcess->IsApplicable(*particle)) {
      pmanager ->AddProcess(theDecayProcess);
      // set ordering for PostStepDoIt and AtRestDoIt
      pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
      pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
    }
  }
}

i.e. add "decay at rest" as copied from N03.

and change in exampleN06.in to mu+:

/gun/particle mu+

The problem is in G4SteppingManager2.cc at:

// invoke selected process
   for(size_t np=0; np < MAXofAtRestLoops; np++){
   //
   // Note: DoItVector has inverse order against GetPhysIntVector
   //       and SelectedAtRestDoItVector.
   //
     if( (*fSelectedAtRestDoItVector)[MAXofAtRestLoops-np-1] != InActivated){

       fCurrentProcess = (*fAtRestDoItVector)[np];
       fParticleChange
         = fCurrentProcess->AtRestDoIt( *fTrack, *fStep);

MAXofAtRestLoops == 2 as it should, but when np == 1, the pointer
fCurrentProcess is NULL - BINGO:

fCurrentProcess->AtRestDoIt
Comment 1 Takashi.Sasaki 2005-04-22 02:11:59 CEST
I tried to inactivate the other process, say, msc or Cerenkov,  but core dump
did not happen. Only when I inactivate Scinitilation from the command line, core
dump happened. Please investigate what's happen when Scinitilation was
inactivated from the command line.  I will check the argorithm in
SteppingManager to interact with the process manager.
Comment 2 kurasige 2005-04-29 00:58:59 CEST
The crash was caused by a bug in G4Decay.
GetPhysicalInteractionLengthAtRest of G4Decay did not set 'condtion'. So,
DecayAtRest was treated as "Forced" in this case. SteppingManager could not
treat the case that only "Forced" processes are activated in AtRestDoIt.
Fixd G4Decay has been commited and will be included in the next release (or patch)