harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor V. Stolyarov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3203) [drlvm]Deadlock in vm_gc_lock_enum()
Date Tue, 20 Feb 2007 10:02:05 GMT
[drlvm]Deadlock in vm_gc_lock_enum()
------------------------------------

                 Key: HARMONY-3203
                 URL: https://issues.apache.org/jira/browse/HARMONY-3203
             Project: Harmony
          Issue Type: Bug
            Reporter: Igor V. Stolyarov


Application hangs on creation 7997's thread.

Test for reproduce:

import java.util.HashMap;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;

public class ObjectStreamClassTest{

    private static int MAX_THREADS = 10000;

    private class HashMapSerialize implements Runnable{
        HashMap map;
        byte[] form;
        public HashMapSerialize(HashMap map){ 
            this.map = map;
        }

        public void run(){
            try{
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(baos);
                oos.writeObject(map);
                oos.flush();
                form = baos.toByteArray();
                oos.close();
                baos.close();
            }catch(Exception e){
            }
        }
    }

    public ObjectStreamClassTest(){
    }

    public void run(){
        Thread[] t = new Thread[MAX_THREADS];
        HashMap hm = new HashMap();
        hm.put("Runnable.class", Runnable.class);
        try{
            for(int i = 0; i < MAX_THREADS; i++){
                t[i] = new Thread(new HashMapSerialize(hm));
                t[i].start();
                System.out.println("Thread " + i + ": - started");
            }
        }catch(Exception e){
            System.out.println("Test faild: " + e);
            return;
        }
        System.out.println("Test pass");
    }

    public static void main(String[] argv){
        ObjectStreamClassTest t = new ObjectStreamClassTest();
        t.run();
    }
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message