[Bug 92] New: threading is broken (most visible on SMP)

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

           Summary: threading is broken (most visible on SMP)
           Product: SableVM
           Version: staging
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]


log into an SMP machine, like tofu.cs.mcgill.ca or magic.cs.mcgill.ca

compile ThreadStarter.java

$ for num in `seq 1 10000`; do sablevm -Y ThreadStarter; done

get the following four errors, plus core dumps as well.

error 1:

sablevm: thread.c:1104: _svmf_exit_object_monitor: Assertion
`_svmf_lockword_get_thinlock_id
((*(current->contention.requester.jobject))-> lockword) ==
env->thread.thinlock_id' failed.
-bash: line 23: 28147 Aborted                 sablevm -Y ThreadStarter

error 2:

java.lang.NullPointerException
   at IncrementRunnable.run (ThreadStarter.java:51)
   at ThreadStarter.main (ThreadStarter.java:38)
   at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)
   at java.lang.VirtualMachine.main (VirtualMachine.java:108)

error 3:

Exception in thread "Thread-1" java.lang.NullPointerException
   at IncrementRunnable.run (ThreadStarter.java:51)
   at java.lang.Thread.run (Thread.java:705)
   at java.lang.VMThread.callRun (VMThread.java:119)
   at java.lang.Thread.callRun (Thread.java:391)
   at java.lang.VirtualMachine.runThread (VirtualMachine.java:137)

error 4:

sablevm: global_refs.c:57: _svmh_new_native_global: Assertion
`native_global->next->previous == ((void *)0)' failed.
-bash: line 23: 15932 Aborted                 sablevm -Y ThreadStarter

--------- begin ThreadStarter.java -------------
/* attempts two different ways to start threads.
   
   note that none of:

     a) way 1; way 1;
     b) way 2; way 2;
     c) way 2; way 1;
 
   were observed to fail, with 100+ runs, whereas

     d) way 1; way 2;

   fails about 5 percent of the time on
   tofu.cs.mcgill.ca (2P).

   (if you make things more complex by adding another
    Runnable implementation, it fails more often, but
    this was the most stripped down I could get it)
*/

public class ThreadStarter {
    
    public ThreadStarter() {
    }    
    
    public static void main(String[] argv) {
        
        Runnable myRunnable;
        Thread myThread;  

        /* way 1 */
        myRunnable = new IncrementRunnable();
        myThread = new Thread(myRunnable);
        myThread.start();

        /* way 2 */
        myRunnable = new IncrementRunnable();
        myRunnable.run();
    }
}

class IncrementRunnable implements Runnable {

    private int k = 0;

    public IncrementRunnable() {
    }

    public void run() {
        for(int i=0;i<100;i++) {
            k++;
        }
    }
}
--------------- end ThreadStarter.java -------------------



------- 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.