You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting an NPE when trying to dump the IR. Per suggestion from @headius, I added this code snippet immediately after a class definition (sample MyClass):
class MyClass
def get
...
end
end
def dump_ir
m = MyClass.instance_method(:get)
jm = JRuby.ref(m)
scope = jm.get_method.get_ir_scope
printed_ir = org.jruby.ir.persistence.IRDumper.print_ir(scope, true)
bytes = printed_ir.to_byte_array
puts String.from_java_bytes(bytes)
end
dump_ir()
This fails at the IRDumper.print_ir line with the error:
LoadError: load error: <file> -- java.lang.NullPointerException: null
require at org/jruby/RubyKernel.java:1017
<main> at <file>.rb
...
I also tried it with another method on a module with the same result, eg
module MyModule
module_function def get
...
end
end
m = MyModule.method(:get)
Environment Information
jruby 9.3.13.0 (2.6.8) 2023-11-02 09b6f22 OpenJDK 64-Bit Server VM 11.0.15+0-adhoc..source on 11.0.15+0-adhoc..source +jit [x86_64-linux]
I am guessing something specific where the '...' is in your report is not printing and causing a NPE. You can also try adding -Xlog.backtraces or -Xlog.exceptions. Possibly even -Xbacktrace.style=raw will give your more info where the NPE is happening.
I'm getting an NPE when trying to dump the IR. Per suggestion from @headius, I added this code snippet immediately after a class definition (sample MyClass):
This fails at the
IRDumper.print_ir
line with the error:I also tried it with another method on a module with the same result, eg
Environment Information
The text was updated successfully, but these errors were encountered: