Hi everyone,
I’m running into a segmentation fault when executing my Geant4 application. When I debug with gdb, I get the following backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6f541d0 in G4LogicalVolume::SetSensitiveDetector(G4VSensitiveDetector*)
from /usr/local/lib/libG4geometry.so
(gdb) bt
#0 0x00007ffff6f541d0 in G4LogicalVolume::SetSensitiveDetector(G4VSensitiveDetector*)
from /usr/local/lib/libG4geometry.so
#1 0x000055555555ed27 in MyDetectorConstruction::ConstructSDandField()
#2 0x00007ffff76326c5 in G4RunManager::InitializeGeometry()
from /usr/local/lib/libG4run.so
#3 0x00007ffff7632874 in G4RunManager::Initialize()
from /usr/local/lib/libG4run.so
#4 0x000055555555b0ae in main ()
These are the functions I’m using in my sensitive detector class:
G4bool MySensitiveDetector::ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist) {
return true;
}
Another one:
void MyDetectorConstruction::ConstructSDandField()
{
MySensitiveDetector *sensDet = new MySensitiveDetector("SensitiveDetector");
logicDetector->SetSensitiveDetector(sensDet);
}
Thak you!
- Geant4 Version: 11.2.1
- Operating System: Ubuntu 22.04 LTS (64-bit)
- Compiler/Version: GCC 11.4.0
- CMake Version: 3.22.1
I’m using the latest available versions.