Problem 1673

Summary: Crash in 10.1.beta in GPS with many threads
Product: Geant4 Reporter: Andrea Dotti <andrea.dotti>
Component: eventAssignee: Andrea Dotti <andrea.dotti>
Status: RESOLVED FIXED    
Severity: minor CC: matthewl.lund
Priority: P5    
Version: other   
Hardware: All   
OS: All   

Description Andrea Dotti 2014-09-04 17:01:02 CEST
Report from Gunter/Luciano

Hello Luciano,

This crash only is seen in multi-threading runs, and only when there are
many threads (16). The trace-back of all threads is attached, and I
copied the relevant part below. The offender seems to be
GeneralParticleSource(Data):
#9  GetSourceProbability (idx=<optimized out>, this=<optimized out>)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/event/include/G4GeneralParticleSourceData.hh:83
#10 G4GeneralParticleSource::GeneratePrimaryVertex (this=0x7f24f40d2ff0,
   evt=0x7f24f4286020)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/event/src/G4GeneralParticleSource.cc:190


I tried to print idx, or i, but these are not available. I join the
content of GPSData.

(gdb) p i
$2 = <optimized out>
(gdb) p GPSData
$3 = (G4GeneralParticleSourceData *) 0x7f25159b73c0
<G4GeneralParticleSourceData::Instance()::instance>
(gdb) p *GPSData
$4 = {sourceVector = {<std::_Vector_base<G4SingleParticleSource*,
std::allocator<G4SingleParticleSource*> >> = {
     _M_impl = {<std::allocator<G4SingleParticleSource*>> =
{<__gnu_cxx::new_allocator<G4SingleParticleSource*>> = {<No data
fields>}, <No data fields>}, _M_start = 0x21938b0,
       _M_finish = 0x21938c0, _M_end_of_storage = 0x21938c0}}, <No data
fields>}, sourceIntensity = {<std::_Vector_base<double,
std::allocator<double> >> = {
     _M_impl = {<std::allocator<double>> =
{<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data
fields>}, _M_start = 0x2193920, _M_finish = 0x2193930,
       _M_end_of_storage = 0x2193930}}, <No data fields>},
sourceProbability = {<std::_Vector_base<double, std::allocator<double>
= {
     _M_impl = {<std::allocator<double>> =
{<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data
fields>}, _M_start = 0x2193940, _M_finish = 0x2193950,
       _M_end_of_storage = 0x2193950}}, <No data fields>},
flat_sampling = false, normalised = true, currentSourceIdx = 0,
currentSource = 0x21921a0, mutex = {__data = {__lock = 0,
     __count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0,
__list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39
times>, __align = 0}}


Thread 1 (Thread 0x7f2505ffd700 (LWP 26354)):
#0  0x0000003c5dc328a5 in raise () from /lib64/libc.so.6
#1  0x0000003c5dc34085 in abort () from /lib64/libc.so.6
#2  0x00007f25117a0a35 in __gnu_cxx::__verbose_terminate_handler() ()
  from
/afs/cern.ch/sw/lcg/contrib/gcc/4.8/x86_64-slc6-gcc48-opt/lib64/libstdc++.so.6
#3  0x00007f251179eba6 in ?? ()
  from
/afs/cern.ch/sw/lcg/contrib/gcc/4.8/x86_64-slc6-gcc48-opt/lib64/libstdc++.so.6
#4  0x00007f251179ebd3 in std::terminate() ()
  from
/afs/cern.ch/sw/lcg/contrib/gcc/4.8/x86_64-slc6-gcc48-opt/lib64/libstdc++.so.6
#5  0x00007f251179edfe in __cxa_throw ()
  from
/afs/cern.ch/sw/lcg/contrib/gcc/4.8/x86_64-slc6-gcc48-opt/lib64/libstdc++.so.6
#6  0x00007f25117f3e47 in std::__throw_out_of_range(char const*) ()
  from
/afs/cern.ch/sw/lcg/contrib/gcc/4.8/x86_64-slc6-gcc48-opt/lib64/libstdc++.so.6
#7  0x00007f2515769a6f in _M_range_check (__n=<optimized out>,
   this=<optimized out>)
   at
/afs/cern.ch/sw/lcg/contrib/gcc/4.8.1/x86_64-slc6-gcc48-opt/include/c++/4.8.1/bits/stl_vector.h:794
#8  at (__n=<optimized out>, this=<optimized out>)
   at
/afs/cern.ch/sw/lcg/contrib/gcc/4.8.1/x86_64-slc6-gcc48-opt/include/c++/4.8.1/bits/stl_vector.h:830
#9  GetSourceProbability (idx=<optimized out>, this=<optimized out>)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/event/include/G4GeneralParticleSourceData.hh:83
#10 G4GeneralParticleSource::GeneratePrimaryVertex (this=0x7f24f40d2ff0,
   evt=0x7f24f4286020)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/event/src/G4GeneralParticleSource.cc:190
#11 0x00007f25159fe342 in G4WorkerRunManager::GenerateEvent (
   this=0x7f24f4031ed0, i_event=<optimized out>)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/run/src/G4WorkerRunManager.cc:334
#12 0x00007f25159fc05d in G4WorkerRunManager::ProcessOneEvent (
   this=0x7f24f4031ed0, i_event=<optimized out>)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/run/src/G4WorkerRunManager.cc:244
#13 0x00007f25159fc1f2 in G4WorkerRunManager::DoEventLoop (
   this=0x7f24f4031ed0, n_event=10, macroFile=0x0, n_select=-1)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/run/src/G4WorkerRunManager.cc:225
#14 0x00007f25159f06b4 in G4RunManager::BeamOn (this=0x7f24f4031ed0,
   n_event=10, macroFile=0x0, n_select=-1)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/run/src/G4RunManager.cc:271
#15 0x00007f2515a05dcf in G4MTRunManagerKernel::StartThread (
   context=<optimized out>)
   at
/ec/G4-builds/nightly/slc6-gcc48-MTmax/g4tags-dev/source/run/src/G4MTRunManagerKernel.cc:249
#16 0x0000003c5e807851 in start_thread () from /lib64/libpthread.so.0
#17 0x0000003c5dce811d in clone () from /lib64/libc.so.6
(gdb)
Comment 1 Andrea Dotti 2014-09-23 00:18:11 CEST
The problem has been partially addressed with the redesign of GPS in 10.1.beta.
However the new redesign is not yet complete and more analysis has to be done: the specific problem here reported should be fixed in ref-07, but others are still present. Thus I prefer to leave this open.

Andrea
Comment 2 Andrea Dotti 2014-11-17 18:53:36 CET
The new GPS system for 10.1 has been accepted and will be released with next version of G4. The new re-design should solve these problems.