arton / rjb

Ruby Java Bridge
https://www.artonx.org/collabo/backyard/?RubyJavaBridge
GNU Lesser General Public License v2.1
117 stars 34 forks source link

Segmentation fault with rjb 1.4.5 #17

Closed trongrg closed 11 years ago

trongrg commented 11 years ago

I'm using Mountain lion 1.8.2 with java version "1.6.0_37"

The problem occurs in both ruby 1.8.7-p371 and 1.9.3-p327

In irb

require 'rubygems'
require 'rjb'
str = Rjb::import('java.lang.String')

and the segmentation fault occurs with the error of Invalid memory access of location 0x0 rip=0x10a9384ed

ryanjones commented 11 years ago

Mac OS X Lion 10.7.5 / Java version 1.6.0_37 / Ruby 1.9.3p194

I'm getting this also. I had to roll back to 1.4.3 and everything went back to normal. Mine was crashing when I used:

Rjb::add_jar File.expand_path(....)
arton commented 11 years ago

Mac OS X Lion 10.7.5 / Java version 1.6.0_37 / Ruby 1.9.3p374 Works fine. Don't you have more informations ? for example the path of Java, 'java -version', the output of 'ruby test.rb (in Rjb's gem)' .

arton commented 11 years ago

Oops! It represented by Gem. I've always directly installed it with setup.rb.

arton commented 11 years ago

I can't figure out the cause at this time, maybe it caused by Gem environment. But I found the workaround if JAVA_HOME environment variable is empty, it works fine. ex) JAVA_HOME="" irb

Regards.

arton commented 11 years ago

I've bundled JDK 1.7 binary for the bridge class and it causes internal exception while loading JVM. I'll repackage Rjb gem with JDK 1.4 or 1.5 binary. Sorry for the inconvenience.