harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregory Shimansky (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1933) [drlvm][test] Code for reproduction of hanged gc.LOS test
Date Tue, 28 Nov 2006 15:33:25 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1933?page=all ]

Gregory Shimansky updated HARMONY-1933:
---------------------------------------

    Issue Type: Test  (was: Bug)

> [drlvm][test] Code for reproduction of hanged gc.LOS test
> ---------------------------------------------------------
>
>                 Key: HARMONY-1933
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1933
>             Project: Harmony
>          Issue Type: Test
>          Components: DRLVM
>         Environment: WinXP, msvc
>            Reporter: Nikolay Chugunov
>
> I reduce code for gc.LOS test which reproduce hang of it. I should notice that both gc.LOS
and my test hang only on WinXP, but they pass on Linux SuSe ia32, Win2003 OSs.
> package gc;
> public class LOS extends Thread {
>     private static boolean started = false;
>     private static Object  lock    = new Integer(1);
>     public static void main(String[] args) throws InterruptedException {
>         Thread[] threads = new Thread[200];
>         for (int i = 0; i < threads.length; i++) {
>             threads[i] = new LOS();
>             threads[i].start();
>         }
>         synchronized (lock) {
>             started = true;
>             lock.notifyAll();
>         }
>         System.out.println("Check point");
>         // Sometimes hangs just with threads[0].join();
>         for (int i = 0; i < threads.length; i++) {
>             threads[i].join();
>         }
>         System.out.println("Passed");
>     }
>     public void run() {
>         try {
>             System.out.print(".");
>             if (!started) {
>                 synchronized (lock) {
>                     lock.wait();
>                 }
>             }
>             Object[] objects = null;
>             for (int i = 0; i < 1000; i++) {
>                 objects = new Object[] { objects, allocate() };
>             }
>             System.out.print(",");
>         } catch (Throwable e) {
>             System.out.print("Exception");
>         }
>     }
>     private Object allocate() {
>         try {
>             exception();
>         } catch (NullPointerException e) {
>         }
>         return new byte[4096];
>     }
>     private void exception() {
>         String s = null;
>         s.length();
>     }
> }
> Sample output on RI:
> ................................................................................................................................................................
> ...............................Check point
> .........ExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptio
> nExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExcepti
> onExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExcept
> ionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExcep
> tionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExce
> ptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExc
> eptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionEx
> ceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionE
> xceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionException
> ExceptionExceptionException,ExceptionExceptionExceptionExceptionExceptionExcepti
> onExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExcept
> ionExceptionExceptionExceptionExceptionExceptionException,ExceptionExceptionExce
> ptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExc
> eptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionEx
> ceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionE
> xceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionException
> ExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptio
> nExceptionExceptionExceptionExceptionExceptionExceptionExceptionExceptionExcepti
> onExceptionExceptionException,,,Exception,,Exception,ExceptionException,Exceptio
> nExceptionException,,,,,,,,,,,,,,,,,,,,,,Passed
> Sample output on r463908, (Oct 16 2006), Windows/ia32/msvc:
> .....................................................................Check point
> ...................................................................................................................................


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message