includeIronMagFields option segfaults

Issue #108 resolved
Jochem Snuverink created an issue

Including the iron magnetic fields calls the auxNavigator in the AcceleratorComponent::Build method (in itsMagField->GetFieldValue(polePos,Bfield); ) before it is attached to the worldvolume. This results in a segfault:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000010
0x000000010454db82 in G4Navigator::LocateGlobalPointAndSetup ()
(gdb) bt
#0  0x000000010454db82 in G4Navigator::LocateGlobalPointAndSetup ()
#1  0x00000001000f9cb3 in BDSQuadMagField::GetFieldValue (this=0x10a050960, Point=<value temporarily unavailable, due to optimizations>, Bfield=0x7fff5fbfe320) at /Users/jsnuverink/Documents/bdsim/src/BDSQuadMagField.cc:19
#2  0x00000001000f9ef1 in BDSQuadrupole::Build (this=0x10a04fe60) at /Users/jsnuverink/Documents/bdsim/src/BDSQuadrupole.cc:42

This can be reproduced in by e.g. adding the option includeIronMagFields in examples/features/geometry/4_magnets

Comments (4)

  1. Laurie Nevay

    Oh dear. I'll disable outer fields to prevent this for now.

    The outer fields have been broken for some time and will be shortly reimplemented. As the implementation (use of auxnavigator) of fields in BDSIM has moved on, this has become very broken. My current understanding was that the outer fields weren't built currently even if requested.

    The mechanism for outer fields will be fixed in December with the review of the field construction process.

  2. Jochem Snuverink reporter
    • changed status to open

    Thanks for the temporary fix. I would like to keep the issue open though until it is properly fixed. Feel free to downgrade priority.

  3. Laurie Nevay
    • edited description
    • changed status to resolved

    I have now implemented outer multipole fields. This is under final testing now and will be merged shortly. It will be in version 1.

    The option includeIronFields is retained for backwards compatibility, but this is replaced with "yokeFields".

  4. Log in to comment