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

io/console.rb on AIX not working in v9.x #3495

Closed
sfrieske opened this Issue Nov 25, 2015 · 40 comments

Comments

Projects
None yet
6 participants
@sfrieske
Copy link

commented Nov 25, 2015

On AIX, io/console.rb is broken for all versions of JRuby 9k including 9.0.4.
The error displayed is

TypeError: no implicit conversion of nil into String reopen at org/jruby/RubyIO.java:582 <top> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/io/console.rb:202

The reason is that the call $stderr.dup in line 195 fails:
NotImplementedError: dup unsupported or native support failed to load

This error is caught, but the subsequent try to reopen old_stderr fails in line 202.

@tajila

This comment has been minimized.

Copy link

commented Feb 8, 2016

I am seeing the same issue on AIX (64bit JVM) using JRuby v9.0.4. Here is the full stack trace:

TypeError: no implicit conversion of nil into String
   reopen at org/jruby/RubyIO.java:582
    <top> at /team/tobi/PR106886/InvokeDynamicRubyv904_Package/InvokeDynamic_Ruby_v904/lib/ruby/stdlib/io/console.rb:202
  require at org/jruby/RubyKernel.java:939
    <top> at /team/tobi/PR106886/InvokeDynamicRubyv904_Package/InvokeDynamic_Ruby_v904/lib/ruby/stdlib/rubygems/user_interaction.rb:1
  require at org/jruby/RubyKernel.java:939
    <top> at /team/tobi/PR106886/InvokeDynamicRubyv904_Package/InvokeDynamic_Ruby_v904/lib/ruby/stdlib/rubygems/user_interaction.rb:8
  require at org/jruby/RubyKernel.java:939
    <top> at /team/tobi/PR106886/InvokeDynamicRubyv904_Package/InvokeDynamic_Ruby_v904/lib/ruby/stdlib/rubygems/config_file.rb:1
  require at org/jruby/RubyKernel.java:939
    <top> at /team/tobi/PR106886/InvokeDynamicRubyv904_Package/InvokeDynamic_Ruby_v904/lib/ruby/stdlib/rubygems/config_file.rb:7
  require at org/jruby/RubyKernel.java:939
    <top> at /team/tobi/PR106886/InvokeDynamicRubyv904_Package/InvokeDynamic_Ruby_v904/lib/ruby/stdlib/rubygems/defaults/jruby.rb:1
     load at org/jruby/RubyKernel.java:957
    <top> at /team/tobi/PR106886/InvokeDynamicRubyv904_Package/InvokeDynamic_Ruby_v904/lib/ruby/stdlib/rubygems/defaults/jruby.rb:1

Just as @ssteidte stated the cause of the failure is line 195 in io/console.rb:

old_stderr = $stderr.dup

$stderr.dup throws an error (NotImplementedError: dup unsupported or native support failed to load)

In the ensure block (line 202) the call $stderr.reopen(old_stderr) fails because old_stderr is nil, it was never set.

I do not see this issue when using a 32bit JVM on AIX.

@headius

This comment has been minimized.

Copy link
Member

commented Feb 13, 2016

Can one of you show me the result of booting JRuby with -Xnative.logging=true please?

There's a couple possibilities:

  • We may not be finding the right libraries to load in 64-bit mode
  • The functions we need may need to be bound differently on AIX 64 bit.

Please also provide environment information, like jruby --version and uname -a.

@headius headius added this to the JRuby 9.1.0.0 milestone Feb 13, 2016

@sfrieske

This comment has been minimized.

Copy link
Author

commented Feb 15, 2016

the switch doesn't work:
java -cp jruby-complete-9.0.5.0.jar org.jruby.Main -Xnative.logging=true gives
jruby: invalid extended option native.logging=true (-X will list valid options)

jruby -version:
jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d IBM J9 VM 2.7 on pap6470_27sr3fp10-20150708_01 (SR3 FP10) +jit [AIX-ppc64]

uname -a: AIX f36smd1 1 7 00F646FB4C00

@sfrieske sfrieske closed this Feb 15, 2016

@sfrieske sfrieske reopened this Feb 15, 2016

@sfrieske

This comment has been minimized.

Copy link
Author

commented Feb 15, 2016

sorry, didn't want to close it

@headius

This comment has been minimized.

Copy link
Member

commented Mar 4, 2016

@ssteidte Sorry, if passing flags to java you'd want the long form: -Djruby.native.logging=true.

@sfrieske

This comment has been minimized.

Copy link
Author

commented Mar 7, 2016

still doesn't recognize the switch: jruby: unknown option -Djruby.native.logging=true with JRuby 9.0.5

@headius

This comment has been minimized.

Copy link
Member

commented Mar 7, 2016

java -Djruby.native.logging=true -cp jruby-complete-9.0.5.0.jar org.jruby.Main ...

@sfrieske

This comment has been minimized.

Copy link
Author

commented Mar 8, 2016

java7/jre/bin/java -Djruby.native.logging=true -cp jruby-complete-9.0.5.0.jar org.jruby.Main
jruby: warning: unknown property jruby.native.logging

@enebo

This comment has been minimized.

Copy link
Member

commented Mar 8, 2016

@ssteidte -Djruby.native.verbose=true

@headius

This comment has been minimized.

Copy link
Member

commented Mar 8, 2016

Oops, my mistake...@enebo is right, it's -Djruby.native.verbose=<true|false>.

@sfrieske

This comment has been minimized.

Copy link
Author

commented Mar 10, 2016

now this works :)

Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows.
java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
at jnr.ffi.provider.InvalidRuntime.newLoadError(InvalidRuntime.java:101)
at jnr.ffi.provider.InvalidRuntime.addressSize(InvalidRuntime.java:82)
at jnr.posix.POSIXFactory.libraries(POSIXFactory.java:183)
at jnr.posix.POSIXFactory.access$200(POSIXFactory.java:16)
at jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.(POSIXFactory.java:279)
at jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:283)
at jnr.posix.BaseNativePOSIX.(BaseNativePOSIX.java:36)
at jnr.posix.AixPOSIX.(AixPOSIX.java:43)
at jnr.posix.POSIXFactory.loadAixPOSIX(POSIXFactory.java:167)
at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:133)
at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:90)
at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:36)
at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:32)
at jnr.posix.LazyPOSIX.isNative(LazyPOSIX.java:370)
at org.jruby.RubyGlobal.prepareStdioChannel(RubyGlobal.java:279)
at org.jruby.RubyGlobal.createGlobals(RubyGlobal.java:193)
at org.jruby.Ruby.init(Ruby.java:1241)
at org.jruby.Ruby.newInstance(Ruby.java:330)
at org.jruby.Main.internalRun(Main.java:278)
at org.jruby.Main.run(Main.java:239)
at org.jruby.Main.main(Main.java:201)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.ensureError(J9VMInternals.java:134)
at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:123)
at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:49)
at jnr.ffi.provider.jffi.Provider.(Provider.java:29)
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1920)
at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.(FFIProvider.java:57)
at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
at jnr.ffi.Runtime$SingletonHolder.(Runtime.java:82)
at jnr.ffi.Runtime.getSystemRuntime(Runtime.java:67)
... 19 more
Caused by: java.lang.IllegalStateException: Cause already initialized
at java.lang.Throwable.setCause(Throwable.java:361)
at java.lang.Throwable.initCause(Throwable.java:339)
at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:252)
at com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
at com.kenai.jffi.Type.resolveSize(Type.java:155)
at com.kenai.jffi.Type.size(Type.java:138)
at jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:178)
at jnr.ffi.provider.AbstractRuntime.(AbstractRuntime.java:48)
at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:57)
at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:41)
at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.(NativeRuntime.java:53)
... 28 more
TypeError: no implicit conversion of nil into String
reopen at org/jruby/RubyIO.java:582

@sfrieske

This comment has been minimized.

Copy link
Author

commented Mar 10, 2016

uname -a: AIX f36smd1 1 7 00F646FB4C00

java --version:

java7/jre/bin/java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build pap6470_27sr3fp10-20150708_01(SR3 FP10))
IBM J9 VM (build 2.7, JRE 1.7.0 AIX ppc64-64 Compressed References 20150630_255653 (JIT enabled, AOT enabled)
J9VM - R27_Java727_SR3_20150630_2236_B255653
JIT - tr.r13.java_20150623_94888.01
GC - R27_Java727_SR3_20150630_2236_B255653_CMPRSS
J9CL - 20150630_255653)
JCL - 20150628_01 based on Oracle jdk7u85-b15

@headius

This comment has been minimized.

Copy link
Member

commented Mar 10, 2016

@ssteidte Is that the complete output from native.verbose? If so, it looks like this might be a simple bug in JFFI.

I don't suppose there's any way to get shell access to an equivalent environment, so we can debug and test this in place?

In the interim, my recommendation to you (if you have cycles to work with us) would be to start checking out JNR projects and see if they build and test successfully, starting with https://github.com/jnr/jffi and then moving on to jnr-ffi and jnr-posix. I suspect at least one of them will fail to run, which will give us something concrete to work on.

@headius

This comment has been minimized.

Copy link
Member

commented Mar 10, 2016

FYI, all the JNR projects are straightforward maven projects; mvn package should be sufficient to build and run tests.

@sfrieske

This comment has been minimized.

Copy link
Author

commented Mar 11, 2016

Yes, that was the whole output (I've just leaved out the Ruby part that is shown in the first post).
Unfortunately I don't have enough space on the AIX machine to do substantial stuff like compilations.
Anything else, like test runs - volontarily.

@headius

This comment has been minimized.

Copy link
Member

commented Mar 11, 2016

Ok, well I'll stick with you until we can figure this out. I'm poking around for AIX cloud options now.

Meanwhile...

I think the general situation here is that our native support for AIX is failing to load, which in turn breaks a lot of things that expect to use native calls on *nix platforms. So he first thing to do is to figure out why it fails to load.

I need from you:

  • uname -a (or as much of it as you're comfortable revealing)
  • JDK version
  • Output of jruby -rpp -e "pp RbConfig::CONFIG"

If it's at all possible to try building jffi on AIX, that's going to be our fastest path forward. If you can stop by our IRC chat room today (http://chat.jruby.org) that would also help things along.

@headius

This comment has been minimized.

Copy link
Member

commented Mar 11, 2016

If you decide you want to try the jffi build (requires Apache Maven, any recent version):

git clone https://github.com/jnr/jffi
cd jffi
mvn clean test

...and we can iterate from there.

@sfrieske

This comment has been minimized.

Copy link
Author

commented Mar 29, 2016

uname -a:
AIX f36smd1 1 7 00F646FB4C00

java -version:
java version "1.7.0"
Java(TM) SE Runtime Environment (build pap6470_27sr3fp10-20150708_01(SR3 FP10))
IBM J9 VM (build 2.7, JRE 1.7.0 AIX ppc64-64 Compressed References 20150630_255653 (JIT enabled, AOT enabled)
J9VM - R27_Java727_SR3_20150630_2236_B255653
JIT - tr.r13.java_20150623_94888.01
GC - R27_Java727_SR3_20150630_2236_B255653_CMPRSS
J9CL - 20150630_255653)
JCL - 20150628_01 based on Oracle jdk7u85-b15

jruby -rpp -e "pp RbConfig::CONFIG": gives the error that this is all about

@headius

This comment has been minimized.

Copy link
Member

commented Apr 20, 2016

Anyone manage to get an AIX build of jffi working? Going to have to punt this since we don't really have a way to investigate it. We need your help.

Note that fixes in jnr/jnr-enxio#12 may have improved this bug too, and it should be shipping with latest JRuby versions (1.7.25 and 9.1).

@headius headius added the packaging label Apr 20, 2016

@headius headius modified the milestones: JRuby 9.1.1.0, JRuby 9.1.0.0 Apr 20, 2016

@tajila

This comment has been minimized.

Copy link

commented Apr 25, 2016

I did the following:
git clone https://github.com/jnr/jffi
cd jffi
mvn clean test

and got the following output:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jffi 1.2.12-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jffi ---
[INFO] Deleting /team/tobi/jffibug/jffi/target
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ jffi ---
[INFO]
[INFO] --- maven-antrun-plugin:1.6:run (build-native-library) @ jffi ---
[WARNING] Parameter tasks is deprecated, use target instead
[INFO] Executing tasks

main:

-generate-version-source:
[echo] Generating Version.java
[mkdir] Created dir: /team/tobi/jffibug/jffi/target/classes
[mkdir] Created dir: /team/tobi/jffibug/jffi/target/java/com/kenai/jffi
[INFO] Executed tasks
[INFO] Registering compile source root /team/tobi/jffibug/jffi/target/java
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jffi ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /team/tobi/jffibug/jffi/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jffi ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 43 source files to /team/tobi/jffibug/jffi/target/classes
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] /team/tobi/jffibug/jffi/src/main/java/com/kenai/jffi/ClosureMagazine.java:[57,21] free() in com.kenai.jffi.Closure.Handle has been deprecated
[WARNING] /team/tobi/jffibug/jffi/src/main/java/com/kenai/jffi/HeapInvocationBuffer.java: Some input files use unchecked or unsafe operations.
[WARNING] /team/tobi/jffibug/jffi/src/main/java/com/kenai/jffi/HeapInvocationBuffer.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-bundle-plugin:2.4.0:manifest (jffi-complete) @ jffi ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jffi ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-antrun-plugin:1.6:run (default) @ jffi ---
[WARNING] Parameter tasks is deprecated, use target instead
[INFO] Executing tasks

main:
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-Darwin.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-arm-Linux.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-i386-FreeBSD.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-i386-Linux.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-i386-OpenBSD.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-i386-SunOS.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-i386-Windows.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-ppc-AIX.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-ppc-Linux.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-ppc64-Linux.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-ppc64le-Linux.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-s390x-Linux.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-sparc-SunOS.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-sparcv9-SunOS.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-x86_64-FreeBSD.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-x86_64-Linux.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-x86_64-OpenBSD.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-x86_64-SunOS.jar into /team/tobi/jffibug/jffi/target
[unzip] Expanding: /team/tobi/jffibug/jffi/archive/jffi-x86_64-Windows.jar into /team/tobi/jffibug/jffi/target
[INFO] Executed tasks
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ jffi ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ jffi ---
[INFO] Tests are skipped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.611 s
[INFO] Finished at: 2016-04-25T14:42:07-04:00
[INFO] Final Memory: 20M/34M
[INFO] ------------------------------------------------------------------------

@sfrieske

This comment has been minimized.

Copy link
Author

commented Sep 1, 2016

Assuming jffi as culprit seems to be right. Tried the brand new version 9.1.3 and the error is now much later after the startup:
NotImplementedError: flock unsupported or native support failed to load; see http://wiki.jruby.org/Native-Libraries
flock at org/jruby/RubyFile.java:318
create_logfile at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/logger.rb:712

@enebo enebo modified the milestones: JRuby 9.1.4.0, JRuby 9.1.5.0 Sep 1, 2016

@headius

This comment has been minimized.

Copy link
Member

commented Sep 6, 2016

If the error is much later than startup, I start to wonder if it's fixed but something unrelated is now broken. We have had some issues with flock not booting on platforms where fcntl is preferred for file-locking (like several non-Linux, non-BSD OSes) and have just added the function correctly or worked to reimplement it using appropriate calls (see jnr/jnr-posix#60, for example).

So, if we can patch around this we may find things are working correctly.

@enebo enebo modified the milestones: JRuby 9.1.5.0, JRuby 9.1.6.0 Sep 7, 2016

@headius

This comment has been minimized.

Copy link
Member

commented Sep 26, 2016

Link with #4112.

@headius headius modified the milestones: JRuby 9.2.0.0, JRuby 9.1.6.0 Nov 8, 2016

@sfrieske

This comment has been minimized.

Copy link
Author

commented Jan 12, 2017

update for JRuby 9.1.7: basically the same as in 9.1.3

NotImplementedError: flock unsupported or native support failed to load; see http://wiki.jruby.org/Native-Libraries
flock at org/jruby/RubyFile.java:324
create_logfile at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/logger.rb:712
open_logfile at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/logger.rb:705
set_dev at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/logger.rb:695
initialize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/logger.rb:635
initialize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/logger.rb:353

@headius

This comment has been minimized.

Copy link
Member

commented Jan 13, 2017

Damn flock again!

So is there no flock on AIX? It sounds like the FFI library is loading but it can't bind some things. This would be a situation similar to Solaris, where we must use fcntl to emulate flock.

@iconoclast

This comment has been minimized.

Copy link

commented Jan 25, 2017

I seem to be running into this bug as well. The original "TypeError: no implicit conversion of nil into String", that is, I haven't made it as far as the flock issue yet.

The comments above seem to suggest that an update to libjffi got past the original error message, but I'm still running into that error with JRuby 9.1.7.0. Is there some piece I'm missing that doesn't involve compiling jffi and friends from scratch?

@iconoclast

This comment has been minimized.

Copy link

commented Feb 7, 2017

Although it's true that libjffi-1.2.a is broken on 64bit AIX and should be certainly be fixed, that may be tangential to the issue here. It turns out that libjffi was borked in JRuby 1.7 as well, yet the code I have triggering this error on 9k runs fine on 1.7.

A simple require "io/console" on 1.7 will give a warning of "io/console not supported; tty will not be manipulated" but then the program continues to run.
The same require statement on 9.1.7.0 will die with a stack trace like the one at the top of this ticket.
In both cases jruby.native.verbose shows the "Failed to load native POSIX impl..." message and stacktrace like the one seen earlier in this ticket.

The relevant portion of console.rb is essentially the same in both versions of JRuby. The error shown at the start of this ticket is being triggered by $stderr.reopen but only because there is a rescue clause masking the previous error triggered by $stderr.dup a few lines earlier. Both of these methods appear to work in 1.7. Since this code is outside of any class definition it is run as soon as the require occurs which also makes it difficult to monkeypatch around it.

Digging further down the rabbit hole takes us into RubyIO.java which is significantly different in 9k. At a glance I didn't spot any obvious reason why 1.7 has a working fallback and 9k doesn't, but I'm also probably in over my head at this point.

So although a working libjffi would be ideal, it seems like JRuby 1.7 had enough of a fallback implementation to continue to work well enough (for some anyway) even in the absence of a working libjffi, while 9k does not.

@headius

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

@iconoclast What are you running that produces the type error?

The methods you say work fine in 1.7 are likely not dependent on native operations at all, preferring Java/JDK equivalents. So there's some platform exercise needed.

It would be a lot easier to maintain AIX support if it were possible for us to run it locally and in CI 😢 I'll poke around and see if it's possible to do that today.

@iconoclast

This comment has been minimized.

Copy link

commented Feb 13, 2017

@headius Reproducing this is as simple as requiring 'io/console'.

bash-3.2$ java -jar jruby-complete-1.7.8.jar -e 'require "io/console"; puts "we did it!!!!";'
io/console not supported; tty will not be manipulated
we did it!!!!
bash-3.2$ java -jar jruby-complete-9.1.7.0.jar -e 'require "io/console"; puts "we did it!!!!";'
TypeError: no implicit conversion of nil into String
   reopen at org/jruby/RubyIO.java:599
   <main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/io/console.rb:224
  require at org/jruby/RubyKernel.java:961
   (root) at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
   <main> at -e:1

As for how I'm using it in my project? Well I'm not actually using io/console directly in any of my own code but some of my gem dependencies do. From the traceback it would appear that Bundler is the first such gem to trip this.

@headius

This comment has been minimized.

Copy link
Member

commented Feb 13, 2017

I have had little luck finding an AIX machine I can test against, so we're going to have to do some back-and-forth here.

Run that again but pass -Xbacktrace.style=full to JRuby, so I can see the full Java trace.

@iconoclast

This comment has been minimized.

Copy link

commented Feb 14, 2017

No problem. Happy for the help.

Well, -Xbacktrace.style=full just complained jruby: invalid extended option backtrace.style=full (-X will list valid options)
But I had a little better luck with -Djruby.backtrace.style=full

bash-3.2$ java -Djruby.backtrace.style=full -jar jruby-complete-9.1.7.0.jar -e 'require "io/console"; puts "we did it!!!!";' 
TypeError: no implicit conversion of nil into String
                  getStackTraceImpl at java/lang/Thread.java:-2
                      getStackTrace at java/lang/Thread.java:1114
                   getBacktraceData at org/jruby/runtime/backtrace/TraceType.java:246
                       getBacktrace at org/jruby/runtime/backtrace/TraceType.java:47
                   prepareBacktrace at org/jruby/RubyException.java:235
                           preRaise at org/jruby/exceptions/RaiseException.java:216
                           preRaise at org/jruby/exceptions/RaiseException.java:183
                             <init> at org/jruby/exceptions/RaiseException.java:111
                  newRaiseException at org/jruby/Ruby.java:4109
                       newTypeError at org/jruby/Ruby.java:3780
  handleImplicitlyUncoercibleObject at org/jruby/util/TypeConverter.java:400
            handleUncoercibleObject at org/jruby/util/TypeConverter.java:396
                    convertToType19 at org/jruby/util/TypeConverter.java:99
                    convertToType19 at org/jruby/util/TypeConverter.java:155
                      convertToType at org/jruby/util/TypeConverter.java:123
                    convertToString at org/jruby/RubyBasicObject.java:781
                           get_path at org/jruby/RubyFile.java:1398
                             reopen at org/jruby/RubyIO.java:599
                               call at org/jruby/RubyIO$INVOKER$i$0$1$reopen.gen:-1
                               call at org/jruby/internal/runtime/methods/JavaMethod.java:720
                               call at org/jruby/internal/runtime/methods/DynamicMethod.java:200
                       cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:338
                               call at org/jruby/runtime/callsite/CachingCallSite.java:163
                        processCall at org/jruby/ir/interpreter/InterpreterEngine.java:315
                          interpret at org/jruby/ir/interpreter/StartupInterpreterEngine.java:73
                     INTERPRET_ROOT at org/jruby/ir/interpreter/Interpreter.java:112
                             <main> at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/io/console.rb:224
                            execute at org/jruby/ir/interpreter/Interpreter.java:99
                            execute at org/jruby/ir/interpreter/Interpreter.java:35
                            execute at org/jruby/ir/IRTranslator.java:42
                     runInterpreter at org/jruby/Ruby.java:835
                           loadFile at org/jruby/Ruby.java:2872
                               load at org/jruby/runtime/load/LibrarySearcher.java:243
                               load at org/jruby/runtime/load/LibrarySearcher.java:34
          tryLoadingLibraryOrScript at org/jruby/runtime/load/LoadService.java:887
                  smartLoadInternal at org/jruby/runtime/load/LoadService.java:527
                            require at org/jruby/runtime/load/LoadService.java:398
                      requireCommon at org/jruby/RubyKernel.java:968
                          require19 at org/jruby/RubyKernel.java:961
                               call at org/jruby/RubyKernel$INVOKER$s$1$0$require19.gen:-1
                               call at org/jruby/internal/runtime/methods/JavaMethod.java:383
                               call at org/jruby/internal/runtime/methods/AliasMethod.java:61
                               call at org/jruby/runtime/callsite/CachingCallSite.java:161
                        processCall at org/jruby/ir/interpreter/InterpreterEngine.java:315
                          interpret at org/jruby/ir/interpreter/StartupInterpreterEngine.java:73
                          interpret at org/jruby/ir/interpreter/InterpreterEngine.java:84
                   INTERPRET_METHOD at org/jruby/internal/runtime/methods/MixedModeIRMethod.java:179
                             (root) at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
                               call at org/jruby/internal/runtime/methods/MixedModeIRMethod.java:165
                               call at org/jruby/internal/runtime/methods/DynamicMethod.java:200
                       cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:338
                               call at org/jruby/runtime/callsite/CachingCallSite.java:163
               invokeOther1:require at -e:1
                             <main> at -e:1
                invokeWithArguments at java/lang/invoke/MethodHandle.java:463
                               load at org/jruby/ir/Compiler.java:90
                          runScript at org/jruby/Ruby.java:823
                        runNormally at org/jruby/Ruby.java:742
                        runNormally at org/jruby/Ruby.java:760
                        runFromMain at org/jruby/Ruby.java:573
                      doRunFromMain at org/jruby/Main.java:417
                        internalRun at org/jruby/Main.java:305
                                run at org/jruby/Main.java:232
                               main at org/jruby/Main.java:204
@DanHeidinga

This comment has been minimized.

Copy link

commented Feb 14, 2017

For access to AIX (and Linux on Power), check out the "IBM Power Development Cloud (PDP)":

https://www-356.ibm.com/partnerworld/wps/servlet/ContentHandler/stg_com_sys_power-development-platform

I'm told this is a way to get access to Power machines for debugging / testing. Caveat: I haven't tried it yet as my access request is pending.

@iconoclast

This comment has been minimized.

Copy link

commented Feb 23, 2017

@headius any other info you need from this end that may be of help?

@headius

This comment has been minimized.

Copy link
Member

commented May 16, 2018

I think we need to update this bug and see if it's still working with recent fixes and rebuilds of the AIX support.

@headius headius modified the milestones: JRuby 9.2.0.0, JRuby 9.2.1.0 May 16, 2018

@headius

This comment has been minimized.

Copy link
Member

commented May 16, 2018

May be fixed in 9.2 with updated jffi AIX support. Need someone to confirm whether it still exists. Bumped to 9.2.1 in case it's still broken.

@headius

This comment has been minimized.

Copy link
Member

commented Oct 11, 2018

No confirmation and good chance this is fixed with updated AIX support. Optimistically closing.

@headius headius closed this Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.