Project

General

Profile

Bug #12217

reading a mad8 lattice that does not contain a beam statement segfaults on the first attempt

Added by Eric Stern over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Start date:
04/07/2016
Due date:
% Done:

0%

Estimated time:
Duration:

Description

See the attached script read_lattice_foo.py and foo.lat.

Running the script read_lattice_foo.py the first time, you get a segfault, apparently related to the Reference particle and lsexpr.

egstern@egstern-cd-124683:~/syn2-dev/build/synergia2/src/synergia/simulation/tests$ synergia read_lattice_foo.py
python: /usr/include/boost/multi_array/base.hpp:178: Reference boost::detail::multi_array::value_accessor_one<T>::access(boost::type<Reference>, boost::detail::multi_array::value_accessor_one<T>::index, TPtr, const size_type*, const index*, const index*) const [with Reference = const double&; TPtr = const double*; T = double; boost::detail::multi_array::value_accessor_one<T>::index = long int; boost::detail::multi_array::multi_array_base::size_type = long unsigned int]: Assertion `idx - index_bases[0] >= 0' failed.
[egstern-cd-124683:13129] *** Process received signal ***
[egstern-cd-124683:13129] Signal: Aborted (6)
[egstern-cd-124683:13129] Signal code:  (-6)
[egstern-cd-124683:13129] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fb2b1b59340]
[egstern-cd-124683:13129] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7fb2b17bacc9]
[egstern-cd-124683:13129] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fb2b17be0d8]
[egstern-cd-124683:13129] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x2fb86) [0x7fb2b17b3b86]
[egstern-cd-124683:13129] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2fc32) [0x7fb2b17b3c32]
[egstern-cd-124683:13129] [ 5] /home/egstern/syn2-dev/install/lib/libsynergia_foundation.so(_ZNK5boost6detail11multi_array18value_accessor_oneIdE6accessIRKdPS5_EET_NS_4typeIS8_EElT0_PKmPKlSF_+0x6d) [0x7fb2a4c16c43]
[egstern-cd-124683:13129] [ 6] /home/egstern/syn2-dev/install/lib/libsynergia_foundation.so(_ZNK5boost15multi_array_refIdLm1EEixEl+0x70) [0x7fb2a4c158fa]
[egstern-cd-124683:13129] [ 7] /home/egstern/syn2-dev/install/lib/libsynergia_foundation.so(_ZNK18Reference_particle9as_lsexprEv+0x381) [0x7fb2a4c14421]
[egstern-cd-124683:13129] [ 8] /home/egstern/syn2-dev/install/lib/libsynergia_lattice.so(_ZNK7Lattice9as_lsexprEv+0x197) [0x7fb2a1f45fe9]
[egstern-cd-124683:13129] [ 9] /home/egstern/syn2-dev/install/lib/synergia/lattice/lattice.so(_ZN5boost6python6detail6invokeINS0_15to_python_valueIRK6LsexprEEM7LatticeKFS4_vENS0_15arg_from_pythonIRS8_EEEEP7_objectNS1_11invoke_tag_ILb0ELb1EEERKT_RT0_RT1_+0x72) [0x7fb2a27f9953]
[egstern-cd-124683:13129] [10] /home/egstern/syn2-dev/install/lib/synergia/lattice/lattice.so(_ZN5boost6python6detail12caller_arityILj1EE4implIM7LatticeKF6LsexprvENS0_21default_call_policiesENS_3mpl7vector2IS6_RS5_EEEclEP7_objectSG_+0xc4) [0x7fb2a27ee9a2]
[egstern-cd-124683:13129] [11] /home/egstern/syn2-dev/install/lib/synergia/lattice/lattice.so(_ZN5boost6python7objects23caller_py_function_implINS0_6detail6callerIM7LatticeKF6LsexprvENS0_21default_call_policiesENS_3mpl7vector2IS6_RS5_EEEEEclEP7_objectSH_+0x2f) [0x7fb2a27e4b7f]
[egstern-cd-124683:13129] [12] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0(_ZNK5boost6python7objects8function4callEP7_objectS4_+0xca) [0x7fb2a7bb364a]
[egstern-cd-124683:13129] [13] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0(+0x279b8) [0x7fb2a7bb39b8]
[egstern-cd-124683:13129] [14] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0(_ZN5boost6python21handle_exception_implENS_9function0IvEE+0x53) [0x7fb2a7bbdc93]
[egstern-cd-124683:13129] [15] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0(+0x262c3) [0x7fb2a7bb22c3]
[egstern-cd-124683:13129] [16] /usr/bin/python(PyEval_EvalFrameEx+0x965) [0x499be5]
[egstern-cd-124683:13129] [17] /usr/bin/python(PyEval_EvalFrameEx+0xc72) [0x499ef2]
[egstern-cd-124683:13129] [18] /usr/bin/python(PyEval_EvalCodeEx+0x2ac) [0x4a090c]
[egstern-cd-124683:13129] [19] /usr/bin/python(PyEval_EvalFrameEx+0x7d2) [0x499a52]
[egstern-cd-124683:13129] [20] /usr/bin/python(PyEval_EvalCodeEx+0x2ac) [0x4a090c]
[egstern-cd-124683:13129] [21] /usr/bin/python(PyEval_EvalFrameEx+0x7d2) [0x499a52]
[egstern-cd-124683:13129] [22] /usr/bin/python() [0x4a1634]
[egstern-cd-124683:13129] [23] /usr/bin/python(PyRun_FileExFlags+0x92) [0x44e4a5]
[egstern-cd-124683:13129] [24] /usr/bin/python(PyRun_SimpleFileExFlags+0x2ee) [0x44ec9f]
[egstern-cd-124683:13129] [25] /usr/bin/python(Py_Main+0xb5e) [0x44f904]
[egstern-cd-124683:13129] [26] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fb2b17a5ec5]
[egstern-cd-124683:13129] [27] /usr/bin/python() [0x578c4e]
[egstern-cd-124683:13129] *** End of error message ***
Aborted (core dumped)

The second time works and all subsequent attempts work.

egstern@egstern-cd-124683:~/syn2-dev/build/synergia2/src/synergia/simulation/tests$ synergia read_lattice_foo.py
foo_machine:
foo_machine: drift d: l=1

To get back to the failing behavior, remove the lattice_cache directory.

$ rm -rf lattice_cache
egstern@egstern-cd-124683:~/syn2-dev/build/synergia2/src/synergia/simulation/tests$ synergia read_lattice_foo.py
python: /usr/include/boost/multi_array/base.hpp:178: Reference boost::detail::multi_array::value_accessor_one<T>::access(boost::type<Reference>, boost::detail::multi_array::value_accessor_one<T>::index, TPtr, const size_type*, const index*, const index*) const [with Reference = const double&; TPtr = const double*; T = double; boost::detail::multi_array::value_accessor_one<T>::index = long int; boost::detail::multi_array::multi_array_base::size_type = long unsigned int]: Assertion `idx - index_bases[0] >= 0' failed.
[egstern-cd-124683:13172] *** Process received signal ***
[egstern-cd-124683:13172] Signal: Aborted (6)
[egstern-cd-124683:13172] Signal code:  (-6)
[egstern-cd-124683:13172] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f449e19c340]
[egstern-cd-124683:13172] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f449ddfdcc9]
[egstern-cd-124683:13172] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f449de010d8]
[egstern-cd-124683:13172] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x2fb86) [0x7f449ddf6b86]
[egstern-cd-124683:13172] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2fc32) [0x7f449ddf6c32]
[egstern-cd-124683:13172] [ 5] /home/egstern/syn2-dev/install/lib/libsynergia_foundation.so(_ZNK5boost6detail11multi_array18value_accessor_oneIdE6accessIRKdPS5_EET_NS_4typeIS8_EElT0_PKmPKlSF_+0x6d) [0x7f4491259c43]
[egstern-cd-124683:13172] [ 6] /home/egstern/syn2-dev/install/lib/libsynergia_foundation.so(_ZNK5boost15multi_array_refIdLm1EEixEl+0x70) [0x7f44912588fa]
[egstern-cd-124683:13172] [ 7] /home/egstern/syn2-dev/install/lib/libsynergia_foundation.so(_ZNK18Reference_particle9as_lsexprEv+0x381) [0x7f4491257421]
[egstern-cd-124683:13172] [ 8] /home/egstern/syn2-dev/install/lib/libsynergia_lattice.so(_ZNK7Lattice9as_lsexprEv+0x197) [0x7f448e588fe9]
[egstern-cd-124683:13172] [ 9] /home/egstern/syn2-dev/install/lib/synergia/lattice/lattice.so(_ZN5boost6python6detail6invokeINS0_15to_python_valueIRK6LsexprEEM7LatticeKFS4_vENS0_15arg_from_pythonIRS8_EEEEP7_objectNS1_11invoke_tag_ILb0ELb1EEERKT_RT0_RT1_+0x72) [0x7f448ee3c953]
[egstern-cd-124683:13172] [10] /home/egstern/syn2-dev/install/lib/synergia/lattice/lattice.so(_ZN5boost6python6detail12caller_arityILj1EE4implIM7LatticeKF6LsexprvENS0_21default_call_policiesENS_3mpl7vector2IS6_RS5_EEEclEP7_objectSG_+0xc4) [0x7f448ee319a2]
[egstern-cd-124683:13172] [11] /home/egstern/syn2-dev/install/lib/synergia/lattice/lattice.so(_ZN5boost6python7objects23caller_py_function_implINS0_6detail6callerIM7LatticeKF6LsexprvENS0_21default_call_policiesENS_3mpl7vector2IS6_RS5_EEEEEclEP7_objectSH_+0x2f) [0x7f448ee27b7f]
[egstern-cd-124683:13172] [12] /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0(_ZNK5boost6python7objects8function4callEP7_objectS4_+0xca) [0x7f44941f664a]
.
.   etc.
.

Adding a BEAM statement to the lattice file stops this behavior, but we don't always have BEAM statements and can't require them.

read_lattice_foo.py (243 Bytes) read_lattice_foo.py Eric Stern, 04/07/2016 05:17 PM
foo.lat (286 Bytes) foo.lat Eric Stern, 04/07/2016 05:17 PM

History

#1 Updated by James Amundson over 3 years ago

  • Status changed from New to Resolved

Fixed in ebc3244f3fd7396d46b76a2eaff672032537747d

#2 Updated by Eric Stern over 3 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF