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

NPE in RubyIO.fwrite(RubyString buffer) #1534

Closed
inger opened this issue Feb 27, 2014 · 5 comments
Closed

NPE in RubyIO.fwrite(RubyString buffer) #1534

inger opened this issue Feb 27, 2014 · 5 comments
Milestone

Comments

@inger
Copy link

@inger inger commented Feb 27, 2014

The second line of the following snippet is throwing a NPE, when System.console() is not defined, yet somehow tty_p says true (is this breaking an invariant?)

if (Platform.IS_WINDOWS && tty_p(getRuntime().getCurrentContext()).isTrue()) {
System.console().printf("%s", buffer.asJavaString());
return len;
}

This was added 5bd0798 , fixed #1198 but it breaks our client upgrades from an earlier jruby version.
Thanks for you help.

@artembilan
Copy link

@artembilan artembilan commented Mar 3, 2014

We (Spring IO) are observing similar issue. The latest working version is 1.7.8.
JavaDocs from System.console()
* @return The system console, if any, otherwise <tt>null</tt>

Thank you.

@enebo
Copy link
Member

@enebo enebo commented Mar 3, 2014

I guess I did not consider the JVM may be started without a console and then create a process which has a tty. In this case then unfortunately, for now, we will just need to go back to old broken way when console is not available...

@enebo enebo added this to the JRuby 1.7.12 milestone Mar 3, 2014
@enebo
Copy link
Member

@enebo enebo commented Mar 3, 2014

Fixed in cfee0e7 on jruby-1_7 (will be merged to master soon). So ultimately we will need a better mechanism than using console if we cannot rely on it being there....This at least is a partial fix in that you will see chars if you have a console. If not then we are back to jruby-1.7.8 behavior.

@enebo enebo closed this Mar 3, 2014
@artembilan
Copy link

@artembilan artembilan commented Mar 3, 2014

Thank you very much! Wouldn't you mind to provide a repository url to check your SNAPSHOT?
And which version, too, please

@enebo
Copy link
Member

@enebo enebo commented Mar 3, 2014

You can download a build of this tomorrow after our nightly dist job finishes here:
http://ci.jruby.org/snapshots/1.7.x/

ThorbenLindhauer added a commit to camunda/camunda-spin that referenced this issue Jul 1, 2014
- avoids NPE when running tests from within eclipse
- confer jruby/jruby#1534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants