Hello Guest

[CLOSED] AppletLoader crashing java plugin on windows?

  • 17 Replies
  • 28128 Views
*

Offline smith

  • *
  • 45
[CLOSED] AppletLoader crashing java plugin on windows?
« on: January 20, 2011, 21:45:26 »
My lwjgl applet is crashing on Windows (all browsers) with the 1.6.0_23 plugin. No exceptions in the console (locked up). Can someone else check that it isn't just me:

http://www.angryoctopus.co.nz/webflight/WebFlight.html

Works fine under Linux.

*

Offline Matzon

  • *****
  • 2242
Re: AppletLoader crashing java plugin on windows?
« Reply #1 on: January 21, 2011, 06:48:40 »
getting the same effect on windows too - however, without some debug, I'd be hard pressed to say if it is the applet loader or your code :)

Re: AppletLoader crashing java plugin on windows?
« Reply #2 on: January 21, 2011, 07:56:57 »
I'm running 6u23 on windows 7 and it doesn't crash here...

Mike

*

Offline smith

  • *
  • 45
Re: AppletLoader crashing java plugin on windows?
« Reply #3 on: January 21, 2011, 07:57:21 »
Fixed the problem, turns out using the applet loader jars signed with the lwjgl cert mixed with any jars signed with the Odd labs cert will crash the Java plugin.

*

Offline Matzon

  • *****
  • 2242
Re: AppletLoader crashing java plugin on windows?
« Reply #4 on: January 21, 2011, 08:23:58 »
hmm, is it a bug in the JRE or is it the appletloaders certificate checking that is buggy?

*

Offline kappa

  • *****
  • 1319
Re: AppletLoader crashing java plugin on windows?
« Reply #5 on: January 21, 2011, 09:41:13 »
Thats odd, having different certificates should just show multiple security dialogs (one for each certificate) but there have been occasions were due to some buggy vm's it would freeze like you explain above. One would expect Oracle/Sun to have fixed these sort of issues by now.

Besides you should never need more then one certificate for your application/game anyway, if you don't need to sign your own jars, just use LWJGL's certificate or if you are signing yourself, just sign all the jars (including lwjgl jars) with your own certificate. Multiple Security dialogs just annoy users.

Just curious, were any of the certificates set to always remember (i.e. the checked box on the security dialog selected in a previous run)?

Also when you say crash the plugin do you mean that it would just freeze or actually crash?

I know you've fixed the issue now, but it would be useful if you could just upload an example of the crashing applet somewhere to allow further testing just to make sure its not the appletloader or if there is some workaround that can be used to stop the crash.
« Last Edit: January 21, 2011, 10:09:26 by kappa »

*

Offline smith

  • *
  • 45
Re: AppletLoader crashing java plugin on windows?
« Reply #6 on: January 21, 2011, 16:47:25 »
I tried removing all certificates and it still crashed. I wasn't deliberately mixing certificates, I was using the lwjgl zip downloads from SourceForge and they were signed with the old odd labs certificate. I updated the lwjgl_applet_util.jar,lzma.jar and the native jars because I knew they were required to be signed for the AppletLoader but I forgot that all the other lwjgl jars were also signed.
It's should be easy to reproduce, I don't think you even need an applet as it crashes in the AppletLoader while loading the jars, just put the lwgl.jar from the SF zip at lwjgl.org/applet and it will crash before the applet even starts running.

*

Offline kappa

  • *****
  • 1319
Re: AppletLoader crashing java plugin on windows?
« Reply #7 on: January 21, 2011, 16:52:18 »
If you do that, then the appletloader will finish doing its stuff successfully and your application will start. Now when your application makes a call that requires signed permissions from an unsigned jar it will crash due to the applet security manager and the jvm will throw a security exception in the java console.

*

Offline smith

  • *
  • 45
Re: AppletLoader crashing java plugin on windows?
« Reply #8 on: January 21, 2011, 19:39:05 »
Don't you have to accept the certificates before the applet starts? I never got any security exceptions in the java console and in fact the java console itself becomes unresponsive. I can set up an applet to demo the crash if someone more qualified is willing to try debug the issue.



*

Offline kappa

  • *****
  • 1319
Re: AppletLoader crashing java plugin on windows?
« Reply #9 on: January 21, 2011, 19:53:53 »
yeh, if you can set one up that'd be cool, can then allow narrowing down where its crashing.
« Last Edit: January 21, 2011, 19:58:45 by kappa »

*

Offline smith

  • *
  • 45
Re: AppletLoader crashing java plugin on windows?
« Reply #10 on: January 21, 2011, 20:36:04 »
Here is a copy of the original setup that was causing the jvm to lockup:
http://www.angryoctopus.co.nz/test/WebFlight.html


*

Offline kappa

  • *****
  • 1319
Re: AppletLoader crashing java plugin on windows?
« Reply #11 on: January 21, 2011, 20:46:03 »
ok thx for that, preliminary checks show that the appletloader does complete and the crash/hang is somewhere in the application.

Are you catching exceptions in your application somewhere and not throwing them again? (could explain why their is nothing in the console).

It'd be helpful if you could put a number of System.out.println()'s in your applications to narrow down exactly how far along it gets and where it stops.
« Last Edit: January 21, 2011, 20:48:11 by kappa »

*

Offline smith

  • *
  • 45
Re: AppletLoader crashing java plugin on windows?
« Reply #12 on: January 21, 2011, 20:53:23 »
I'm not catching any exceptions that don't have a printStackTrace() in the handling. I'll spam println statements through the app when I get home from work but my money would be on Display.create().

*

Offline smith

  • *
  • 45
Re: AppletLoader crashing java plugin on windows?
« Reply #13 on: January 22, 2011, 03:09:19 »
Ok, bunch of println() statements added at some key points in the lifecycle, test away.

*

Offline kappa

  • *****
  • 1319
Re: AppletLoader crashing java plugin on windows?
« Reply #14 on: January 22, 2011, 13:58:32 »
thanks.

I've spent some time today trying to debug this.

Also improved the debug mode in the AppletLoader to be more useful.

I can confirm that it does actually crash in the AppletLoader on method switchApplet() and so doesn't even reach your application.

Once the following line is called
Code: [Select]
Class appletClass = classLoader.loadClass(getParameter("al_main"));
it never returns, hence the freeze/crash, some sort of deadlock.

It does look like a jvm bug and without actually debugging the jvm not sure how else to fix this.

any ideas?
« Last Edit: January 22, 2011, 14:00:44 by kappa »