Problem 2467

Summary: SegFault for nOfCollision in realWorldLogVol
Product: Geant4 Reporter: weller <goodluck>
Component: digits_hits/utilsAssignee: asai
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 11.0   
Hardware: All   
OS: All   

Description weller 2022-02-02 21:50:20 CET
nOfCollision scorer attached to a realWorldLogVol deterministically yields SegFault:

Thread 2 "XYZ" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff4741700 (LWP 396225)]
0x00007ffff5819297 in G4TouchableHistory::GetReplicaNumber(int) const () from /.../lib/libG4digits_hits.so

Analogy to the other scorers suggests the following trivial fix:

diff --git a/source/digits_hits/utils/src/G4ScoreQuantityMessenger.cc b/source/digits_hits/utils/src/G4ScoreQuantityMessenger.cc
index 732acf248..659904c82 100644
--- a/source/digits_hits/utils/src/G4ScoreQuantityMessenger.cc
+++ b/source/digits_hits/utils/src/G4ScoreQuantityMessenger.cc
@@ -634,7 +634,7 @@ void G4ScoreQuantityMessenger::SetNewValue(G4UIcommand* command,
       G4PSNofCollision* ps = nullptr;
       if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
       {
-        ps = new G4PSNofCollision3D(token[0], mesh->GetCopyNumberLevel());
+        ps = new G4PSNofCollision(token[0], mesh->GetCopyNumberLevel());
       }
       else
       {
Comment 1 asai 2022-02-02 22:43:09 CET
Thank you for reporting this bug. The fix will be included in the coming patch release Geant4 version 11.0.p01.

Kind regards,
Makoto Asai