Erreur de segmentation (core dumped)

Please fill out the following information to help in answering your question, and also see tips for posting code snippets

_Geant4 Version:4.11.2
_Operating System:ubuntu 20.04

Hello everybody,
I have a problem when recovering the quantities (energy and position) at each point located in my detector.
it returns core dumped and I used geant4 in debug mode and got the image below.
it talks about a null pointer, but I don’t know which one.
So I would like some help.
Attached is my detector with its hits and sd.
Thank you so much
cordially Raoul (1.6 KB) (336 Bytes) (1.3 KB)
DetectorConstruction.hh (624 Bytes)
myHit.hh (527 Bytes)
mySD.hh (569 Bytes) (1.3 KB) (main file)

You should run bt or backtrace in gdb to trace the line in code where that null pointer is coming from. Given the info that is there, it’s likely to be a call somewhere in your code that is calling SetSensitiveDetector on a logical volume you’ve (not!) constructed. The this=0x0 this pointer suggests something like the following pseudocode:

G4LogicalVolume* p = somehow gets set to nullptr;

/// later on

1 Like

okay, thanks you so much.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.