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

Segfault running tests on Linux #189

Closed
simonster opened this issue Sep 10, 2015 · 5 comments
Closed

Segfault running tests on Linux #189

simonster opened this issue Sep 10, 2015 · 5 comments

Comments

@simonster
Copy link
Member

On Linux, when I try to run the tests on PyCall master, I get a segfault:

signal (11): Segmentation fault
PyObject_IsInstance at /usr/lib/x86_64-linux-gnu/libpython2.7.so (unknown line)
pyisinstance at /home/simon/.julia/PyCall/src/PyCall.jl:100
jlcall_pyisinstance_21189 at  (unknown line)
jl_apply_generic at /usr/local/julia/usr/bin/../lib/libjulia.so (unknown line)
pyptr_query at /home/simon/.julia/PyCall/src/conversions.jl:147
pytype_query at /home/simon/.julia/PyCall/src/conversions.jl:783
convert at /home/simon/.julia/PyCall/src/conversions.jl:832
roundtripeq at /home/simon/.julia/PyCall/test/runtests.jl:6
jlcall_roundtripeq_21432 at  (unknown line)
jl_apply_generic at /usr/local/julia/usr/bin/../lib/libjulia.so (unknown line)
anonymous at test.jl:92
do_test at test.jl:50
jl_apply_generic at /usr/local/julia/usr/bin/../lib/libjulia.so (unknown line)
unknown function (ip: 0x7f5083fe4ed3)
unknown function (ip: 0x7f5083fe426e)
unknown function (ip: 0x7f5083ff9a0b)
unknown function (ip: 0x7f5083ffa72c)
jl_load at /usr/local/julia/usr/bin/../lib/libjulia.so (unknown line)
include at ./boot.jl:260
jl_apply_generic at /usr/local/julia/usr/bin/../lib/libjulia.so (unknown line)
include_from_node1 at ./loading.jl:271
jl_apply_generic at /usr/local/julia/usr/bin/../lib/libjulia.so (unknown line)
process_options at ./client.jl:316
_start at ./client.jl:411
unknown function (ip: 0x7f50810f0d89)
jl_apply_generic at /usr/local/julia/usr/bin/../lib/libjulia.so (unknown line)
unknown function (ip: 0x401ae7)
unknown function (ip: 0x4016af)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x4016f9)
unknown function (ip: (nil))
fish: Job 1, “julia test/runtests.jl” terminated by signal SIGSEGV (Address boundary error)

Adding the line Libdl.dlopen(libpython, Libdl.RTLD_LAZY|Libdl.RTLD_DEEPBIND|Libdl.RTLD_GLOBAL) to the start of __init__ appears to fix this. I'm not really sure what's going on, but it appears the segfault is somehow related to the libpython symbols not being available to other libraries.

I can't reproduce this on OS X, but dlopen is global there by default.

My versioninfo() is:

julia> versioninfo()
Julia Version 0.5.0-dev+3
Commit 7cd05db* (2015-09-09 19:05 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
@simonster
Copy link
Member Author

In case it's useful, without RTLD_GLOBAL, importing ctypes here throws:

ImportError('/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so: undefined symbol: PyFloat_Type',)

so the catch clause gets taken. With the dlopen line above importing ctypes works, but if I force the code in the catch clause to be run, the tests still segfault.

@tbreloff
Copy link

I'm wondering if this crash is related in any way. This was on OS X.

@stevengj
Copy link
Member

Have you tried the PyCall master?

@stevengj
Copy link
Member

I can reproduce. Will incorporate the dlopen workaround shortly.

@jmxpearson
Copy link
Contributor

Thank you for this. I have been running into this issue as of this afternoon.

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

4 participants