Message: Magnetic Field and G4SmoothTrajectoryPoint Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Magnetic Field and G4SmoothTrajectoryPoint 

Keywords: magnetic field
Forum: Event and Track Management
Date: 15 Jan, 2004
From: Keven L. Ates <atescomp1@comcast.net>

I'm having a problem running a calorimeter simulation with a magnetic field turned on (based on ExN03). After the first event ends I get:

...
spong: G4IdentityTrajectoryFilter::TakeIntermediatePoint
spong: G4IdentityTrajectoryFilter::TakeIntermediatePoint
---> End of Event: 0
   Energy: Absorber, 5x5, Gap, Cryo => 967.763 MeV, 936.795 MeV,       0 eV , 5.09245 MeV
    Track: Absorber, Gap, Cryo      => 2.49546 m  ,                    0 fm ,   1.145 cm
    Number of Hits Stored: 55

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 4551)] 0x41888d2e in _int_free () from /lib/libc.so.6 (gdb) where

#0  0x41888d2e in _int_free () from /lib/libc.so.6
#1  0x41887a5f in free () from /lib/libc.so.6
#2  0x400a0cd1 in operator delete(void*) () from /usr/lib/libGLU.so.1
#3  0x417ca90c in std::__default_alloc_template<true, 0>::deallocate(void*, unsigned) () from /usr/lib/libstdc++.so.5
#4  0x08172da3 in G4SmoothTrajectoryPoint::~G4SmoothTrajectoryPoint() ()
#5  0x0816adbe in G4SmoothTrajectory::~G4SmoothTrajectory() ()
#6  0x0814932a in G4Event::~G4Event() ()
#7  0x08130849 in G4RunManager::StackPreviousEvent(G4Event*) ()
#8  0x0813032b in G4RunManager::DoEventLoop(int, char const*, int) ()
#9  0x0812fc39 in G4RunManager::BeamOn(int, char const*, int) ()
#10 0x0813b6c8 in G4RunMessenger::SetNewValue(G4UIcommand*, G4String) ()
#11 0x08265665 in G4UIcommand::DoIt(G4String) ()
#12 0x0827269c in G4UImanager::ApplyCommand(char const*) ()
#13 0x0827bea9 in G4UIbatch::SessionStart() ()
#14 0x0827044e in G4UImanager::ExecuteMacroFile(char const*) ()
#15 0x08281952 in G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) ()
#16 0x08265665 in G4UIcommand::DoIt(G4String) ()
#17 0x0827269c in G4UImanager::ApplyCommand(char const*) ()
#18 0x08271d5a in G4UImanager::ApplyCommand(G4String) ()
#19 0x081276fc in G4UIterminal::ExecuteCommand(G4String) ()
#20 0x081273d8 in G4UIterminal::SessionStart() ()
#21 0x080ba64b in main (argc=1, argv=0xbfffec44) at SuperBaBar.cc:130
#22 0x418268ae in __libc_start_main () from /lib/libc.so.6
(gdb) exit

As you can see, the problem is in:
   G4SmoothTrajectoryPoint::~G4SmoothTrajectoryPoint()

Its code is:
   G4SmoothTrajectoryPoint::~G4SmoothTrajectoryPoint()
   {
     if(fAuxiliaryPointVector) {
       delete fAuxiliaryPointVector;
     }
   }

The variable fAuxiliaryPointVector is a pointer passed into the class by only one of its several constructors. The other constructors set it to zero.

QUESTION: Why is it trying to delete it when it is not responsible
          for creating it?  It may not even be created with new!

I believe the problem is happening when the function creating the vector has already deleted or it is not newed.

Any thoughts? I'm dead in the water without this working.

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

1 None: Re: Magnetic Field and G4SmoothTrajecoryPoint   (michel maire - 15 Jan, 2004)
(_ None: Re: Magnetic Field and G4SmoothTrajecoryPoint   (John Allison - 19 Jan, 2004)
 Add Message Add Message
to: "Magnetic Field and G4SmoothTrajectoryPoint"

 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 ]