Skip to content

improve region initialization and fix parallel geometry segfault - #1111

Merged
nkrah merged 2 commits into
masterfrom
debug-parallel-world-segfault
Aug 1, 2026
Merged

improve region initialization and fix parallel geometry segfault#1111
nkrah merged 2 commits into
masterfrom
debug-parallel-world-segfault

Conversation

@nkrah

@nkrah nkrah commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Fix segfault when a region is attached to a volume in a parallel world.

The root cause was the region lifecycle introduced around the G4-DNA work: regions could be initialized too early, before parallel-world logical volumes existed. That timing pressure comes from the DNA EM physics activator, which needs region names/configuration available before physics construction, but the actual G4Region attachment must wait until the corresponding logical volumes have been constructed.

This PR changes the region initialization workflow accordingly:

  • attach regions lazily as each root logical volume is constructed, in both the mass world and parallel worlds
  • keep production cuts and user limits initialization after G4RunManager.Initialize()
  • add early validation for inconsistent region configuration

This preserves the DNA-region workflow while avoiding the premature attachment that caused the segfault.

@nkrah
nkrah merged commit ed4f620 into master Aug 1, 2026
32 checks passed
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.

1 participant