[Gate-users] help benchPET segmentation fault

Dávid Völgyes david.volgyes at gmail.com
Wed Oct 1 10:17:36 CEST 2014


Hi,

This question appears in every few weeks.
The CLHEP in the current GATE version has a bug, it tries to read 625
values from a 624 long array,
and sometimes this does not work.
It should be patched in the source code, e.g. disable this whole
printing, because it's just a debug feature, or properly terminate the
loop after 624 elements. (it prints the current state of the random
number generator.)

You can patch the Geant source code, if you compile it for yourself:
sed -i "214i if(0) " PATH_TO_GEANT/source/externals/clhep/src/MTwistEngine.cc
(This inserts a "if (0)" in front of the printing loop (line 214),
which basically disables the loop.)

Or you can disable the verbose mode of the random number generator, or
you can choose another random number generator, anything else is just
as good as the Mersenne Twister.
Disabling the verbose mode:
Comment this line out in your macros (put a # to the beginning of the line):
/gate/random/verbose 1
Or change it to:
/gate/random/verbose 0

Below you can read Gergely Patay's explanation which was sent around a
month ago.

David

On Thu, Sep 4, 2014 at 10:33 AM, Patay Gergely <patay.gergely at mediso.hu> wrote:
> Hello,
>
> this is caused by a bug in CLHEP. It was corrected since 2.2.0.0, but
> unfortunately Geant4.9.6 includes the 2.1.3.1 version.
> http://git.cern.ch/pubweb/CLHEP.git/blob/refs/heads/CLHEP_2_200_branch:/ChangeLog#l56
>
> Since this is a quite harmless bug otherwise and it occurs only at the call
> to the
> MTwistEngine::showStatus() function, a trivial workaround is to comment out
> the
> " /gate/random/verbose 1" command when you use the MersenneTwister
> generator.
>
> The choice of the RNG is more or less a matter of taste (all these
> algorithms are
> state-of-the-art quality). The different generators *should* produce the
> same
> results in a statistical sense, but of course, on an event-by-event basis
> they
> will differ.
> http://proj-clhep.web.cern.ch/proj-clhep/manual/UserGuide/Random/Random.html
>
> good luck
>  Gergely


On Wed, Oct 1, 2014 at 1:48 AM, André Miguel Monteiro
<andremiguelmonteiro90 at gmail.com> wrote:
> Hi, Gate users
> I installed all the required packages for Gate in order to start to work for
> my master thesis.
> Now when I do what is required in here :
> http://wiki.opengatecollaboration.org/index.php/Validating_Installation
> I get this:
>
> ===========================================================
> There was a crash.
> This is the entire stack trace of all threads:
> ===========================================================
> #0  0x00007f1cd66255cc in __libc_waitpid (pid=3351, stat_loc=stat_loc
> entry=0x7fffbaae9f00, options=options
> entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:31
> #1  0x00007f1cd65aa1d2 in do_system (line=<optimized out>) at
> ../sysdeps/posix/system.c:148
> #2  0x00007f1cd94430d3 in TUnixSystem::StackTrace() () from
> /home/andre/programs/root_v5.34.21/lib/libCore.so
> #3  0x00007f1cd9444ddc in TUnixSystem::DispatchSignals(ESignals) () from
> /home/andre/programs/root_v5.34.21/lib/libCore.so
> #4  <signal handler called>
> #5  CLHEP::MTwistEngine::showStatus (this=<optimized out>) at
> /home/andre/programs/2.1.3.1/CLHEP/Random/src/MTwistEngine.cc:217
> #6  0x0000000000854609 in GateApplicationMgr::StartDAQ() ()
> #7  0x0000000000801200 in
> GateApplicationMgrMessenger::SetNewValue(G4UIcommand*, G4String) ()
> #8  0x00007f1cd9de9a85 in G4UIcommand::DoIt(G4String) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #9  0x00007f1cd9e010e8 in G4UImanager::ApplyCommand(char const*) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #10 0x00007f1cd9dd8c87 in G4UIbatch::ExecCommand(G4String const&) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #11 0x00007f1cd9dda35b in G4UIbatch::SessionStart() () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #12 0x00007f1cd9dfc843 in G4UImanager::ExecuteMacroFile(char const*) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #13 0x00007f1cd9df3db2 in G4UIcontrolMessenger::SetNewValue(G4UIcommand*,
> G4String) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #14 0x00007f1cd9de9a85 in G4UIcommand::DoIt(G4String) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #15 0x00007f1cd9e010e8 in G4UImanager::ApplyCommand(char const*) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #16 0x00007f1cdd21903a in G4UIterminal::ExecuteCommand(G4String const&) ()
> from /home/andre/programs/geant4.10.00.p02-install/lib/libG4interfaces.so
> #17 0x00007f1cdd21a5e4 in G4UIterminal::SessionStart() () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4interfaces.so
> #18 0x00000000004eaf64 in main ()
> ===========================================================
>
>
> The lines below might hint at the cause of the crash.
> If they do not help you then please submit a bug report at
> http://root.cern.ch/bugs. Please post the ENTIRE stack trace
> from above as an attachment in addition to anything else
> that might help us fixing this issue.
> ===========================================================
> #5  CLHEP::MTwistEngine::showStatus (this=<optimized out>) at
> /home/andre/programs/2.1.3.1/CLHEP/Random/src/MTwistEngine.cc:217
> #6  0x0000000000854609 in GateApplicationMgr::StartDAQ() ()
> #7  0x0000000000801200 in
> GateApplicationMgrMessenger::SetNewValue(G4UIcommand*, G4String) ()
> #8  0x00007f1cd9de9a85 in G4UIcommand::DoIt(G4String) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #9  0x00007f1cd9e010e8 in G4UImanager::ApplyCommand(char const*) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #10 0x00007f1cd9dd8c87 in G4UIbatch::ExecCommand(G4String const&) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #11 0x00007f1cd9dda35b in G4UIbatch::SessionStart() () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #12 0x00007f1cd9dfc843 in G4UImanager::ExecuteMacroFile(char const*) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #13 0x00007f1cd9df3db2 in G4UIcontrolMessenger::SetNewValue(G4UIcommand*,
> G4String) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #14 0x00007f1cd9de9a85 in G4UIcommand::DoIt(G4String) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #15 0x00007f1cd9e010e8 in G4UImanager::ApplyCommand(char const*) () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4intercoms.so
> #16 0x00007f1cdd21903a in G4UIterminal::ExecuteCommand(G4String const&) ()
> from /home/andre/programs/geant4.10.00.p02-install/lib/libG4interfaces.so
> #17 0x00007f1cdd21a5e4 in G4UIterminal::SessionStart() () from
> /home/andre/programs/geant4.10.00.p02-install/lib/libG4interfaces.so
> #18 0x00000000004eaf64 in main ()
> ===========================================================
>
>
> Segmentation fault (core dumped)
>
> Does anyone give a clue on how to solve the segmentation fault problem?
>
> best regards,
> Andre
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users


More information about the Gate-users mailing list