Open hohwille opened 4 years ago
According to your screenshots this bug is not related to System.out.println
. The reasons is somewhere in class initialization optimizer. Perhaps it's broken when ServiceLoader is used.
So my case was really special. The class that you can see in the debugger is loaded via ServiceLoader and then again loads other classes via ServiceLoader again inside the constructor. I assume this case is causing the bug. I moved that to an init method that I call externally after the initial class is loaded via ServiceLoader as a fix/workaround and then it is working. So if it helps, I could try to write a test-case reproducing this issue. However, I assume this rather has lower priority though it is still nice if it could be fixed.
I hit a strange bug in TeaVM compiler or boostrapping: The code:
Is leading to this exception: https://github.com/konsoletyper/teavm/blob/243901ec106b47399f1b88187ff2ed9e0c0b54d8/classlib/src/main/java/org/teavm/classlib/java/nio/charset/TCharsetEncoder.java#L78
I debugged this several times in the browser but get lost in the magic happening under the hood. I am aware that I seem to have hit a special case and the statement usually will work fine. However, I am trying to get help with the analysis to trace down the actual bug in TeaVM and make TeaVM better. Surely this problem can not be solved without further details. I am open to whatever may be preferred like a screensharing session with skype, zoom, jit.si, ... or I could commit and push my current state on my github project and you can clone and reproduce it. If you have other ideas or questions please do not hesitate to ask.