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

[Truffle] Error calling our jruby+truffle using backtick #4327

Closed
bjfish opened this issue Nov 21, 2016 · 3 comments
Closed

[Truffle] Error calling our jruby+truffle using backtick #4327

bjfish opened this issue Nov 21, 2016 · 3 comments
Milestone

Comments

@bjfish
Copy link
Contributor

bjfish commented Nov 21, 2016

This isn't blocking anything. I just came across this by chance.

Trying to call truffle ruby using truffle ruby backtick results in the following exception.

Example

ruby = File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["RUBY_INSTALL_NAME"])
puts `#{ruby} -e 'puts 42'`

Expected Behavior

$ ruby ../jruby-patches/backtick.rb
42

Actual Behavior

$ jt run ../jruby-patches/backtick.rb
$ /Users/brandonfish/Documents/jruby/bin/jruby -X+T -Xtruffle.core.load_path=/Users/brandonfish/Documents/jruby/truffle/src/main/ruby -Xtruffle.graal.warn_unless=false ../jruby-patches/backtick.rb
Truffle internal error: java.lang.NullPointerException
java.lang.NullPointerException
	at org.jruby.truffle.Log$1.publish(Log.java:31)
	at java.util.logging.Logger.log(Logger.java:738)
	at java.util.logging.Logger.doLog(Logger.java:765)
	at java.util.logging.Logger.log(Logger.java:788)
	at java.util.logging.Logger.warning(Logger.java:1476)
	at org.jruby.truffle.Log.warning(Log.java:49)
	at org.jruby.truffle.RubyEngine.execute(RubyEngine.java:42)
	at org.jruby.truffle.JRubyTruffleImpl.execute(JRubyTruffleImpl.java:29)
	at org.jruby.Main.internalRun(Main.java:337)
	at org.jruby.Main.run(Main.java:243)
	at org.jruby.Main.main(Main.java:205)


@bjfish bjfish added the truffle label Nov 21, 2016
@eregon
Copy link
Member

eregon commented Nov 21, 2016

@chrisseaton The problem is System.console() can be null if not attached to a tty (like redirected to a file).

eregon added a commit that referenced this issue Nov 21, 2016
* System.console() would be null.
* Log to stderr, not stdout.
* Fixes #4327.
@eregon
Copy link
Member

eregon commented Nov 21, 2016

Fixed by acad490.

@eregon eregon closed this as completed Nov 21, 2016
@eregon
Copy link
Member

eregon commented Nov 21, 2016

BTW, RbConfig.ruby is now also fixed.

@enebo enebo added this to the truffle-dev milestone Jan 10, 2017
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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