Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not delete NoProcess instances in G4HepEmTrackingManager #103

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

drbenmorgan
Copy link
Contributor

In testing AdePT "CPU only" mode using G4HepEm, discovered that use of G4HepEmTrackingManager in same fashion as the AdePT tracking manager resulted in a segmentation fault at program exit. This was traced to the destructor of G4HepEmTrackingManager deleting the G4HepEmNoProcess instances it creates. These are important for mapping back to user code information about the process limiting/creating a step. All tracking managers are deleted by G4RunManager after the deletion of G4ProcessTable which nominally owns all instances of G4VProcess.

Remove deletion of G4HepEmNoProcess instances in destructor of G4HepEmTrackingManager, leaving their deletion of the destructor of G4ProcessTable. This matches the pattern seen in Geant4's physics constructor classes.

In testing AdePT "CPU only" mode using G4HepEm, discovered that
use of G4HepEmTrackingManager in same fashion as the AdePT tracking
manager resulted in a seg fault at program exit. Traced to destructor
of G4HepEmTrackingManager deleting the G4HepEmNoProcess instances it
creates. These are important for mapping back to user code information
about the process limiting/creating a step. All tracking managers are
deleted after the deletion of the G4ProcessTable which nominally owns
all instances of G4VProcess.

Remove deletion of G4HepEmNoProcess instances in destructor of
G4HepEmTrackingManager, leaving their deletion of the destructor of
G4ProcessTable. This matches the pattern seen in physics constructor
classes.
@mnovak42 mnovak42 merged commit 31b53f8 into mnovak42:master Jul 26, 2024
3 checks passed
drbenmorgan added a commit to drbenmorgan/celer-adept that referenced this pull request Jul 31, 2024
A small issue was identified G4HepEmTrackingManager that resulted
in a segfault at G4RunManager destruction due to a double deletion
of G4HepEmNoProcess objects:

mnovak42/g4hepem#103

Though this is merged to master, we can't rely on installs having this
latest version. Temporarily import latest implementation of
G4HepEmTrackingManager, using this in place of whatever we get from
G4HepEM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants