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

[jira] Created: (HARMONY-4324) [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests

[jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests
---------------------------------------------------------------------------

                 Key: HARMONY-4324
                 URL: https://issues.apache.org/jira/browse/HARMONY-4324
             Project: Harmony
          Issue Type: Bug
         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
            Reporter: Ivan Popov


When JDWP agent receives request for THREAD_START event with modifier for specified thread it calls JVMTI function SetEventNotificationMode() function with given thread. However, JVMTI spec for SetEventNotificationMode() function says:

The following events cannot be controlled at the thread level 
through this function. 
...
 - ThreadStart 
...

Thus, JDWP agent gets JVMTI_ERROR_ILLEGAL_ARGUMENT (103) error from SetEventNotificationMode().

Similarly, when JDWP agent handles request for THREAD_DEATH event with specified thread it also calls the JVMTI SetEventNotificationMode() with given thread. But if the thread is not started yet, this function returns JVMTI_ERROR_THREAD_NOT_ALIVE (15) error.

JDWP agent should handle the THREAD_START/DEATH requests in a special way, for example, to call SetEventNotificationMode() always with null thread and then to filter the THREAD_START/DEATH events.

This issues causes failure of the following JDWP stress tests:

  org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT015.EventTest015
  org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT016.EventTest016
  org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT017.EventTest017

Typical error in the tests output:

 ==> Prepare and send requests for THREAD_START and THREAD_END events for 'EventDebuggee015_Thread'...
 ## FAILURE: EventRequest.Set command for THREAD_START event returns unexpected ERROR = 103(ILLEGAL_ARGUMENT)
 ## Expected ERROR = 0(NONE)
 ## Expected ERROR = 110(OUT_OF_MEMORY)
 ##          Thread name = EventDebuggee015_Thread
 ==> Time (mlsecs) of preparing requests for THREAD_START and THREAD_END events = 0
 ==> Successful requests for THREAD_START event = 0
 ==> Successful requests for THREAD_END event = 0
 ## FAILURE while sending requests for THREAD_START and THREAD_END events!



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


[jira] Resolved: (HARMONY-4324) [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests

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

Gregory Shimansky resolved HARMONY-4324.
----------------------------------------

    Resolution: Fixed

Patch applied at 558748. Please check that the bug is fixed for you.

> [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4324
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4324
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: H4324_jdwp_agent.patch
>
>
> When JDWP agent receives request for THREAD_START event with modifier for specified thread it calls JVMTI function SetEventNotificationMode() function with given thread. However, JVMTI spec for SetEventNotificationMode() function says:
> The following events cannot be controlled at the thread level 
> through this function. 
> ...
>  - ThreadStart 
> ...
> Thus, JDWP agent gets JVMTI_ERROR_ILLEGAL_ARGUMENT (103) error from SetEventNotificationMode().
> Similarly, when JDWP agent handles request for THREAD_DEATH event with specified thread it also calls the JVMTI SetEventNotificationMode() with given thread. But if the thread is not started yet, this function returns JVMTI_ERROR_THREAD_NOT_ALIVE (15) error.
> JDWP agent should handle the THREAD_START/DEATH requests in a special way, for example, to call SetEventNotificationMode() always with null thread and then to filter the THREAD_START/DEATH events.
> This issues causes failure of the following JDWP stress tests:
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT015.EventTest015
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT016.EventTest016
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT017.EventTest017
> Typical error in the tests output:
>  ==> Prepare and send requests for THREAD_START and THREAD_END events for 'EventDebuggee015_Thread'...
>  ## FAILURE: EventRequest.Set command for THREAD_START event returns unexpected ERROR = 103(ILLEGAL_ARGUMENT)
>  ## Expected ERROR = 0(NONE)
>  ## Expected ERROR = 110(OUT_OF_MEMORY)
>  ##          Thread name = EventDebuggee015_Thread
>  ==> Time (mlsecs) of preparing requests for THREAD_START and THREAD_END events = 0
>  ==> Successful requests for THREAD_START event = 0
>  ==> Successful requests for THREAD_END event = 0
>  ## FAILURE while sending requests for THREAD_START and THREAD_END events!

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


[jira] Updated: (HARMONY-4324) [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests

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

Ivan Popov updated HARMONY-4324:
--------------------------------

    Attachment: H4324_jdwp_agent.patch

I'm attaching patch 'H4324_jdwp_agent.patch' for JDWP agent, which solves this problem. It also improves trace messages for events and eliminates infinite recursion in using JVMTI function GetThreadInfo() for tracing STEP events.

With this patch affected JDWP stress tests do not fail anymore with ILLEGAL_ARGUMENT error diagnostics, but they still hang due to HARMONY-2889. I ran also JDWP unit tests against Harmony M2 build with patched JDWP agent and they all passed for me except known failures. It is OK to apply this patch.


> [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4324
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4324
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
>            Reporter: Ivan Popov
>         Attachments: H4324_jdwp_agent.patch
>
>
> When JDWP agent receives request for THREAD_START event with modifier for specified thread it calls JVMTI function SetEventNotificationMode() function with given thread. However, JVMTI spec for SetEventNotificationMode() function says:
> The following events cannot be controlled at the thread level 
> through this function. 
> ...
>  - ThreadStart 
> ...
> Thus, JDWP agent gets JVMTI_ERROR_ILLEGAL_ARGUMENT (103) error from SetEventNotificationMode().
> Similarly, when JDWP agent handles request for THREAD_DEATH event with specified thread it also calls the JVMTI SetEventNotificationMode() with given thread. But if the thread is not started yet, this function returns JVMTI_ERROR_THREAD_NOT_ALIVE (15) error.
> JDWP agent should handle the THREAD_START/DEATH requests in a special way, for example, to call SetEventNotificationMode() always with null thread and then to filter the THREAD_START/DEATH events.
> This issues causes failure of the following JDWP stress tests:
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT015.EventTest015
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT016.EventTest016
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT017.EventTest017
> Typical error in the tests output:
>  ==> Prepare and send requests for THREAD_START and THREAD_END events for 'EventDebuggee015_Thread'...
>  ## FAILURE: EventRequest.Set command for THREAD_START event returns unexpected ERROR = 103(ILLEGAL_ARGUMENT)
>  ## Expected ERROR = 0(NONE)
>  ## Expected ERROR = 110(OUT_OF_MEMORY)
>  ##          Thread name = EventDebuggee015_Thread
>  ==> Time (mlsecs) of preparing requests for THREAD_START and THREAD_END events = 0
>  ==> Successful requests for THREAD_START event = 0
>  ==> Successful requests for THREAD_END event = 0
>  ## FAILURE while sending requests for THREAD_START and THREAD_END events!

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


[jira] Updated: (HARMONY-4324) [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests

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

Ivan Popov updated HARMONY-4324:
--------------------------------

    Component/s: JDK

> [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4324
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4324
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
>            Reporter: Ivan Popov
>
> When JDWP agent receives request for THREAD_START event with modifier for specified thread it calls JVMTI function SetEventNotificationMode() function with given thread. However, JVMTI spec for SetEventNotificationMode() function says:
> The following events cannot be controlled at the thread level 
> through this function. 
> ...
>  - ThreadStart 
> ...
> Thus, JDWP agent gets JVMTI_ERROR_ILLEGAL_ARGUMENT (103) error from SetEventNotificationMode().
> Similarly, when JDWP agent handles request for THREAD_DEATH event with specified thread it also calls the JVMTI SetEventNotificationMode() with given thread. But if the thread is not started yet, this function returns JVMTI_ERROR_THREAD_NOT_ALIVE (15) error.
> JDWP agent should handle the THREAD_START/DEATH requests in a special way, for example, to call SetEventNotificationMode() always with null thread and then to filter the THREAD_START/DEATH events.
> This issues causes failure of the following JDWP stress tests:
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT015.EventTest015
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT016.EventTest016
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT017.EventTest017
> Typical error in the tests output:
>  ==> Prepare and send requests for THREAD_START and THREAD_END events for 'EventDebuggee015_Thread'...
>  ## FAILURE: EventRequest.Set command for THREAD_START event returns unexpected ERROR = 103(ILLEGAL_ARGUMENT)
>  ## Expected ERROR = 0(NONE)
>  ## Expected ERROR = 110(OUT_OF_MEMORY)
>  ##          Thread name = EventDebuggee015_Thread
>  ==> Time (mlsecs) of preparing requests for THREAD_START and THREAD_END events = 0
>  ==> Successful requests for THREAD_START event = 0
>  ==> Successful requests for THREAD_END event = 0
>  ## FAILURE while sending requests for THREAD_START and THREAD_END events!

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


[jira] Updated: (HARMONY-4324) [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests

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

Ivan Popov updated HARMONY-4324:
--------------------------------

    Patch Info: [Patch Available]

> [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4324
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4324
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
>            Reporter: Ivan Popov
>         Attachments: H4324_jdwp_agent.patch
>
>
> When JDWP agent receives request for THREAD_START event with modifier for specified thread it calls JVMTI function SetEventNotificationMode() function with given thread. However, JVMTI spec for SetEventNotificationMode() function says:
> The following events cannot be controlled at the thread level 
> through this function. 
> ...
>  - ThreadStart 
> ...
> Thus, JDWP agent gets JVMTI_ERROR_ILLEGAL_ARGUMENT (103) error from SetEventNotificationMode().
> Similarly, when JDWP agent handles request for THREAD_DEATH event with specified thread it also calls the JVMTI SetEventNotificationMode() with given thread. But if the thread is not started yet, this function returns JVMTI_ERROR_THREAD_NOT_ALIVE (15) error.
> JDWP agent should handle the THREAD_START/DEATH requests in a special way, for example, to call SetEventNotificationMode() always with null thread and then to filter the THREAD_START/DEATH events.
> This issues causes failure of the following JDWP stress tests:
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT015.EventTest015
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT016.EventTest016
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT017.EventTest017
> Typical error in the tests output:
>  ==> Prepare and send requests for THREAD_START and THREAD_END events for 'EventDebuggee015_Thread'...
>  ## FAILURE: EventRequest.Set command for THREAD_START event returns unexpected ERROR = 103(ILLEGAL_ARGUMENT)
>  ## Expected ERROR = 0(NONE)
>  ## Expected ERROR = 110(OUT_OF_MEMORY)
>  ##          Thread name = EventDebuggee015_Thread
>  ==> Time (mlsecs) of preparing requests for THREAD_START and THREAD_END events = 0
>  ==> Successful requests for THREAD_START event = 0
>  ==> Successful requests for THREAD_END event = 0
>  ## FAILURE while sending requests for THREAD_START and THREAD_END events!

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


[jira] Assigned: (HARMONY-4324) [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests

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

Gregory Shimansky reassigned HARMONY-4324:
------------------------------------------

    Assignee: Gregory Shimansky

> [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4324
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4324
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: H4324_jdwp_agent.patch
>
>
> When JDWP agent receives request for THREAD_START event with modifier for specified thread it calls JVMTI function SetEventNotificationMode() function with given thread. However, JVMTI spec for SetEventNotificationMode() function says:
> The following events cannot be controlled at the thread level 
> through this function. 
> ...
>  - ThreadStart 
> ...
> Thus, JDWP agent gets JVMTI_ERROR_ILLEGAL_ARGUMENT (103) error from SetEventNotificationMode().
> Similarly, when JDWP agent handles request for THREAD_DEATH event with specified thread it also calls the JVMTI SetEventNotificationMode() with given thread. But if the thread is not started yet, this function returns JVMTI_ERROR_THREAD_NOT_ALIVE (15) error.
> JDWP agent should handle the THREAD_START/DEATH requests in a special way, for example, to call SetEventNotificationMode() always with null thread and then to filter the THREAD_START/DEATH events.
> This issues causes failure of the following JDWP stress tests:
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT015.EventTest015
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT016.EventTest016
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT017.EventTest017
> Typical error in the tests output:
>  ==> Prepare and send requests for THREAD_START and THREAD_END events for 'EventDebuggee015_Thread'...
>  ## FAILURE: EventRequest.Set command for THREAD_START event returns unexpected ERROR = 103(ILLEGAL_ARGUMENT)
>  ## Expected ERROR = 0(NONE)
>  ## Expected ERROR = 110(OUT_OF_MEMORY)
>  ##          Thread name = EventDebuggee015_Thread
>  ==> Time (mlsecs) of preparing requests for THREAD_START and THREAD_END events = 0
>  ==> Successful requests for THREAD_START event = 0
>  ==> Successful requests for THREAD_END event = 0
>  ## FAILURE while sending requests for THREAD_START and THREAD_END events!

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


[jira] Closed: (HARMONY-4324) [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests

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

Ivan Popov closed HARMONY-4324.
-------------------------------


Thanks, Gregory.
Verified in harmony-jdk-r558928, closing this issue.


> [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4324
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4324
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: H4324_jdwp_agent.patch
>
>
> When JDWP agent receives request for THREAD_START event with modifier for specified thread it calls JVMTI function SetEventNotificationMode() function with given thread. However, JVMTI spec for SetEventNotificationMode() function says:
> The following events cannot be controlled at the thread level 
> through this function. 
> ...
>  - ThreadStart 
> ...
> Thus, JDWP agent gets JVMTI_ERROR_ILLEGAL_ARGUMENT (103) error from SetEventNotificationMode().
> Similarly, when JDWP agent handles request for THREAD_DEATH event with specified thread it also calls the JVMTI SetEventNotificationMode() with given thread. But if the thread is not started yet, this function returns JVMTI_ERROR_THREAD_NOT_ALIVE (15) error.
> JDWP agent should handle the THREAD_START/DEATH requests in a special way, for example, to call SetEventNotificationMode() always with null thread and then to filter the THREAD_START/DEATH events.
> This issues causes failure of the following JDWP stress tests:
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT015.EventTest015
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT016.EventTest016
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT017.EventTest017
> Typical error in the tests output:
>  ==> Prepare and send requests for THREAD_START and THREAD_END events for 'EventDebuggee015_Thread'...
>  ## FAILURE: EventRequest.Set command for THREAD_START event returns unexpected ERROR = 103(ILLEGAL_ARGUMENT)
>  ## Expected ERROR = 0(NONE)
>  ## Expected ERROR = 110(OUT_OF_MEMORY)
>  ##          Thread name = EventDebuggee015_Thread
>  ==> Time (mlsecs) of preparing requests for THREAD_START and THREAD_END events = 0
>  ==> Successful requests for THREAD_START event = 0
>  ==> Successful requests for THREAD_END event = 0
>  ## FAILURE while sending requests for THREAD_START and THREAD_END events!

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


[jira] Commented: (HARMONY-4324) [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests

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

Ivan Popov commented on HARMONY-4324:
-------------------------------------

Patches for this issue should be applied after patches for HARMONY-4323, otherwise it may break other pending JDWP patches.

> [jdktools][jpda] JDWP agent incorrectly handles THREAD_START/DEATH requests
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4324
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4324
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
>            Reporter: Ivan Popov
>         Attachments: H4324_jdwp_agent.patch
>
>
> When JDWP agent receives request for THREAD_START event with modifier for specified thread it calls JVMTI function SetEventNotificationMode() function with given thread. However, JVMTI spec for SetEventNotificationMode() function says:
> The following events cannot be controlled at the thread level 
> through this function. 
> ...
>  - ThreadStart 
> ...
> Thus, JDWP agent gets JVMTI_ERROR_ILLEGAL_ARGUMENT (103) error from SetEventNotificationMode().
> Similarly, when JDWP agent handles request for THREAD_DEATH event with specified thread it also calls the JVMTI SetEventNotificationMode() with given thread. But if the thread is not started yet, this function returns JVMTI_ERROR_THREAD_NOT_ALIVE (15) error.
> JDWP agent should handle the THREAD_START/DEATH requests in a special way, for example, to call SetEventNotificationMode() always with null thread and then to filter the THREAD_START/DEATH events.
> This issues causes failure of the following JDWP stress tests:
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT015.EventTest015
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT016.EventTest016
>   org.apache.harmony.test.stress.jpda.jdwp.scenario.EVENT017.EventTest017
> Typical error in the tests output:
>  ==> Prepare and send requests for THREAD_START and THREAD_END events for 'EventDebuggee015_Thread'...
>  ## FAILURE: EventRequest.Set command for THREAD_START event returns unexpected ERROR = 103(ILLEGAL_ARGUMENT)
>  ## Expected ERROR = 0(NONE)
>  ## Expected ERROR = 110(OUT_OF_MEMORY)
>  ##          Thread name = EventDebuggee015_Thread
>  ==> Time (mlsecs) of preparing requests for THREAD_START and THREAD_END events = 0
>  ==> Successful requests for THREAD_START event = 0
>  ==> Successful requests for THREAD_END event = 0
>  ## FAILURE while sending requests for THREAD_START and THREAD_END events!

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