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

Segmentation fault while importing nuSQuIDS in python #34

Open
greesman opened this issue Jan 27, 2023 · 5 comments
Open

Segmentation fault while importing nuSQuIDS in python #34

greesman opened this issue Jan 27, 2023 · 5 comments

Comments

@greesman
Copy link

Hi! I have correctly installed all of the prerequisites for nuSQuIDS. However, when I try to use python bindings by importing nuSQuIDS, I get a segmentation fault.

 % python                 
Python 3.11.0 | packaged by conda-forge | (main, Jan 15 2023, 05:44:48) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nuSQuIDS
zsh: segmentation fault  python

No output or logs are generated.

All of the 18 tests in nuSQuIDS pass when I run make test. The following are the versions of the packages I am using:

python - 3.11.0
boost - 1.80.0
hdf5 - 1.12.2_2
squids - 1.3.0

I'd be happy to provide any more information that you might need.

@cnweaver
Copy link
Collaborator

Hi! That's unfortunate, and we would definitely like to fix it! Can you give us:

  • Any details on which OS you're using (which version of Mac OS?)
  • Any sort of stack trace of where the crash happens (Running python under lldb might work)

@greesman
Copy link
Author

greesman commented Feb 4, 2023

Sorry for the delayed response! I am using Ventura 13.0.1. Here is the output of running python under lldb:

(lldb) run
Process 19878 launched: '/Users/username/opt/anaconda3/envs/emcee/bin/python' (x86_64)
Process 19878 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x0000000105e865d1 libpython3.11.dylib`PyImport_Import + 49
libpython3.11.dylib`PyImport_Import:
->  0x105e865d1 <+49>: movq   0x10(%rax), %rax
    0x105e865d5 <+53>: movl   0x11a0(%rax), %ecx
    0x105e865db <+59>: testl  %ecx, %ecx
    0x105e865dd <+61>: je     0x105e8683a               ; <+666>
Target 0: (python) stopped.
(lldb) 

@michelelucente
Copy link

Hi, I have the same issue. I am on Mac OS 13.2.1, here is the output of running python under lldb:

(lldb) run
Process 81648 launched: '/opt/anaconda3/bin/python' (x86_64)
Process 81648 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x0000000104a48205 libpython3.10.dylib`PyImport_Import + 53
libpython3.10.dylib`PyImport_Import:
->  0x104a48205 <+53>: movq   0x10(%rax), %r15
    0x104a48209 <+57>: movq   0x161f48(%rip), %rbx      ; PyImport_Import.PyId___import__.1
    0x104a48210 <+64>: testq  %rbx, %rbx
    0x104a48213 <+67>: js     0x104a48650               ; <+1152>
Target 0: (python) stopped.

Thank you for your help!

@cnweaver
Copy link
Collaborator

Can you get a backtrace (thread backtrace) of how it got to that point? That would help us narrow it down.

@michelelucente
Copy link

(lldb) thread backtrace
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
  * frame #0: 0x0000000104a48205 libpython3.10.dylib`PyImport_Import + 53
    frame #1: 0x0000000104a48196 libpython3.10.dylib`PyImport_ImportModule + 54
    frame #2: 0x0000000103803130 nuSQuIDS.so`init_module_nuSQuIDS() + 32
    frame #3: 0x0000000102757065 libboost_python310.dylib`boost::python::handle_exception_impl(boost::function0<void>) + 69
    frame #4: 0x0000000102757bdb libboost_python310.dylib`boost::python::detail::init_module(PyModuleDef&, void (*)()) + 107
    frame #5: 0x00000001001e8364 python`_imp_create_dynamic + 868
    frame #6: 0x00000001000c7f37 python`cfunction_vectorcall_FASTCALL + 103
    frame #7: 0x000000010018d5c2 python`_PyEval_EvalFrameDefault + 59970
    frame #8: 0x00000001000699f6 python`_PyFunction_Vectorcall + 582
    frame #9: 0x000000010018ae79 python`_PyEval_EvalFrameDefault + 49913
    frame #10: 0x00000001000699f6 python`_PyFunction_Vectorcall + 582
    frame #11: 0x000000010018757f python`_PyEval_EvalFrameDefault + 35327
    frame #12: 0x00000001000699f6 python`_PyFunction_Vectorcall + 582
    frame #13: 0x00000001001af83b python`call_function + 187
    frame #14: 0x0000000100180fdf python`_PyEval_EvalFrameDefault + 9311
    frame #15: 0x00000001000699f6 python`_PyFunction_Vectorcall + 582
    frame #16: 0x00000001001af83b python`call_function + 187
    frame #17: 0x0000000100180fdf python`_PyEval_EvalFrameDefault + 9311
    frame #18: 0x00000001000699f6 python`_PyFunction_Vectorcall + 582
    frame #19: 0x00000001001af83b python`call_function + 187
    frame #20: 0x0000000100180fdf python`_PyEval_EvalFrameDefault + 9311
    frame #21: 0x00000001000699f6 python`_PyFunction_Vectorcall + 582
    frame #22: 0x0000000100067ef9 python`_PyObject_VectorcallTstate.728 + 73
    frame #23: 0x000000010006cc6a python`object_vacall + 410
    frame #24: 0x000000010006ce59 python`_PyObject_CallMethodIdObjArgs + 249
    frame #25: 0x00000001001e4ce1 python`PyImport_ImportModuleLevelObject + 3905
    frame #26: 0x0000000100185be1 python`_PyEval_EvalFrameDefault + 28769
    frame #27: 0x000000010017cde1 python`_PyEval_Vector + 545
    frame #28: 0x0000000100205440 python`run_mod + 240
    frame #29: 0x0000000100205205 python`pyrun_file + 133
    frame #30: 0x0000000100204d56 python`_PyRun_SimpleFileObject + 422
    frame #31: 0x000000010020467f python`_PyRun_AnyFileObject + 143
    frame #32: 0x0000000100229978 python`pymain_run_file_obj + 216
    frame #33: 0x0000000100229305 python`pymain_run_file + 85
    frame #34: 0x0000000100228b38 python`pymain_run_python + 376
    frame #35: 0x0000000100228975 python`Py_RunMain + 37
    frame #36: 0x00000001000017c8 python`main + 56
    frame #37: 0x00007ff80e3d0310 dyld`start + 2432

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

3 participants