Skip to content

Conversation

@bear-is-asleep
Copy link
Contributor

Update multipart generator to have engines run without segmentation faults. Segmentation faults occur in SBND without this patch.

@LauPM can you check this?

@FNALbuild
Copy link
Contributor

A new Pull Request was created by @bear-is-asleep (Bear Carlson) for develop.

It involves the following packages:

larsim

@LArSoft/level-1-managers, @LArSoft/level-2-managers can you please review it and eventually sign? Thanks.

cms-bot commands are listed here

@FNALbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

+code-checks

@knoepfel
Copy link
Member

@bear-is-asleep, the reason for the segfault is that the variable bool _cosmic_distribution is initialized after it is used for the first time.

The best fix would be to initialize _cosmic_distribution in the initialization list of the module:

MultiPartRain::MultiPartRain(fhicl::ParameterSet const& p)
  : EDProducer(p)
  , fFlatEngine(art::ServiceHandle<rndm::NuRandomService>()->registerAndSeedEngine(
      createEngine(0, "HepJamesRandom", "GenRain"),
      "HepJamesRandom",
      "GenRain"))
  , _cosmic_distribution{p.get<bool>("CosmicDistribution", false)} // <== Initialize before use
{
 // ... a bunch of code that can now use _cosmic_distribution
}

@lgarren lgarren moved this to Awaiting triage in LArSoft pull requests Oct 27, 2025
@knoepfel knoepfel moved this from Awaiting triage to Under discussion in LArSoft pull requests Oct 27, 2025
@bear-is-asleep
Copy link
Contributor Author

bear-is-asleep commented Oct 28, 2025

, _cosmic_distribution{p.get<bool>("CosmicDistribution", false)}

It successfully builds locally after the most recent commit. Thank you for the suggestion!

@knoepfel
Copy link
Member

, _cosmic_distribution{p.get<bool>("CosmicDistribution", false)}

It successfully builds locally after the most recent commit. Thank you for the suggestion!

No problem. Actually, that one change should be sufficient to resolve the segfault—you shouldn't need the other commits. Can you adjust this PR to contain only the change in initializing the Boolean variable?

@bear-is-asleep
Copy link
Contributor Author

ge in initializing the Boolean variable?

, _cosmic_distribution{p.get<bool>("CosmicDistribution", false)}

It successfully builds locally after the most recent commit. Thank you for the suggestion!

No problem. Actually, that one change should be sufficient to resolve the segfault—you shouldn't need the other commits. Can you adjust this PR to contain only the change in initializing the Boolean variable?

Ah I got it, just updated the PR to only use the boolean. I checked and it locally builds and runs.

@lgarren lgarren moved this from Under discussion to Approval in progress in LArSoft pull requests Oct 30, 2025
@lgarren
Copy link
Member

lgarren commented Oct 30, 2025

trigger build

@FNALbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

Pull request #162 was updated. @LArSoft/level-2-managers, @LArSoft/level-1-managers can you please check and sign again.

@FNALbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

+code-checks

@FNALbuild
Copy link
Contributor

@FNALbuild
Copy link
Contributor

@FNALbuild
Copy link
Contributor

@FNALbuild
Copy link
Contributor

@FNALbuild
Copy link
Contributor

@FNALbuild
Copy link
Contributor

@lgarren
Copy link
Member

lgarren commented Oct 30, 2025

approve

@FNALbuild
Copy link
Contributor

This pull request is fully signed and it will be merged to develop and built in the next LArSoft release after it passes the integration tests.

@lgarren lgarren merged commit bc68312 into LArSoft:develop Oct 30, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Approval in progress to Merged into develop in LArSoft pull requests Oct 30, 2025
@lgarren lgarren moved this from Merged into develop to Included in release in LArSoft pull requests Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Included in release

Development

Successfully merging this pull request may close these issues.

4 participants