Peculiar stacktrace and an error I've never seen before

So someone has tried to run Revenge of the Titans on his Win 8 installation via Steam. Unlike the other 400,000 people with the game, when he tries it, he gets this stacktrace and the game quits:


Fri Feb 17 21:07:09 AKST 2017	java.lang.InternalError: DMH.invokeStatic_L_L=Lambda(a0:L,a1:L)=>{
Fri Feb 17 21:07:09 AKST 2017	    t2:L=DirectMethodHandle.internalMemberName(a0:L);
Fri Feb 17 21:07:09 AKST 2017	    t3:L=MethodHandle.linkToStatic(a1:L,t2:L);t3:L}
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandleStatics.newInternalError(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.LambdaForm.compileToBytecode(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.makePreparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.make(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.make(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.make(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.LambdaForm$NamedFunction.resolve(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle$Lazy.<clinit>(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.makePreparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.make(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandles$Lookup.getDirectMethod(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandles$Lookup.findStatic(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.BoundMethodHandle$Factory.makeCbmhCtor(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.BoundMethodHandle$Factory.makeCtors(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.BoundMethodHandle$SpeciesData.initForBootstrap(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.BoundMethodHandle$SpeciesData.<clinit>(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.BoundMethodHandle.<clinit>(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.LambdaForm.createIdentityForms(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.LambdaForm.<clinit>(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.makePreparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.DirectMethodHandle.make(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandles$Lookup.getDirectMethodForConstant(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at sun.security.util.AbstractAlgorithmConstraints.loadAlgorithmsMap(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at sun.security.util.AbstractAlgorithmConstraints.getAlgorithms(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at sun.security.util.DisabledAlgorithmConstraints.<init>(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at sun.security.ssl.SSLAlgorithmConstraints.<clinit>(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at sun.security.ssl.ProtocolVersion.<clinit>(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at sun.security.ssl.SSLContextImpl$AbstractSSLContext.<clinit>(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.Class.forName0(Native Method)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.Class.forName(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.security.Provider$Service.getImplClass(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.security.Provider$Service.newInstance(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at sun.security.jca.GetInstance.getInstance(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at sun.security.jca.GetInstance.getInstance(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at javax.net.ssl.SSLContext.getInstance(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at net.puppygames.remote.client.Client.init(Client.java:531)
Fri Feb 17 21:07:09 AKST 2017		at net.puppygames.applet.Game.doInitRMI(Game.java:1618)
Fri Feb 17 21:07:09 AKST 2017		at net.puppygames.applet.Game.initRMI(Game.java:1614)
Fri Feb 17 21:07:09 AKST 2017		at net.puppygames.applet.Game.init(Game.java:1333)
Fri Feb 17 21:07:09 AKST 2017		at net.puppygames.applet.Launcher.main(Launcher.java:103)
Fri Feb 17 21:07:09 AKST 2017	Caused by: java.lang.NoClassDefFoundError: jdk/internal/org/objectweb/asm/ClassWriter
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.InvokerBytecodeGenerator.classFilePrologue(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.InvokerBytecodeGenerator.generateCustomizedCodeBytes(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		at java.lang.invoke.InvokerBytecodeGenerator.generateCustomizedCode(Unknown Source)
Fri Feb 17 21:07:09 AKST 2017		... 50 more

I’ve never seen anything remotely like this before in 7 years or so. The line in question in Client.java:531:


	SSLContext context = SSLContext.getInstance("SSL");

RotT comes with its own embedded Java 8 VM.

Cas :slight_smile:

1st place I’d look would be JAVA_TOOL_OPTIONS or _JAVA_OPTIONS environment variables for anything untoward.
Presumably you log & report the values of these on launch?

As it happens I don’t log env variables (mostly on account of never having had a problem like this before…!) but I guess it’s never too late to start…

The NoClassDefFoundError is impossible with the JRE shipped with the game as it’s in rt.jar, so I can only assume that there’s another rt.jar kicking about somewhere on this guy’s system that is somehow picked up in preference to the embedded JRE. I can’t quite figure out the mechanism by which this would be possible though as I don’t even use a “javaw.exe” - I have my own custom native JNI invoke launcher.

Cas :slight_smile:

Granted it really does seem like some internal class, possible rt.jar is an old version.
Would be kinda easy to test this manually by getting an old rt.jar

But as you say that really should never be able to happen. You locally launch your jre… which is just an executable as any; It shouldn’t be possible for that call to be redirected unless this person has a software running that does exactly that, which I wouldn’t assume.

Yeah, I had that thought today too.

Perhaps you’ve detected someone messing around with your game in a dev environment, for some nefarious (or otherwise) purpose.

Maybe Windows try force use own Java…
Or maybe its bug JVM (that was fixed in next version)

  • so maybe try ships more new version of Java

Says the user:

So, I appear to have resolved the issue.

I ran Steam -> Uninstall … (again) on Revenge of the Titans, then went into the library directory (in this case E:\Games\SteamLibrary\SteamApps\common) and manually renamed “Revenge of the Titans” to “Revenge of the Titans – old”, in order to get a completely fresh install. I then re-ran Steam -> Install on the game, and the game now starts up.

The files left-over after the Steam -> Uninstall… are all dated 2014-01-10, and include meta-index files, a few .dlls, zoneinfo files (lib/zi), and some font-related files.

The meta-index files are of particular interest; based on the content of the files (they list Java class paths), and some brief searching on Google, it appears they’re used by Java to reduce load times on JARs. If there was a bad class (outdated, obsolete, etc.) listed in one of those files it’s possible that was causing the conflict.

Unfortunately I have no idea what created them. It is entirely possible the system that had Minecraft installed, with Java tweaking to get it working, caused the issue, and I’ve simply been transferring this data along until it finally broke something else.

Cas :slight_smile:

You can try use custom Class Loader for shiped JVM, it prevents Code running from 3d party JVM
And gives some protection from decompilers

Or if you want open code (maybe for custom mods)
You can use Custom class loader only for 1 Main class

The problem was that he had some files mingled in with his distribution somehow - nothing one can really do about that.

Cas :slight_smile:

Hm, maybe pack Game resource in some 1 big file with ".pak” extension
and make updates downloading new .pak files above

like big games do (blizzard games)
they have every new update as 1 file

but because error happens in 0.001% users – no one’s care XD

up: + Add files hash check - if file corrupted - redownload it
its easy to integrate)