Segmentation violation when running BDSIM

Issue #174 resolved
A Schuetz created an issue

I am running BDSIM with the following command:

bdsim --file=atf2.gmad --output=root --outfile=test1_03022017 --batch --seed=1 --verbose

And it breaks immediately when reading the options.gmad file, which contains:

! Sat, 13 Jun 2015 07:10:06 +0000                                                                     
! pybdsim.Builder
! OPTIONS DEFINITION

option,
        tunnelRadius=1*m,
  outerDiameter=50*cm,
  beampipeThickness=2*mm,
  beampipeRadius=12*mm,
  beampipeMaterial="stainlesssteel",
  ngenerate=1000;

option, magnetGeometryType="polesfacetcrop";
!option, nperfile=1000;

!physics
option, physicsList="em_standard",
        chordStepMinimum    = 0.0000000001 * m,
        deltaIntersection   = 0.00000000000001 * m,
        deltaChord          = 0.0000000001 * m;

When using BDSIM version 0.91, everything works fine with the same input files. The stack trace is attached in a separate text file.

Comments (7)

  1. Laurie Nevay

    Hello and thanks for the good report!

    So, the options are a little out of date. The physics lists should be "em" since we moved to the modular physics lists as of v0.94, but his will be after the material table has been constructed. Also, the develop version will not accept deltaChord as an option.

    In the attached stack trace, the segfault comes from part way through building the material table and comes from Geant4 having trouble with string compare. Ultimately, the error comes from ROOT (libCore) which is surprising.

    The material table is built after parsing, so the parser should have complained about the options.

    If I add your options to bdsim/examples/simpleMachine/sm, minus the last 3 and change "em_standard" to "em", it works fine for me.

    The symptoms would suggest you're using an older version of BDSIM that was compiled against a changed installation of ROOT or BDSIM.

    Can you check

    1) you're using the correct version of BDSIM on your system

        which bdsim
        alias bdsim
    

    2) you've sourced the correct Geant4 installation

        echo $G4 <tab>  - choose any variable and check the path
    

    3) there is nothing suspicious on your DYLD_LIBRARY_PATH environmental variable. If it still doesn't work, please add it as a comment here.

    Screen Shot 2017-02-03 at 09.07.49.png Screen Shot 2017-02-03 at 09.08.16.png Screen Shot 2017-02-03 at 09.08.31.png

  2. Jochem Snuverink

    Thanks for the report. This is actually after the parsing of the input files, when the different materials are defined. This seems a strange place to crash, and the stack trace seems to indicate a memory problem:

    Cannot access memory at address 0xffffffffffffffe8>
    

    Are you running the expected bdsim executable? I was earlier under the impression that you used a develop version, but the log shows version 0.9.5.

    Also could you try: bdsim --materials (should print out a list of materials).

    If that is all fine could you attach all input files?

  3. Laurie Nevay

    To be clear - it's getting past the parsing stage in your example and failing later, but it shouldn't as the options should be invalid for the develop version just now.

  4. A Schuetz reporter

    Dear Jochem and Laurie, Thanks for the fast help!

    I am using BDSIM version 0.9.5. I checked which Geant4 version I sourced for running BDSIM, and it was accidentally version 10.03 instead of 10.02.p03 with which I was building BDSIM in the end. When sourcing the correct Geant4 version it seems to be fine:

    main> Using input file : atf2.gmad
    parser> reading file /space/vol1/PhD/code/ATF2/BDSIM_simulation/ATF2_FF/atf2_components_correctNuria.gmad 
    parser> reading file /space/vol1/PhD/code/ATF2/BDSIM_simulation/ATF2_FF/atf2_components_cbpm.gmad 
    parser> reading file /space/vol1/PhD/code/ATF2/BDSIM_simulation/ATF2_FF/atf2_sequence.gmad 
    parser> reading file /space/vol1/PhD/code/ATF2/BDSIM_simulation/ATF2_FF/atf2_samplers_selection.gmad 
    parser> reading file /space/vol1/PhD/code/ATF2/BDSIM_simulation/ATF2_FF/atf2_beam_halo.gmad 
    parser> reading file /space/vol1/PhD/code/ATF2/BDSIM_simulation/ATF2_FF/atf2_options.gmad 
    parsing the atom list...
    size of atom list: 0
    parsing the material list...
    size of material list: 0
    BDSRandom::SetSeed> Random number generator's seed = 1
    
    *************************************************************
     Geant4 version Name: geant4-10-02-patch-03    (27-January-2017)
                          Copyright : Geant4 Collaboration
                          Reference : NIM A 506 (2003), 250-303
                                WWW : http://cern.ch/geant4
    *************************************************************
    
    "em_standard" is not a valid physics list. Available ones are: 
    

    Sorry for not checking this before opening a new issue. I was just surprised that it would seg fault immediately without giving me a concrete/understandable hint, what might be wrong.

    Thanks again!

  5. Log in to comment