You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Fedotov (JIRA)" <ji...@apache.org> on 2007/11/06 23:18:50 UTC

[jira] Created: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

[drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
-------------------------------------------------------------------------------------------

                 Key: HARMONY-5078
                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Linux x86-64
            Reporter: Alexei Fedotov


The stress test fails while passing arguments to the native function.

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


[jira] Updated: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky updated HARMONY-5078:
---------------------------------------

    Attachment: Test.c
                Test.java

I found the cause of the bug. According to the spec, first 8 floating point arguments to a function are passed in xmm0 - xmm7 registers. LIL stub loads values from the memory to xmm0 - xmm7 registers for the 1st 8 arguments. But if the number of floating point arguments is more than 8, then LIL stub uses xmm0 as a temporary register to load values from memory and write them to the stack as arguments for native method. Therefore the value for the 1st floating point argument is overwritten in xmm0 by the last floating point argument. Attached test demonstrates this behavior. Bug is in LIL for x86_64.

> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>         Attachments: Test.c, Test.java
>
>
> The stress test fails while passing arguments to the native function.

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


[jira] Closed: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky closed HARMONY-5078.
--------------------------------------


No response, assuming ok.

> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-5078.patch, Test.c, Test.java
>
>
> The stress test fails while passing arguments to the native function.

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


[jira] Assigned: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky reassigned HARMONY-5078:
------------------------------------------

    Assignee: Gregory Shimansky

> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-5078.patch, Test.c, Test.java
>
>
> The stress test fails while passing arguments to the native function.

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


[jira] Updated: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky updated HARMONY-5078:
---------------------------------------

    Attachment: HARMONY-5078.patch

I found the cause of the bug. LIL stub uses a temporary register to move data from stack to stack for called function. For this LIL should use xmm8 since xmm0-xmm7 are used for passing arguments.

But when LIL tries to use xmm8 instead encoder encodes it as xmm0. This happens because encoder has to specify REX.R (0x44) prefix in generated instruction. The function needs_rex_r checks for this. It happened that register passed to needs_rex_r had its RegName value 0x8080018 which is out of range for RegName_XMM8D (0x8080000) - RegName_XMM15D (0x808000f) constants. This happened because XMM registers index is always shifted by 0x10 in this function.

In function add_xmm generated RegName used get_idx() as an offset for RegName_XMM0D, but this offset has to begin with 0. Instead get_idx() returned value starting with 16 (or 8 on x86), so it is necessary to subtract xmm0_reg from the index to get the correct register. Attached patch does this. I also added a check in needs_rex_r for 128-bit XMM registers.

I need JIT team to review this patch. With it attached and the original tests pass.

> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>         Attachments: HARMONY-5078.patch, Test.c, Test.java
>
>
> The stress test fails while passing arguments to the native function.

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


[jira] Commented: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "George Timoshenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552323 ] 

George Timoshenko commented on HARMONY-5078:
--------------------------------------------

The patch looks good.

I can not say for sure that it does not break something else.
But your investigation clearly describes the problem and resulting patch. I see nothing suspicious.

I hope pre commit tests show no regressions.


> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>         Attachments: HARMONY-5078.patch, Test.c, Test.java
>
>
> The stress test fails while passing arguments to the native function.

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


[jira] Commented: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551475 ] 

Gregory Shimansky commented on HARMONY-5078:
--------------------------------------------

After checking amd64 spec I realized that double argument for param3 has to be passed in xmm0 register. Looking at the first registers dump I see that xmm0 contains 0x3fe604b2a4b0f3c2 which is the correct value. After executing JNI LIL stub xmm0 register contains 0x2aaa3cec6960 which is a wrong value. So the bug is in JNI LIL stub generated for native method.

> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>
> The stress test fails while passing arguments to the native function.

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


[jira] Commented: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "Ilya Leviev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545530 ] 

Ilya Leviev commented on HARMONY-5078:
--------------------------------------

r597436

stress.org.apache.harmony.test.stress.jni.arguments.ArgumentsTest
stress.org.apache.harmony.test.stress.jni.arrays.ArraysTest2
see log
http://people.apache.org/~smishura/r597436/Linux_x86_64/stress/stress/org/apache/harmony/test/stress/jni/arrays/111_ArraysTest2-out.txt

java version "1.5.0" 
pre-alpha : not complete or compatible
svn = r597436, (Nov 22 2007), Linux/em64t/gcc 4.1.0, release build
http://harmony.apache.org

Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
[debug] started null(org.apache.harmony.test.share.stress.ReliabilityRunner)
[debug] timeToWork = 30, timeToAbort = 30
[debug] started null(org.apache.harmony.test.share.stress.generator.Thread)
[debug] Thread.setContext  { org.apache.harmony.test.stress.jni.arguments.ArgumentsTest {} }
[debug] Starting 1 threads
[debug] completed null(org.apache.harmony.test.share.stress.generator.Thread)
[debug] ThreadToRun.run()
[debug] Generator.execute()
[debug] class = org.apache.harmony.test.stress.jni.arguments.ArgumentsTest
[debug] org.apache.harmony.test.stress.jni.arguments.ArgumentsTest { }
[debug] started test(org.apache.harmony.test.stress.jni.arguments.ArgumentsTest)
[debug] Test failed
[error] in test(org.apache.harmony.test.stress.jni.arguments.ArgumentsTest)
org.apache.harmony.test.stress.jni.share.JNITestError
	at org.apache.harmony.test.stress.jni.arguments.ArgumentsTest.test(Unknown Source)
	at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
	at java.lang.reflect.Method.invoke(Method.java:317)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.apache.harmony.test.share.stress.generator.Generator.execute(Unknown Source)
	at org.apache.harmony.test.share.stress.generator.Thread$ThreadToRun.run(Unknown Source)




> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>
> The stress test fails while passing arguments to the native function.

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


[jira] Commented: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551178 ] 

Gregory Shimansky commented on HARMONY-5078:
--------------------------------------------

I think I found the reason for this bug. There is indeed a bug in passing arguments to native method. It has total 160 arguments, 6th of which is a double value that has to be 0.6880734650254612. Instead it is 0 when the native function is called. All other arguments are correct.

I made some investigation, I set a breakpoint for native calling stub generated for function Java_org_apache_harmony_test_stress_jni_arguments_ArgumentsTest_nativeMethod to see register contents. The value of ST7 of x87 unit looks correct:

rax            0x2aaabf4dbe00   46912842350080
rbx            0x2aaaaea72948   46912562997576
rcx            0x0      0
rdx            0x2aaaaea72948   46912562997576
rsi            0x79     121
rdi            0x2aaaaea72948   46912562997576
rbp            0x7fff7cb7ef48   0x7fff7cb7ef48
rsp            0x7fff7cb7e208   0x7fff7cb7e208
r8             0xe49e4646       3835577926
r9             0xf55cd1639f01ca0c       -766507610760164852
r10            0x7fff7cb7f538   140735285818680
r11            0x64aa10 6597136
r12            0xdeadbeef       3735928559
r13            0x64a860 6596704
r14            0xdeadbeefdeadbeef       -2401053088876216593
r15            0xdeadbeefdeadbeef       -2401053088876216593
rip            0x2aaabf4dbe00   0x2aaabf4dbe00
eflags         0x202    [ IF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0
st0            0        (raw 0x00000000000000000000)
st1            0        (raw 0x00000000000000000000)
st2            0        (raw 0x00000000000000000000)
st3            0        (raw 0x00000000000000000000)
st4            0        (raw 0x00000000000000000000)
st5            0        (raw 0x00000000000000000000)
st6            0        (raw 0x00000000000000000000)
st7            0.68807346502546118394150198582792655    (raw 0x3ffeb0259525879e1000)
fctrl          0x37f    895
fstat          0x0      0
ftag           0xffff   65535
fiseg          0x0      0
fioff          0x0      0
foseg          0x0      0
fooff          0x0      0
fop            0x0      0
xmm0           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0xc2, 0xf3,
    0xb0, 0xa4, 0xb2, 0x4, 0xe6, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0xf3c2, 0xa4b0, 0x4b2, 0x3fe6, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0xa4b0f3c2, 0x3fe604b2, 0x0,
    0x0}, v2_int64 = {0x3fe604b2a4b0f3c2, 0x0}, uint128 = 0x00000000000000003fe604b2a4b0f3c2}
xmm1           {v4_float = {0xf0ef3f0, 0x1, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x3f,
    0xef, 0x70, 0x4d, 0x25, 0x8a, 0xe7, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0xef3f, 0x4d70, 0x8a25, 0x3fe7, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x4d70ef3f, 0x3fe78a25, 0x0,
    0x0}, v2_int64 = {0x3fe78a254d70ef3f, 0x0}, uint128 = 0x00000000000000003fe78a254d70ef3f}
xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0xfc, 0x8,
    0x18, 0x3e, 0x0 <repeats 12 times>}, v8_int16 = {0x8fc, 0x3e18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v4_int32 = {0x3e1808fc, 0x0, 0x0, 0x0}, v2_int64 = {0x3e1808fc, 0x0},
  uint128 = 0x0000000000000000000000003e1808fc}
xmm3           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x96, 0x1c,
    0x5a, 0xa0, 0x9, 0xd1, 0xd3, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
---Type <return> to continue, or q <return> to quit---
    0x1c96, 0xa05a, 0xd109, 0x3fd3, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0xa05a1c96, 0x3fd3d109, 0x0,
    0x0}, v2_int64 = {0x3fd3d109a05a1c96, 0x0}, uint128 = 0x00000000000000003fd3d109a05a1c96}
xmm4           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0, 0x26,
    0x25, 0x31, 0x5e, 0x28, 0xdd, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0x2600, 0x3125, 0x285e, 0x3fdd, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x31252600, 0x3fdd285e, 0x0,
    0x0}, v2_int64 = {0x3fdd285e31252600, 0x0}, uint128 = 0x00000000000000003fdd285e31252600}
xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x46, 0xbb,
    0xfb, 0x3e, 0x0 <repeats 12 times>}, v8_int16 = {0xbb46, 0x3efb, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0}, v4_int32 = {0x3efbbb46, 0x0, 0x0, 0x0}, v2_int64 = {0x3efbbb46, 0x0},
  uint128 = 0x0000000000000000000000003efbbb46}
xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x98, 0x57,
    0xc3, 0x3e, 0x0 <repeats 12 times>}, v8_int16 = {0x5798, 0x3ec3, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0}, v4_int32 = {0x3ec35798, 0x0, 0x0, 0x0}, v2_int64 = {0x3ec35798, 0x0},
  uint128 = 0x0000000000000000000000003ec35798}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0xa8, 0xb,
    0x63, 0x3e, 0x0 <repeats 12 times>}, v8_int16 = {0xba8, 0x3e63, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v4_int32 = {0x3e630ba8, 0x0, 0x0, 0x0}, v2_int64 = {0x3e630ba8, 0x0},
  uint128 = 0x0000000000000000000000003e630ba8}
xmm8           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm9           {v4_float = {0x1, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0, 0x0,
    0x80, 0x3f, 0x0 <repeats 12 times>}, v8_int16 = {0x0, 0x3f80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v4_int32 = {0x3f800000, 0x0, 0x0, 0x0}, v2_int64 = {0x3f800000, 0x0},
  uint128 = 0x0000000000000000000000003f800000}
xmm10          {v4_float = {0x1, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0, 0x0,
    0x80, 0x3f, 0x0 <repeats 12 times>}, v8_int16 = {0x0, 0x3f80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v4_int32 = {0x3f800000, 0x0, 0x0, 0x0}, v2_int64 = {0x3f800000, 0x0},
  uint128 = 0x0000000000000000000000003f800000}
xmm11          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm12          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm13          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm14          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm15          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
mxcsr          0x1fa0   [ PE IM DM ZM OM UM PM ]

but AFAIK according to amd64 calling conventions double arguments have to be passed in xmm registers. I don't know whether these should be passed in upper of lower half of xmm, but xmm5 which I think is the register for 6th argument has zero double value.

When method is called (right on its beginning, before prologue) I set another breakpoint to see registers contents. Note, ST7 still contains the right value, but still nothing is in xmm5:

rax            0x2aaabf563e88   46912842907272
rbx            0x2aaaaea72948   46912562997576
rcx            0x7fff7cb7e020   140735285813280
rdx            0x79     121
rsi            0x7fff7cb7e018   140735285813272
rdi            0xd20670 13764208
rbp            0x7fff7cb7ef48   0x7fff7cb7ef48
rsp            0x7fff7cb7db68   0x7fff7cb7db68
r8             0x0      0
r9             0xe49e4646       3835577926
r10            0x2aaaaea72948   46912562997576
r11            0x64aa10 6597136
r12            0x7fff7cb7e008   140735285813256
r13            0x64a860 6596704
r14            0xdeadbeefdeadbeef       -2401053088876216593
r15            0xdeadbeefdeadbeef       -2401053088876216593
rip            0x2aaabf563e88   0x2aaabf563e88 <Java_org_apache_harmony_test_stress_jni_arguments_ArgumentsTest_nativeMethod>
eflags         0x216    [ PF AF IF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0
st0            0        (raw 0x00000000000000000000)
st1            0        (raw 0x00000000000000000000)
st2            0        (raw 0x00000000000000000000)
st3            0        (raw 0x00000000000000000000)
st4            0        (raw 0x00000000000000000000)
st5            0        (raw 0x00000000000000000000)
st6            0        (raw 0x00000000000000000000)
st7            0.68807346502546118394150198582792655    (raw 0x3ffeb0259525879e1000)
fctrl          0x37f    895
fstat          0x0      0
ftag           0xffff   65535
fiseg          0x0      0
fioff          0x0      0
foseg          0x0      0
fooff          0x0      0
fop            0x0      0
xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x60, 0x69,
    0xec, 0x3c, 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x6960,
    0x3cec, 0x2aaa, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x3cec6960, 0x2aaa, 0x0, 0x0},
  v2_int64 = {0x2aaa3cec6960, 0x0}, uint128 = 0x000000000000000000002aaa3cec6960}
xmm1           {v4_float = {0xf0ef3f0, 0x1, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x3f,
    0xef, 0x70, 0x4d, 0x25, 0x8a, 0xe7, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0xef3f, 0x4d70, 0x8a25, 0x3fe7, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x4d70ef3f, 0x3fe78a25, 0x0,
    0x0}, v2_int64 = {0x3fe78a254d70ef3f, 0x0}, uint128 = 0x00000000000000003fe78a254d70ef3f}
xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0xfc, 0x8,
    0x18, 0x3e, 0x0 <repeats 12 times>}, v8_int16 = {0x8fc, 0x3e18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v4_int32 = {0x3e1808fc, 0x0, 0x0, 0x0}, v2_int64 = {0x3e1808fc, 0x0},
  uint128 = 0x0000000000000000000000003e1808fc}
xmm3           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x96, 0x1c,
---Type <return> to continue, or q <return> to quit---
    0x5a, 0xa0, 0x9, 0xd1, 0xd3, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0x1c96, 0xa05a, 0xd109, 0x3fd3, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0xa05a1c96, 0x3fd3d109, 0x0,
    0x0}, v2_int64 = {0x3fd3d109a05a1c96, 0x0}, uint128 = 0x00000000000000003fd3d109a05a1c96}
xmm4           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0, 0x26,
    0x25, 0x31, 0x5e, 0x28, 0xdd, 0x3f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0x2600, 0x3125, 0x285e, 0x3fdd, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x31252600, 0x3fdd285e, 0x0,
    0x0}, v2_int64 = {0x3fdd285e31252600, 0x0}, uint128 = 0x00000000000000003fdd285e31252600}
xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x46, 0xbb,
    0xfb, 0x3e, 0x0 <repeats 12 times>}, v8_int16 = {0xbb46, 0x3efb, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0}, v4_int32 = {0x3efbbb46, 0x0, 0x0, 0x0}, v2_int64 = {0x3efbbb46, 0x0},
  uint128 = 0x0000000000000000000000003efbbb46}
xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x98, 0x57,
    0xc3, 0x3e, 0x0 <repeats 12 times>}, v8_int16 = {0x5798, 0x3ec3, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0}, v4_int32 = {0x3ec35798, 0x0, 0x0, 0x0}, v2_int64 = {0x3ec35798, 0x0},
  uint128 = 0x0000000000000000000000003ec35798}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0xa8, 0xb,
    0x63, 0x3e, 0x0 <repeats 12 times>}, v8_int16 = {0xba8, 0x3e63, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v4_int32 = {0x3e630ba8, 0x0, 0x0, 0x0}, v2_int64 = {0x3e630ba8, 0x0},
  uint128 = 0x0000000000000000000000003e630ba8}
xmm8           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm9           {v4_float = {0x1, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0, 0x0,
    0x80, 0x3f, 0x0 <repeats 12 times>}, v8_int16 = {0x0, 0x3f80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v4_int32 = {0x3f800000, 0x0, 0x0, 0x0}, v2_int64 = {0x3f800000, 0x0},
  uint128 = 0x0000000000000000000000003f800000}
xmm10          {v4_float = {0x1, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0, 0x0,
    0x80, 0x3f, 0x0 <repeats 12 times>}, v8_int16 = {0x0, 0x3f80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v4_int32 = {0x3f800000, 0x0, 0x0, 0x0}, v2_int64 = {0x3f800000, 0x0},
  uint128 = 0x0000000000000000000000003f800000}
xmm11          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm12          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm13          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm14          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
xmm15          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {
    0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
    0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}
mxcsr          0x1fa0   [ PE IM DM ZM OM UM PM ]

Debugger shows that method is called with the following arguments:

Breakpoint 5, Java_org_apache_harmony_test_stress_jni_arguments_ArgumentsTest_nativeMethod (
    env=0x6f00000063, this=0x61e140, param0=32767, param1=0x7fff7cb7e010, param2=255 '�',
    param3=2.317785366119368e-310, param4=32767, param5=6.9532469877927365e-310,
    param6=-766507610760164852, param7=0 '\0', param8=12 '\f', param9=-822206411,
    param10=0x7fff7cb7e028, param11=32767, param12=0x7fff7cb7e030, param13=7.63707766e+36,
    param14=32767, param15=0x7fff7cb7e038, param16=9220033352967053857,
    param17=2.3177853660650208e-310, param18=239 '�', param19=0x7fff7cb7e040,
    param20=3.2592048221835344e-317, param21=0, param22=48879, param23=255 '�',
    param24=7.63704724e+36, param25=1.53049818e-41, param26=176 '�', param27=-1256161581,
    param28=-1099685115, param29=0.77751196619010243, param30=0.940266073, param31=1355398521,
    param32=-103698453, param33=0.41304289042998232, param34=-1146908240, param35=931763038,
    param36=-4786854144841381960, param37=1954868242, param38=174 '�', param39=0.0873926878,
    param40=0x7fff7cb7e048, param41=-1982838329, param42=0.14883036934542238,
    param43=0.74231479369471787, param44=0.51037014634788813, param45=0.16851544388540329,
    param46=0x7fff7cb7e050, param47=0x7fff7cb7e058, param48=-25525, param49=0.737710834,
    param50=-5327611971083507949, param51=0.91319623955352247, param52=0 '\0',
    param53=0.479351342, param54=16488, param55=0x7fff7cb7e060, param56=0.676941335,
    param57=3306191666340008843, param58=0, param59=0.401508749, param60=-4756300552179881079,
    param61=12, param62=255 '�', param63=0.282985747, param64=57360, param65=-1074626584,
    param66=0.21357118229536398, param67=0.638593554, param68=0x7fff7cb7e068, param69=10926,
    param70=16088, param71=0.56706834996967925, param72=-4151965278356844424,
    param73=0x7fff7cb7e070, param74=0.49673613390135296, param75=0.79971118988246259,
    param76=0.0971446037, param77=0.68615514, param78=32767, param79=80 'P',
    param80=0x7fff7cb7e078, param81=7994147225335491508, param82=1962416039, param83=0.178361058,
    param84=-6509010608434418352, param85=173972112, param86=0.693555415, param87=0,
    param88=0.04382217780782216, param89=37582, param90=65535, param91=1188430022,
    param92=0.8278033679671325, param93=0.278796613, param94=65535, param95=4456215152153757254,
    param96=5024596775803882053, param97=174 '�', param98=39349, param99=0 '\0',
    param100=3456444896829275243, param101=0.30075119346177526, param102=-1435747473,
    param103=0.054594999279504841, param104=0.83797666261550452, param105=-6564361361229661956,
    param106=12, param107=32767, param108=0x7fff7cb7e080, param109=-8176, param110=0x7fff7cb7e088,
    param111=1185833733, param112=0.717256069, param113=0x7fff7cb7e090, param114=0.994242013,
    param115=0.326278389, param116=174 '�', param117=0x7fff7cb7e098, param118=0x7fff7cb7e0a0,
    param119=0x7fff7cb7e0a8, param120=0.90353373659760472, param121=16088,
    param122=0x7fff7cb7e0b0, param123=0x7fff7cb7e0b8, param124=0x7fff7cb7e0c0, param125=10926,
    param126=-3520397967523792049, param127=-28613, param128=174 '�', param129=16064,
    param130=174 '�', param131=0x7fff7cb7e0c8, param132=0x7fff7cb7e0d0,
    param133=0.53309634261154071, param134=-31163, param135=32767, param136=16 '\020',
    param137=-5860487575907610989, param138=-937905170, param139=0.0356734395,
    param140=-8033189936759820605, param141=0.85800905371119507, param142=0, param143=0.245300114,
    param144=0x7fff7cb7e0d8, param145=3937150454368020805, param146=12, param147=308498473,
    param148=769126397, param149=0x7fff7cb7e0e0, param150=174 '�', param151=0x7fff7cb7e0e8,
    param152=-2088622482, param153=32504, param154=2600599697325177763, param155=0x7fff7cb7e0f0,
    param156=10926, param157=61 '=', param158=0.0288588405)

and param3=2.317785366119368e-310.

So it still don't know whether to blame JIT or JNI stub created for this function. I'm going to check tomorrow.

Command line to launch this test separately looks like this:

/home/gregory/work/64/trunk/working_vm/build/lnx_em64t_gcc_debug/deploy/jdk/jre/bin/java -cp /raid/home/gregory/work/32/enhanced/buildtest/branches/2.0/tests/stress/qa/bin/classes:/raid/home/gregory/work/32/enhanced/buildtest/branches/2.0/tests/stress/qa_temporary:/home/gregory/work/32/enhanced/buildtest/branches/2.0/tests/stress/classlib/trunk/depends/punit/trunk/punit.extension/lib/junit-4.3.1.jar junit.textui.TestRunner org.apache.harmony.test.stress.jni.arguments.ArgumentsTest



> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>
> The stress test fails while passing arguments to the native function.

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


[jira] Resolved: (HARMONY-5078) [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky resolved HARMONY-5078.
----------------------------------------

    Resolution: Fixed

Patch and regression tests are applied at 605231. Bug should be fixed now.

> [drlvm][jni] a stress test org.apache.harmony.test.stress.jni.arguments.ArgumentsTest fails
> -------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5078
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5078
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux x86-64
>            Reporter: Alexei Fedotov
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-5078.patch, Test.c, Test.java
>
>
> The stress test fails while passing arguments to the native function.

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