Message: too much particles generated in PrimaryGeneratorAction caused core dumped Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question too much particles generated in PrimaryGeneratorAction caused core dumped 

Forum: Particles
Date: 29 Mar, 2010
From: Neoh <Neoh>

Hi,

I'm using geant4.9.3 on Fedora 12. I'm building a simple simulation where deuteron beams are shot towards a thin beryllium plate and measure its neutron and gamma distributions.

My problem is, whenever I initialize the particle gun with too many particles in PrimaryGeneratorAction.cc, it will cause segmentation error. For example, if in one beam I shoot 1 million particles, after finishing one event the program will ends with the error (from gdb)

Program received signal SIGSEGV, Segmentation fault.
0x034edaaa in G4PrimaryParticle::~G4PrimaryParticle (this=0xc01c298, __in_chrg=<value optimized out>)
    at src/G4PrimaryParticle.cc:106
106	G4PrimaryParticle::~G4PrimaryParticle()
(gdb) bt
#0  0x034edaaa in G4PrimaryParticle::~G4PrimaryParticle (this=0xc01c298, __in_chrg=<value optimized out>)
    at src/G4PrimaryParticle.cc:106
#1  0x034edad1 in G4PrimaryParticle::~G4PrimaryParticle (this=0xc01c230, __in_chrg=<value optimized out>)
    at src/G4PrimaryParticle.cc:109
#2  0x034edad1 in G4PrimaryParticle::~G4PrimaryParticle (this=0xc01c1c8, __in_chrg=<value optimized out>)

and it stops. If I initialized with 10^8 particles, the program could not run at all. A backtrace gives

### Run 0 start.
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Program received signal SIGABRT, Aborted.
0x006da424 in __kernel_vsyscall ()
(gdb) bt
#0  0x006da424 in __kernel_vsyscall ()
#1  0x02b31a91 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0x02b3335a in abort () at abort.c:92
#3  0x028b4a77 in __gnu_cxx::__verbose_terminate_handler ()
    at ../../../../libstdc++-v3/libsupc++/vterminate.cc:93
#4  0x028b28f6 in __cxxabiv1::__terminate (handler=
    0x28b4910 <__gnu_cxx::__verbose_terminate_handler()>)
    at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38
#5  0x028b2933 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
#6  0x028b2a72 in __cxxabiv1::__cxa_throw (obj=0xbfeffdc8, tinfo=0x28e5f5c, dest=
    0x28b2f10 <std::bad_alloc::~bad_alloc()>) at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:83
#7  0x028b3007 in operator new (sz=1008) at ../../../../libstdc++-v3/libsupc++/new_op.cc:58
#8  0x028b30ee in operator new[] (sz=1008) at ../../../../libstdc++-v3/libsupc++/new_opv.cc:32
#9  0x01e0b9a3 in G4AllocatorPool::G4PoolChunk::G4PoolChunk (this=0xbfeffd58, sz=1008)
    at include/G4AllocatorPool.hh:86
#10 0x01e0b8bc in G4AllocatorPool::Grow (this=0x3a7e920) at src/G4AllocatorPool.cc:115
#11 0x0051aacd in G4AllocatorPool::Alloc (this=0x3a7e920)
    at /home/neohys/geant4/geant4.9.3/include/G4AllocatorPool.hh:116
#12 0x00df2387 in G4Allocator<G4PrimaryParticle>::MallocSingle (this=0x3a7e920)
    at /home/neohys/geant4/geant4.9.3/source/global/management/include/G4Allocator.hh:179
#13 0x00df1e96 in G4PrimaryParticle::operator new ()
    at /home/neohys/geant4/geant4.9.3/source/particles/management/include/G4PrimaryParticle.hh:219
#14 0x02f6029c in G4ParticleGun::GeneratePrimaryVertex (this=0x818b560, evt=0x9522a90)
    at src/G4ParticleGun.cc:216

Is there suppose a limit in the number of particles that I can initialize in a beam? Because I plan to simulate 5Coulomb of deuteron beam, does that mean I need to break smaller number of particles into different events?

Thanks for your attention

Neoh

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

1 Note: Re: too much particles generated in PrimaryGeneratorAction caused core dumped   (Juan - 29 Mar, 2010)
 Add Message Add Message
to: "too much particles generated in PrimaryGeneratorAction caused core dumped"

 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 ]