Message: Crazy Point in G4Field::GetFieldValue() Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Crazy Point in G4Field::GetFieldValue() 

Forum: Fields: Magnetic and Otherwise
Date: 17 Dec, 2005
From: Tom Roberts <Tom Roberts>

In Geant4 7.1, my program occasionally crashes with a segment fault in my GetFieldValue(). This is caused by its argument Point[] being an array of 4 NaN-s. That's crazy -- why should the Geant4 tracking ever generate a Point that is four not-a-number?

This is quite rare, occuring a few times out of 400 million events (800 500k-event jobs on a cluster). I can trace it to tracking a pi+ inside an Al beam pipe (much of the rarity is because most particles don't hit the beam pipes). As I am not interested in particles that hit beam pipes, I have a workaround by killing any particle inside a beam pipe. But soon I will be looking at backgrounds from that....

I am using the physics use case LHEP_BIC.

When I compile and run with G4DEBUG=1, the problem does not occur. This implies that Point[] is probably not initialized when this fault happens; that is deep inside Geant4 code. My program seeds the random number generator with the event# and resets RanGauss(), so I can reliably re-run specific events. I put check code in GetFieldValue() to print "NaN" and force a coredump whenever Point[0] != Point[0] (i.e. Point[0] is NaN); the backtrace below did that.

With G4DEBUG=0 all I can get is the stack traceback from the core file (levels 0,14,15 are mine):

(gdb) backtrace

#0  0x080ad57e in BLGlobalField::GetFieldValue ()
#1  0x08a29768 in G4ClassicalRK4::DumbStepper ()
#2  0x08a2a65f in G4MagErrorStepper::Stepper ()
#3  0x08a2c764 in G4MagInt_Driver::QuickAdvance ()
#4  0x08a28881 in G4ChordFinder::FindNextChord ()
#5  0x08a2826b in G4ChordFinder::AdvanceChordLimited ()
#6  0x08a3a9c4 in G4PropagatorInField::ComputeStep ()
#7  0x08327e17 in G4Transportation::AlongStepGetPhysicalInteractionLength ()
#8  0x082fda88 in G4SteppingManager::DefinePhysicalStepLength ()
#9  0x082fbded in G4SteppingManager::Stepping ()
#10 0x082f027d in G4TrackingManager::ProcessOneTrack ()
#11 0x082e3ee6 in G4EventManager::DoProcessing ()
#12 0x082cd9ee in G4RunManager::DoEventLoop ()
#13 0x082cd4c1 in G4RunManager::BeamOn ()
#14 0x080c239e in BLManager::trackBeam ()
#15 0x0805ee07 in main ()

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Crazy Point in G4Field::GetFieldValue()   ( - 17 Dec, 2005)
1 None: Re: Crazy Point in G4Field::GetFieldValue()   (Tom Roberts - 17 Dec, 2005)
1 Feedback: Re: Crazy Point in G4Field::GetFieldValue()   (John Apostolakis - 18 Dec, 2005)
... 4 Message(s)
3 None: Re: Crazy Point in G4Field::GetFieldValue()   ( - 18 Dec, 2005)
3 None: Re: Crazy Point in G4Field::GetFieldValue()   ( - 20 Jun, 2007)
 Add Message Add Message
to: "Crazy Point in G4Field::GetFieldValue()"

 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 ]