Re: [Sablevm-developer] sablevm hang
Brought to you by:
egagnon
From: Joseph P. <pa...@mc...> - 2004-06-18 15:24:40
|
I'll have to second that. I've ran through some code and the f.dispose does seem to finish and return, and it does seem the thread isn't being destroyed (otherwise the vm should exit). Is it possibly something in the Window.dispose code that's confusing the VM? I've only gone so far as to gurantee that each call is completing, but not actually tracing each call. I also found that removing this call in Window.dispose: getToolkit().getSystemEventQueue().postEvent(we); seems to allow the engine to exit after completion. I'll have to do further testing to verify that's really what's causing the problem, but it seems so at first glance. --Joe On Fri, 18 Jun 2004, Chris Pickett wrote: > Chris Pickett wrote: > > Joseph Paris wrote: > > > >>Yeah, i made that sounds confusing ;p I meant to say that i have no > >>problem using the AwtUtils.init... by itself, nor do i have a problem > >>burying an awt class way down in a series of class instantiations > >>(currently tried about 6 levels down). > >> > >>However, in the current code base (JXTA) if i remove the call to > >>AwtUtils.init... the next call (which instantiates a class that displays a > >>Frame) hangs with the same problem and at VMObject.wait. I'm not sure > >>if i'm hitting a thread limit or what, it seems kind of odd that the same > >>problem occurs regardless of whether or not i call AwtUtils.init or create > >>a new Frame. > >> > >>I'll try your suggestions below and post some results. > > > > > > Let's work from the AwtUtils.java that I modified to have a main() > > method. It runs with Sun's JDK but hangs with sablevm AFAICT. Try and > > simplify just that until it doesn't hang, and give us the minimal > > hanging example. For example, you can remove the "f.dispose();" line > > and it will still hang, but not the "Frame f = new Frame();" line. > > Hi again ... > > I narrowed down the test case a bit, and looked up some docs. I'm going > to bed now, but if someone feels inspired to look at it: > > http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Window.html#dispose() > http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/AWTThreadIssues.html > > Here is the more simple test case: > > http://www.sable.mcgill.ca/~cpicke/sablevm/AwtUtils2.java > > Also, if I run: > > sablevm-switch-debug --property=sablevm.verbose.instructions=true > --property=sablevm.verbose.methods=true -s -g -j AwtUtils2 &> log & > > and then do: > > tail -n 50 log > > I get: > > T1: [verbose instructions: executing @0x4152c37c ALOAD] > T1: [verbose instructions: executing @0x4152c384 ALOAD_0] > T1: [verbose instructions: executing @0x4152c388 GETFIELD_REFERENCE] > T1: [verbose instructions: executing @0x4152c394 ILOAD_3] > T1: [verbose instructions: executing @0x4152c398 AALOAD] > T1: [verbose instructions: executing @0x4152c39c PUTFIELD_REFERENCE] > T1: [verbose instructions: executing @0x4152c3a8 ALOAD_0] > T1: [verbose instructions: executing @0x4152c3ac GETFIELD_REFERENCE] > T1: [verbose instructions: executing @0x4152c3b8 ILOAD_3] > T1: [verbose instructions: executing @0x4152c3bc ALOAD] > T1: [verbose instructions: executing @0x4152c3c4 AASTORE] > T1: [verbose instructions: executing @0x4152c3c8 RETURN] > T1: [verbose methods: exiting method > java/util/HashMap.addEntry(Ljava/lang/Object;Ljava/lang/Object;IZ)V] > T1: [ returning to > java/util/HashMap.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;] > T1: [verbose instructions: executing @0x4152bf34 ACONST_NULL] > T1: [verbose instructions: executing @0x4152bf38 ARETURN] > T1: [verbose methods: exiting method > java/util/HashMap.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;] > T1: [ returning to > java/lang/ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;] > T1: [verbose instructions: executing @0x413de548 POP] > T1: [verbose instructions: executing @0x413de54c ALOAD] > T1: [verbose instructions: executing @0x413de554 ALOAD_3] > T1: [verbose instructions: executing @0x413de558 MONITOREXIT] > T1: [verbose instructions: executing @0x413de55c ARETURN] > T1: [verbose methods: exiting method > java/lang/ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;] > T1: [ returning to > java/lang/ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class;] > T1: [verbose instructions: executing @0x413de304 ARETURN] > T1: [verbose methods: exiting method > java/lang/ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class;] > T1: [ returning to > java/lang/VirtualMachine.createClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;] > T1: [verbose instructions: executing @0x415418c4 ARETURN] > T1: [verbose methods: exiting method > java/lang/VirtualMachine.createClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;] > T1: [ returning to MyThread.run()V] > T1: [verbose instructions: executing @0x80511c0 INTERNAL_CALL_END] > T1: [verbose instructions: executing @0x413feb74 ASTORE_1] > T1: [verbose instructions: executing @0x413feb78 GOTO] > T1: [verbose instructions: executing @0x413feb80 RETURN] > T1: [verbose methods: exiting method MyThread.run()V] > T1: [ returning to AwtUtils.main([Ljava/lang/String;)V] > T1: [verbose instructions: executing @0x413fe570 REPLACE] > T1: [verbose instructions: executing @0x413fe57c GOTO] > T1: [verbose instructions: executing @0x413fe514 RETURN] > T1: [verbose methods: exiting method AwtUtils.main([Ljava/lang/String;)V] > T1: [ returning to > java/lang/VirtualMachine.invokeMain(Ljava/lang/Class;[Ljava/lang/String;)V] > T1: [verbose instructions: executing @0x80511c0 INTERNAL_CALL_END] > [verbose methods: exiting method > java/lang/VirtualMachine.invokeMain(Ljava/lang/Class;[Ljava/lang/String;)V] > [ returning to > java/lang/VirtualMachine.main([Ljava/lang/String;)V] > T1: [verbose instructions: executing @0x413b2fc0 REPLACE] > T1: [verbose instructions: executing @0x413b2fcc GOTO] > T1: [verbose instructions: executing @0x413b2f1c RETURN] > T1: [verbose methods: exiting method > java/lang/VirtualMachine.main([Ljava/lang/String;)V] > T1: [verbose instructions: executing @0x80511c0 INTERNAL_CALL_END] > > It now looks to me like the started AWT thread never dies. If I remove > the call to dispose(), actually everything is fine (oddly this was not > the case with the more complex example). > > Cheers, > Chris > > |