PyORBIT-Collaboration / PyORBIT3

Python3 compatible version of PyORBIT
MIT License
5 stars 14 forks source link

Segmentation fault #26

Closed austin-hoover closed 1 month ago

austin-hoover commented 3 months ago

test.py:

from orbit.core.bunch import Bunch
bunch = Bunch()

When I run python test.py I get

zsh: segmentation fault  python test.py

Or when I run mpirun -n 2 python test.py I get

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   PID 5610 RUNNING AT mac126462
=   EXIT CODE: 11
=   CLEANING UP REMAINING PROCESSES
=   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault: 11 (signal 11)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions

However, the following works fine:

from orbit.core.bunch import Bunch
from orbit.utils.orbit_mpi_utils import bunch_pyorbit_to_orbit
bunch = Bunch()
azukov commented 2 months ago

This is still MPI related, correct? Since, I assume, the pyorbit was compiled with MPI.

austin-hoover commented 2 months ago

I'm not sure; I did install with MPI using https://github.com/austin-hoover/pyorbit/commit/356fff2a456737ff5438b79b2e2d797ae4bddb98.

But I'm reproducing this error on a different machine where PyORBIT was not installed with MPI. (On our SNS server, I'm getting Segmentation fault (core dumped).)

shishlo commented 2 months ago

I have PyORBIT3 on my Ubuntu workstation. I have the same problem even without MPI installed: (.mes) shi@pc0126990:~/SHISHLO/AccPhysics/PyORBIT3$ python Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

from orbit.core.bunch import Bunch bunch = Bunch() del bunch Segmentation fault

shishlo commented 2 months ago

PyORBIT2 does not have this error: Python 2.7.6 (default, Mar 11 2024, 10:31:00) [GCC 11.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from bunch import Bunch bunch = Bunch() del bunch

azukov commented 2 months ago

So this was the test I was checking all things out. https://github.com/PyORBIT-Collaboration/PyORBIT3/blob/main/examples/meson/imports_test.py Can you try to run it and see if it segfaults too?

shishlo commented 2 months ago

I tried - no problem: import orbit.core.orbit_mpi import orbit.core.spacecharge import orbit.core.trackerrk4 import orbit.core.teapot_base import orbit.core.linac import orbit.core.orbit_utils import orbit.core.aperture import orbit.core.foil import orbit.core.field_sources import orbit.core.rfcavities import orbit.core.impedances import orbit.core.fieldtracker import orbit.core.collimator import orbit.core.error_base

from orbit.core.bunch import Bunch b = Bunch() print(b) del b

azukov commented 1 month ago

Fixed by #28