Working with a slightly modified version as detailed in my fork here:
This mostly fixes an assumption about where the Python DLL will be and
introduces some fallback behaviour. As I start understanding what's
going on with the library, I'll probably look at introducing a different
change that delays the FFI import until the last possible moment
allowing a user to select which version of Python they want to use
(e.g., RubyPython.use_python_version('2.7') or something like that).
That's a separate problem than what I'm raising right now. I don't mind
debugging this, but I need some advice on how to debug it as I'm neither
a Python expert nor really familiar with FFI. The problem exists on both
a 64-bit Ubuntu 10.10 system that I've got (Python 2.6) and a 32-bit
CentOS 4.8 system where I've built Python 2.7 (the system Python version
is 2.3).
I'm using ruby-1.8.7-p302 through rvm in both cases.
In my rubypython work directory:
% irb -I$(pwd)/lib
ruby-1.8.7-p302 > require 'rubypython'
=> true
ruby-1.8.7-head > RubyPython::Python::PYTHON_VERSION
=> 2.6
ruby-1.8.7-head > RubyPython::Python::PYTHON_NAME
=> "python2.6"
ruby-1.8.7-head > RubyPython::Python::LIB_NAME
=> "libpython2.6"
ruby-1.8.7-head > RubyPython::Python::LIB_EXT
=> "so"
ruby-1.8.7-head > RubyPython::Python::LIB
ruby-1.8.7-head > RubyPython::Python::PYTHON_SYS_PREFIX
=> "/usr"
ruby-1.8.7-head > RubyPython::Python.instance_variable_get("@ffi_libs")
=> [#<FFI::DynamicLibrary:0x7f81fb6251b8>]
ruby-1.8.7-p302 > sys = RubyPython.import('sys')
/home/austin/rubypython/lib/rubypython.rb:101: [BUG] Segmentation fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
zsh: abort irb -I$(pwd)/lib
Help?
-a