Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytraj segmentation fault with cython 3.0 and cpptraj commit f1d21f688de5ea5c55e650abe6efdbc352bdc613 #1648

Open
hainm opened this issue Dec 21, 2023 · 1 comment

Comments

@hainm
Copy link
Contributor

hainm commented Dec 21, 2023

Version/commit:

cpptraj: Amber-MD/cpptraj@f1d21f6
cython: 3.0.x

How

  • Use "-debug" when compiling libcpptraj
  • Turn on debug when compiling cython (

    pytraj/setup.py

    Line 126 in 6d62181

    if debug:
    -> if True)
$ cat test.py
import pytraj as pt
pt.load('tz2.pdb')

gdb python3 
run test.py
bt

Get


Thread 1 "python3" received signal SIGABRT, Aborted.
0x0000fffff7d88d78 in raise () from /lib/aarch64-linux-gnu/libc.so.6
(gdb) bt
#0  0x0000fffff7d88d78 in raise () from /lib/aarch64-linux-gnu/libc.so.6
#1  0x0000fffff7d75aac in abort () from /lib/aarch64-linux-gnu/libc.so.6
#2  0x0000fffff7dc2f40 in ?? () from /lib/aarch64-linux-gnu/libc.so.6
#3  0x0000fffff7dca344 in ?? () from /lib/aarch64-linux-gnu/libc.so.6
#4  0x0000fffff7dcbf88 in ?? () from /lib/aarch64-linux-gnu/libc.so.6
#5  0x0000ffffd8ce4a54 in Frame::~Frame() () from /work/cpptraj/lib/libcpptraj.so
#6  0x0000ffffd47653dc in __pyx_pf_6pytraj_10trajectory_5frame_5Frame_2__dealloc__(__pyx_obj_6pytraj_10trajectory_5frame_Frame*) ()
   from /work/pytraj/trajectory/frame.cpython-310-aarch64-linux-gnu.so
#7  0x0000ffffd47650fc in __pyx_pw_6pytraj_10trajectory_5frame_5Frame_3__dealloc__(_object*) () from /work/pytraj/trajectory/frame.cpython-310-aarch64-linux-gnu.so
#8  0x0000ffffd47b4978 in __pyx_tp_dealloc_6pytraj_10trajectory_5frame_Frame(_object*) () from /work/pytraj/trajectory/frame.cpython-310-aarch64-linux-gnu.so
#9  0x0000ffffd42486cc in _Py_DECREF () from /work/pytraj/trajectory/c_traj/c_trajectory.cpython-310-aarch64-linux-gnu.so
#10 0x0000ffffd4248724 in _Py_XDECREF () from /work/pytraj/trajectory/c_traj/c_trajectory.cpython-310-aarch64-linux-gnu.so
#11 0x0000ffffd427dc54 in __pyx_pf_6pytraj_10trajectory_6c_traj_12c_trajectory_17TrajectoryCpptraj_33_load_traj_by_indices(__pyx_obj_6pytraj_10trajectory_6c_traj_12c_trajectory_TrajectoryCpptraj*, _object*) () from /work/pytraj/trajectory/c_traj/c_trajectory.cpython-310-aarch64-linux-gnu.so
#12 0x0000ffffd4277db8 in __pyx_pw_6pytraj_10trajectory_6c_traj_12c_trajectory_17TrajectoryCpptraj_34_load_traj_by_indices(_object*, _object* const*, long, _object*) ()
   from /work/pytraj/trajectory/c_traj/c_trajectory.cpython-310-aarch64-linux-gnu.so
#13 0x0000ffffd42b060c in __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(_object*, _object* const*, unsigned long, _object*) ()
   from /work/pytraj/trajectory/c_traj/c_trajectory.cpython-310-aarch64-linux-gnu.so
#14 0x0000ffffd42a8268 in __Pyx_PyObject_FastCallDict(_object*, _object**, unsigned long, _object*) ()
   from /work/pytraj/trajectory/c_traj/c_trajectory.cpython-310-aarch64-linux-gnu.so
#15 0x0000ffffd4270238 in __pyx_pf_6pytraj_10trajectory_6c_traj_12c_trajectory_17TrajectoryCpptraj_25__getitem__(__pyx_obj_6pytraj_10trajectory_6c_traj_12c_trajectory_TrajectoryCpptraj*, _object*) () from /work/pytraj/trajectory/c_traj/c_trajectory.cpython-310-aarch64-linux-gnu.so
#16 0x0000ffffd426d2b8 in __pyx_pw_6pytraj_10trajectory_6c_traj_12c_trajectory_17TrajectoryCpptraj_26__getitem__(_object*, _object*) ()
   from /work/pytraj/trajectory/c_traj/c_trajectory.cpython-310-aarch64-linux-gnu.so
#17 0x0000aaaaaab08bb4 in _PyEval_EvalFrameDefault ()
#18 0x0000aaaaaabb7450 in _PyEval_Vector ()
#19 0x0000aaaaaab0c1c0 in _PyEval_EvalFrameDefault ()
#20 0x0000aaaaaabb7450 in _PyEval_Vector ()
#21 0x0000aaaaaabb7644 in PyEval_EvalCode ()
#22 0x0000aaaaaabf6bac in run_eval_code_obj ()
#23 0x0000aaaaaabf6e48 in run_mod ()
#24 0x0000aaaaaabf6f68 in pyrun_file ()
#25 0x0000aaaaaabf95a4 in _PyRun_SimpleFileObject ()
#26 0x0000aaaaaabf9be0 in _PyRun_AnyFileObject ()
#27 0x0000aaaaaab0f888 in Py_RunMain ()
#28 0x0000aaaaaab0fec4 in Py_BytesMain ()
#29 0x0000fffff7d75e10 in __libc_start_main () from /lib/aarch64-linux-gnu/libc.so.6
#30 0x0000aaaaaab0e6b8 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
@hainm
Copy link
Contributor Author

hainm commented Dec 21, 2023

Remove this line

del self.thisptr
will help pt.load('tz2.pdb') run fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant