java.lang.IllegalAccessException: no such method: rubyjit.<name>Serializer$$_fast_attributes - jruby

Seeing this error quite frequently.
Jruby 1.7.13
Ubuntu 14.
Sun Java 8 _05
ps -ef command for the process:
java -Xmx786m -Xss2048k -Djffi.boot.library.path=/home/ubuntu/server/tools/jruby/lib/jni -Xmn128m -server -Xbootclasspath/a:/home/ubuntu/server/tools/jruby/lib/jruby.jar -classpath : -Djruby.home=/home/ubuntu/server/tools/jruby -Djruby.lib=/home/ubuntu/server/tools/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main bin/rails s -p4005 -e production
Any idea what is causing that error infrequently.
Java::JavaLang::RuntimeException (com.headius.invokebinder.InvalidTransformException: java.lang.IllegalAccessException: no such method: rubyjit.ContactSerializer$$fast_attributes_a0671ee9e02931c7660594220ffed4d4fc58cad5681842940.__file_(ContactSerializer$$fast_attributes_a0671ee9e02931c7660594220ffed4d4fc58cad5681842940,ThreadContext,IRubyObject,Block)IRubyObject/invokeStatic):
org.jruby.runtime.invokedynamic.InvocationLinker.createRubyHandle(InvocationLinker.java:1689)
org.jruby.runtime.invokedynamic.InvocationLinker.access$900(InvocationLinker.java:75)
org.jruby.runtime.invokedynamic.InvocationLinker$RubyCallGenerator.generate(InvocationLinker.java:715)
org.jruby.runtime.invokedynamic.InvocationLinker.tryDispatchDirect(InvocationLinker.java:765)
org.jruby.runtime.invokedynamic.InvocationLinker.getTarget(InvocationLinker.java:775)
org.jruby.runtime.invokedynamic.InvocationLinker.invocationFallback(InvocationLinker.java:137)
rubyjit.ActiveModel::Serializer$$attributes_dbeb427ba2b0518d676c0a687aeb474a438bbc8b681842940.chained_0_rescue_1$RUBY$SYNTHETIC__file_(active_model_serializers (0.8.1) lib/active_model/serializer.rb:454)
rubyjit.ActiveModel::Serializer$$attributes_dbeb427ba2b0518d676c0a687aeb474a438bbc8b681842940.file(active_model_serializers (0.8.1) lib/active_model/serializer.rb)
rubyjit.ActiveModel::Serializer$$serializable_hash_77c90db1574839863dc0d7ab15cb761d318d3fad681842940.__file_(active_model_serializers (0.8.1) lib/active_model/serializer.rb:478)
rubyjit.ActiveModel::Serializer$$serializable_hash_15164681ef3759650116133c60c86faa4d0da16f681842940.file(active_model_serializers (0.8.1) lib/active_model/serializer.rb:360)
rubyjit.ActiveModel::ArraySerializer$$serializable_array_3e75f1b3d701c37c0dd6c09012f195834f37a85e681842940.block_0$RUBY$__file_(active_model_serializers (0.8.1) lib/active_model/array_serializer.rb:89)
rubyjit$ActiveModel::ArraySerializer$$serializable_array_3e75f1b3d701c37c0dd6c09012f195834f37a85e681842940$block_0$RUBY$__file_.call(rubyjit$ActiveModel::ArraySerializer$$serializable_array_3e75f1b3d701c37c0dd6c09012f195834f37a85e681842940$block_0$RUBY$__file_)
org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:135)
org.jruby.runtime.Block.yield(Block.java:142)
org.jruby.RubyArray.collect(RubyArray.java:2399)
org.jruby.RubyArray.map19(RubyArray.java:2412)
org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:458)

would be great if you can come up with a piece of script where this gets reproduced (and submit it to JRuby's issue tracker) as this is invoke-dynamic related, which gets turned on for you due Java 8.
work-around would be (unless you get other advice what the failure actually means - if it's fine to live with) to disable indy :
java -Djruby.compile.invokedynamic=false -Xmx786m -Xss2048k ...
or if you're about to use the jruby executable :
jruby -Xcompile.invokedynamic=false -S ...
both can be added to their corresponding XXX_OPTS environment variable

Related

DNNC throws error " terminate called after throwing an instance of 'invalid_random_param' "

I am working on a Xilinx DPU project and was able to train, freeze and quantize my model with the given tools and tensorflow. Now I wanted to use the dnnc-dpu1.4.0 compiler to generate an *.elf file. When executing this command:
dnnc-dpu1.4.0 \
--parser=tensorflow \
--frozen_pb=./quantize_results/deploy_model.pb \
--dpu=1152FA \
--cpu_arch=arm64 \
--output_dir=compile \
--save_kernel \
--mode normal \
--net_name=mnist
it throws this error:
terminate called after throwing an instance of 'invalid_random_param'
what(): Random Param Exception Happened
./compile.sh: line 22: 7602 Aborted (core dumped) dnnc-dpu1.4.0 --parser=tensorflow
--frozen_pb=./quantize_results/deploy_model.pb --dpu=1152FA --cpu_arch=arm64 --output_dir=compile --save_kernel --mode normal --net_name=mnist
I am not sure what to do because this error is very cryptic. It doesn't tell me where those parameters were used or occur, and I won't be able to do something about it. The model works perfectly fine, at least the layers and so on, as I was able to deploy the model itself before. The only thing I changed was the data set and output node count. What could this be? Why is there no extensive error description anywhere?
This is my output for dnnc-dpu1.4.0 --version:
dnnc version v2.05
DPU Target : v1.4.0
Build Label: Jun 24 2019 13:40:08
Copyright #2019 Xilinx Inc. All Rights Reserved.
So I should be up-to-date.
Could anybody help me? This is the last step before I'd be able to deploy my model on the Xilinx DPU. Thank you very much!
Update 1
I posted the same question in the Xilinx Community Forum already.
Update 2
Also, I already found this post on the Xilinx Community Forum, but this does not seem to have a solution to my problem. I can't update the DNNDK, an since I already compiled my model successfully and did no change anything with it, this "solution" seems to be non-applicable to my problem.

How to fix Kotlin REPL exception NoClassDefFoundError

I'm attempting to run the Kotlin REPL on my windows 10 machine, from the command line. I am receiving a java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder exception when running the command kotlinc
I have IntelliJ Ultimate 2019.1.3 installed, with the Kotlin plugin. I have the Kotlin standalone compiler also installed and I've added that location to my system path. I've tried to run the command from the standalone directory: "C:/Tools/kotlinc/bin" but no difference.
OS Name: Microsoft Windows 10 Enterprise
Version 10.0.16299 Build 16299
Kotlin version 1.3.40-release-123 (JRE 1.8.0_131-b11)
java version "1.8.0_131"
I expect the REPL to start without an exception. What could be causing the exception?
Thank you all!
It looks like that was a bug and it has been fixed with Kotlin plugin & kotlinc version 1.3.41 (released today).

JRuby disabled stack guard

I've installed jruby 1.7.4 and every time an program is executed I get the following error:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /opt/jruby/lib/native/arm- Linux/libjffi-1.2.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
I tried to disable the error message with the "execstack -c /opt/jruby/lib/native/arm- Linux/libjffi-1.2.so" but the error keeps creeping in.
How can disable/fix this error message?
simply install a somehow recent of JRuby 1.7.x ... that is e.g. 1.7.17 at the moment

JRuby java.lang.ClassCastException

I used a little Jruby script from http://www.javaworld.com/javaworld/jw-07-2006/jw-0717-ruby.html to test invokedynamic:
class ADuck
def quack()
puts "quack A";
end
end
class BDuck
def quack()
puts "quack B";
end
end
def quack_it(duck)
duck.quack
end
a = ADuck.new
b = BDuck.new
quack_it(a)
quack_it(b)
But when I compile in with JRuby to Java classfiles and then try to execute it I get the following exception:
Java HotSpot(TM) 64-Bit Server VM warning: Use -XX:+UnlockDiagnosticVMOptions be
fore EnableInvokeDynamic flag
Exception in thread "main" java.lang.ClassCastException: java.lang.Object cannot
be cast to java.lang.invoke.SwitchPoint
at org.jruby.runtime.invokedynamic.InvokeDynamicSupport.constantFallback
(InvokeDynamicSupport.java:659)
at duck_typing.__file__(duck_typing.rb:22)
at duck_typing.load(duck_typing.rb)
at duck_typing.main(duck_typing.rb)
My system: JDK 1.7.0_09 64bit on Windows 7 64bit, JRuby 1.7.2
Used commandlines:
jruby -Xcompile.invokedynamic=true -S jrubyc duck_typing.rb
java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp .;jruby-complete-1.7.2.jar duck_typing
A while ago I tested it on linux machine with same results and on Windows jdk8.
With JDK8 it worked, but gave me problems using the classfiles in another project.
Has anyone a idee how to fix it?
How can I use JRuby with indy on Java 7?
Except for the JRuby convenience parameter --server, all JVM runtime
parameters use the -J option, followed by the specific JVM setting.
For example:
Heap space settings: jruby -J-X
JRuby runtime settings: jruby -J-D
All the settings described in the following sections are JVM settings.
https://github.com/jruby/jruby/wiki/PerformanceTuning
try this instead
jruby -J-Xcompile.invokedynamic=true -S jrubyc duck_typing.rb

JRuby 1.7.1 and PsychParser error parsing UTF-8 YAML file (Rails 3.2.8)

In our JRuby/Rails project, we are using the i18n gem, and support Japanese as well as English. Our config/locales.ja.yml file is in UTF-8, without any BOM.
When running Rails 3.2.9 on JRuby 1.7.1, we now see the following error:
% jruby -S rake spec:models
Psych::SyntaxError: (C:/Projects/foobar/trunk/config/locales/ja.yml):
expected <block end>, but found Scalar while parsing a block
mapping at line 7 column 33
parse at org/jruby/ext/psych/PsychParser.java:213
...
This error for YAML parsing the ja.yml file is now happening on both our Windows XP and Linux development environments, and only seems to go away when we explicitly set the following system parameter for the JVM:
-Dfile.encoding=utf-8
Could anyone tell me why this is happening on JRuby 1.7.1?
I didn't see this in 1.6.8 or 1.7.0.
Over a year old now, but here is the answer:
http://jruby.org/2012/12/03/jruby-1-7-1.html
In that release, this happened:
Psych YAML engine updated to latest