Problem 2467 - SegFault for nOfCollision in realWorldLogVol
Summary: SegFault for nOfCollision in realWorldLogVol
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: digits_hits/utils (show other problems)
Version: 11.0
Hardware: All All
: P4 normal
Assignee: asai
URL:
Depends on:
Blocks:
 
Reported: 2022-02-02 21:50 CET by weller
Modified: 2022-02-02 22:43 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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