question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segfault with latest pyjulia version on python 2.7,3.5 and 3.6 and julia v0.6

See original GitHub issue

I use Julia v0.6 and Python 2.7, 3.5 or 3.6 on Ubuntu 17.10. For each version of Python, running pipX.Y install julia works fine, and then the julia module is accessible.

But it breaks both the Python and IPython terminals when trying j = julia.Julia(), with the following error log:

$ python3
Python 3.6.3 (default, Oct  3 2017, 21:45:48)                            
[GCC 7.2.0] on linux                
Type "help", "copyright", "credits" or "license" for more information.   
>>> import julia; j = julia.Julia() 

signal (11): Erreur de segmentation 
while loading no file, in expression starting on line 0                  
unknown function (ip: 0x7f58ae6b7ad6)                                    
_PyObject_GenericGetAttrWithDict at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                       
PyObject_GetAttrString at python3 (unknown line)                         
init_ctypes at /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so (unknown line)                                                           
_PyImport_LoadDynamicModule at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                            
unknown function (ip: 0x7f58ae78c43d)                                    
unknown function (ip: 0x7f58ae716810)                                    
PyImport_ImportModuleLevel at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                             
unknown function (ip: 0x7f58ae673703)                                    
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                                          
PyEval_CallObjectWithKeywords at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                          
PyEval_EvalFrameEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                                     
PyEval_EvalCodeEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                                      
PyEval_EvalCode at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                                        
PyImport_ExecCodeModuleEx at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                              
unknown function (ip: 0x7f58ae78bda1)                                    
unknown function (ip: 0x7f58ae78c37d)                                    
unknown function (ip: 0x7f58ae78c689)                                    
unknown function (ip: 0x7f58ae716810)                                    
PyImport_ImportModuleLevel at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                             
unknown function (ip: 0x7f58ae673703)                                    
PyObject_Call at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                                          
PyObject_CallFunction at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                                  
PyImport_Import at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                                        
PyImport_ImportModule at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)                                                                  
macro expansion at /home/lilian/.julia/v0.6/PyCall/src/exception.jl:78 [inlined]                                                                   
pyimport at /home/lilian/.julia/v0.6/PyCall/src/PyCall.jl:374            
__init__ at /home/lilian/.julia/v0.6/PyCall/src/pyinit.jl:71             
unknown function (ip: 0x7f58ae3b8acf)                                    
jl_call_fptr_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:339 [inlined]                                    
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:358 [inlined]                                  
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1933                                                              
jl_apply at /home/centos/buildbot/slave/package_tarball64/build/src/julia.h:1424 [inlined]                                                         
jl_module_run_initializer at /home/centos/buildbot/slave/package_tarball64/build/src/toplevel.c:87                                                 
jl_init_restored_modules at /home/centos/buildbot/slave/package_tarball64/build/src/dump.c:2443 [inlined]                                          
_jl_restore_incremental at /home/centos/buildbot/slave/package_tarball64/build/src/dump.c:3272                                                     
jl_restore_incremental at /home/centos/buildbot/slave/package_tarball64/build/src/dump.c:3292                                                      
_include_from_serialized at ./loading.jl:157                             
_require_from_serialized at ./loading.jl:200                             
unknown function (ip: 0x7f58c727f8c0)                                    
jl_call_fptr_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:339 [inlined]                                    
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:358 [inlined]                                  
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1933                                                              
_require_search_from_serialized at ./loading.jl:236                      
unknown function (ip: 0x7f58c72800b0)                                    
jl_call_fptr_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:339 [inlined]                                    
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:358 [inlined]                                  
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1933                                                              
_require at ./loading.jl:434        
require at ./loading.jl:398         
unknown function (ip: 0x7f58c728192b)                                    
jl_call_fptr_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:339 [inlined]                                    
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:358 [inlined]                                  
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1933                                                              
jl_apply at /home/centos/buildbot/slave/package_tarball64/build/src/julia.h:1424 [inlined]                                                         
eval_import_path_ at /home/centos/buildbot/slave/package_tarball64/build/src/toplevel.c:403                                                        
eval_import_path at /home/centos/buildbot/slave/package_tarball64/build/src/toplevel.c:430 [inlined]                                               
jl_toplevel_eval_flex at /home/centos/buildbot/slave/package_tarball64/build/src/toplevel.c:495                                                    
jl_eval_string at /home/centos/buildbot/slave/package_tarball64/build/src/jlapi.c:77                                                               
ffi_call_unix64 at /usr/lib/x86_64-linux-gnu/libffi.so.6 (unknown line)  
ffi_call at /usr/lib/x86_64-linux-gnu/libffi.so.6 (unknown line)         
_ctypes_callproc at /usr/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so (unknown line)                                          
unknown function (ip: 0x7f58cd175726)                                    
_PyObject_FastCallDict at python3 (unknown line)                         
unknown function (ip: 0x54f116)     
_PyEval_EvalFrameDefault at python3 (unknown line)                       
unknown function (ip: 0x54e4c7)     
unknown function (ip: 0x54f4f5)     
_PyEval_EvalFrameDefault at python3 (unknown line)                       
unknown function (ip: 0x54efc0)     
_PyFunction_FastCallDict at python3 (unknown line)                       
_PyObject_Call_Prepend at python3 (unknown line)                         
PyObject_Call at python3 (unknown line)                                  
unknown function (ip: 0x4e0b5a)     
unknown function (ip: 0x4da8d6)     
_PyObject_FastCallDict at python3 (unknown line)                         
unknown function (ip: 0x54f116)     
_PyEval_EvalFrameDefault at python3 (unknown line)                       
unknown function (ip: 0x54efc0)     
PyEval_EvalCode at python3 (unknown line)                                
PyRun_InteractiveOneObject at python3 (unknown line)                     
PyRun_InteractiveLoopFlags at python3 (unknown line)                     
PyRun_AnyFileExFlags at python3 (unknown line)                           
Py_Main at python3 (unknown line)   
main at python3 (unknown line)      
__libc_start_main at /build/glibc-CxtIbX/glibc-2.26/csu/../csu/libc-start.c:308                                                                    
_start at python3 (unknown line)    
Allocations: 1491756 (Pool: 1490585; Big: 1171); GC: 0                   

I tested and my julia’s version of PyCall works perfectly well.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
arsenal9971commented, Feb 14, 2018

@Naereen The following worked for me

cd ~/.julia/v0.6/PyCall
git pull origin master
git checkout master
julia
Pkg.build("PyCall")
exit()

that is installing the last version of PyCall, which fixed apparently the issue.

1reaction
AStupidBearcommented, Feb 11, 2018

@Naereen Rebuilding PyCall with your desired PYTHON path can solve this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting — PyJulia 0.6.0 documentation
Troubleshooting¶ · Your Python interpreter is statically linked to libpython¶ · Segmentation fault in IPython¶ · Error due to libstdc++ version¶.
Read more >
Segfault during julia.Julia() if PyTorch is already imported #125
The Python package PyTorch occasionally has import order issues with other large binary packages (throwing the static TLS error shown below ...
Read more >
Segfault when jl_init in R (also python?) with julia 1.6 on macOS
I will open an issue in julia repo since it seems to be some problem with jl_init in julia dll on mac instead...
Read more >
Segmentation fault when creating custom autograd function ...
I have a (vector-to-scalar) function and corresponding derivative function written in Julia that I am unable to translate to Python.
Read more >
Pyjulia segfaults with pytorch
pytorch '0.3.0.post4' pyjulia 0.1.5. Julia v0.5. Julia PyCall 1.15.0. Error is: signal (11): Segmentation fault while loading no file, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found