[Bug 84] Issues with threads and synchronizing

[email protected]
Newsgroups gmane.comp.java.vm.sablevm.bugs
Message-ID <[email protected]>
http://sablevm.org/bugs/show_bug.cgi?id=84

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From [email protected]  2004-12-28 14:17 -------
Dear Michele,

Thanks for the bug report.  I've tested this code with the current "staging"
code (which solves some class-loading related deadlock), and I was able to
reproduce the bug.

Using the key sequence [Ctrl]+\ , I was able to get a "Java" stack trace:
$ java-sablevm ProducerConsumerTest
Producer #1 put: 0
Consumer #1 got: 0
Producer #1 put: 1
Consumer #1 got: 1
Producer #1 put: 2
Consumer #1 got: 2
Producer #1 put: 3
Consumer #1 got: 3
Producer #1 put: 4
Consumer #1 got: 4
(dealdlock, so I typed ctrl-\)
--- stack trace dump (begin) ---
Thread ID: 1, Posix ID: 16384
--- stack trace dump (end) ---
--- stack trace dump (begin) ---
Thread ID: 2, Posix ID: 16386
(VMObject.java:-1)  java/lang/VMObject.wait  n
(Object.java:525)  java/lang/Object.wait   
(VMThread.java:432)  java/lang/VMThread.sleep   
(Thread.java:847)  java/lang/Thread.sleep   
(Thread.java:819)  java/lang/Thread.sleep   
(Producer.java:16)  Producer.run   
(VMThread.java:120)  java/lang/VMThread.callRun   
(Thread.java:391)  java/lang/Thread.callRun   
(VirtualMachine.java:118)  java/lang/VirtualMachine.runThread   
(internal frame)
--- stack trace dump (end) ---
--- stack trace dump (begin) ---
Thread ID: 3, Posix ID: 32771
(VMObject.java:-1)  java/lang/VMObject.wait  n
(Object.java:431)  java/lang/Object.wait   
(CubbyHole.java:8)  CubbyHole.get   
(Consumer.java:13)  Consumer.run   
(VMThread.java:120)  java/lang/VMThread.callRun   
(Thread.java:391)  java/lang/Thread.callRun   
(VirtualMachine.java:118)  java/lang/VirtualMachine.runThread   
(internal frame)
--- stack trace dump (end) ---

It seems Producer has gone to sleep forever.  I think what is happening is that
Math.random() produced 0, and the forwarded call to Object.wait(0) goes to sleep
forever.

[checking]

Yes, the "Classpath" code *and* documentation were wrong.  I fixed it in current
staging revision 3216.

If you want to try the fixed version, simply follow the instructions at:
http://sablevm.org/wiki/Getting#repository

The fix should be included in SableVM 1.1.8 (to be released very soon).




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.