You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vladimir Ivanov (JIRA)" <ji...@apache.org> on 2007/07/17 11:31:04 UTC

[jira] Resolved: (HARMONY-4302) [buildtest][vts] 3 vm/jvms/threads tests do not initialize used variables

     [ https://issues.apache.org/jira/browse/HARMONY-4302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Ivanov resolved HARMONY-4302.
--------------------------------------

    Resolution: Fixed

Thanks for your patch. It was applied at r556862. Please, verify. 


> [buildtest][vts] 3  vm/jvms/threads tests do not initialize used variables
> --------------------------------------------------------------------------
>
>                 Key: HARMONY-4302
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4302
>             Project: Harmony
>          Issue Type: Bug
>          Components: build - test - ci
>            Reporter: Vera Petrashkova
>            Assignee: Vladimir Ivanov
>         Attachments: threads.patch
>
>
> The following VTS VM tests are incorrect:
>     vm/jvms/threads/threads201/threads20101/threads20101.xml
>     vm/jvms/threads/threads209/threads20901/threads20901.xml
>     vm/jvms/threads/threads189/threads18901/threads18901.xml
> According to these tests descriptions (for example, see threads18901.xml)
> they should assign "a" and "b" variables during initialization, 
> then they modify "c" and "d" variable using "a" and "b" and check the values of "c" and "d".
> --------------------
>   <Description>
>       The test initializes the following fields
>               a = 1;              <<<<<<<<<<<<<<
>               b = 2;              <<<<<<<<<<<<<<
>               c = d = 0;
>       and starts two threads. The first thread concurrently calls
>       the following method:
>           public void anny() {
>               a = 3;
>               b = 4;
>           }
>       While the second thread calls concurrently the following method:
>           public void betty() {
>               c = a;
>               d = b;
>           }
>       (both methods are not synchronized)
>       After threads finished their calls, the master thread makes 
>       a synchronous check
>       of c and d values, for c to be either 1 or 3, for d to be either 2 or 4.
>       The procedure is repeated until timeout specified by delay parameter is 
>       reached.
>       Covered assertions assert_thread189
>   </Description>
> ----------------------
> But actually all these tests assign "c" and "d" variables during initialization:
> --------------threads18901p.j-------------------
> .method public <init>()V
>     .limit stack 2
>     .limit locals 1
>     aload_0
>     invokespecial
> org/apache/harmony/vts/test/vm/jvms/threads/share/InterruptibleTest/<init>()V
>     aload_0
>     iconst_1
>     putfield
> org/apache/harmony/vts/test/vm/jvms/threads/threads189/threads18901/threads18901p/c I   <<<<< c instead of  a
>     aload_0
>     iconst_2
>     putfield
> org/apache/harmony/vts/test/vm/jvms/threads/threads189/threads18901/threads18901p/d I   <<<< < d instead of  b
>     return
> .end method
> ----------------threads20101p.j---------------------
> .method public <init>()V
>     .limit stack 2
>     .limit locals 1
>     aload_0
>     invokespecial
> org/apache/harmony/vts/test/vm/jvms/threads/share/InterruptibleTest/<init>()V
>     aload_0
>     iconst_1
>     putfield
> org/apache/harmony/vts/test/vm/jvms/threads/threads201/threads20101/threads20101p/c I  <<<<< c instead of  a
>     aload_0
>     iconst_2
>     putfield
> org/apache/harmony/vts/test/vm/jvms/threads/threads201/threads20101/threads20101p/d I  <<<<< d instead of  b
>     return
> .end method
> -----------threads20901p.j-------------------------
> .method public <init>()V
>     .limit stack 2
>     .limit locals 1
>     aload_0
>     invokespecial
> org/apache/harmony/vts/test/vm/jvms/threads/share/InterruptibleTest/<init>()V
>     aload_0
>     iconst_1
>     putfield
> org/apache/harmony/vts/test/vm/jvms/threads/threads209/threads20901/threads20901p/c I  <<<<< c instead of  a
>     aload_0
>     iconst_2
>     putfield
> org/apache/harmony/vts/test/vm/jvms/threads/threads209/threads20901/threads20901p/d I   <<<<< d instead of  b
>     return
> .end method
> ----------------------------
> As the result if the second thread (Betty) executes before the first thread
> (Anny) then "c" and "d" have wrong value 0  and these tests fail.
> The initialization of "c" and "d" should be replaced by the initialization "a" and "b"

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