You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Li-Gang Wang (JIRA)" <ji...@apache.org> on 2007/05/18 11:37:16 UTC

[jira] Created: (HARMONY-3909) [DRLVM][Threading] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

[DRLVM][Threading] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
--------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-3909
                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: win/linux 32/64
            Reporter: Li-Gang Wang


There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:

1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.


2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Assigned: (HARMONY-3909) [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Gregory Shimansky reassigned HARMONY-3909:
------------------------------------------

    Assignee: Gregory Shimansky

> [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>         Assigned To: Gregory Shimansky
>         Attachments: H3909-Regression-test.patch, H3909.patch, H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Updated: (HARMONY-3909) [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Gregory Shimansky updated HARMONY-3909:
---------------------------------------

    Summary: [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]  (was: [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon])

> [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>         Attachments: H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Commented: (HARMONY-3909) [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Pavel Pervov commented on HARMONY-3909:
---------------------------------------

Heh. The patch has some warnings. Will update shortly.

> [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>         Attachments: H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Updated: (HARMONY-3909) [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Eugene S. Ostrovsky updated HARMONY-3909:
-----------------------------------------

    Attachment: H3909-Regression-test.patch

Added file:
  H3909-Regression-test.patch

Regression test for the issue.

> [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>         Attachments: H3909-Regression-test.patch, H3909.patch, H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Updated: (HARMONY-3909) [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Pavel Pervov updated HARMONY-3909:
----------------------------------

    Attachment: H3909.patch

Corrected patch.

> [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>         Attachments: H3909.patch, H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Commented: (HARMONY-3909) [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Pavel Pervov commented on HARMONY-3909:
---------------------------------------

I'll try to fix the first one.

> [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Commented: (HARMONY-3909) [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Ivan Popov commented on HARMONY-3909:
-------------------------------------

I verified original problem HARMONY-3820 in harmony-jdk-r542123. Now Eclipse debugger shows system threads in correct group, so I think this issue is fixed and can be closed.

> [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>            Assignee: Gregory Shimansky
>         Attachments: H3909-Regression-test.patch, H3909.patch, H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Updated: (HARMONY-3909) [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Li-Gang Wang updated HARMONY-3909:
----------------------------------

    Summary: [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]  (was: [DRLVM][Threading] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon])

> [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Resolved: (HARMONY-3909) [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Gregory Shimansky resolved HARMONY-3909.
----------------------------------------

    Resolution: Fixed

Patch and regression test were applied at 541662. Please check that the bug is fixed for you.

> [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>         Assigned To: Gregory Shimansky
>         Attachments: H3909-Regression-test.patch, H3909.patch, H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Commented: (HARMONY-3909) [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Pavel Pervov commented on HARMONY-3909:
---------------------------------------

Concerning 1) null thread group passed at finalizer and reference queue threads creation is considered by the specification as the "main" thread group. Correct thread group should be passed at thread creation time. The problem here may be to retrieve "system" thread group from native code.

So, both problems are not related to threading. (1)st is native finalization and reference queue implementation. (2)nd is just invalid.

> [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Closed: (HARMONY-3909) [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Gregory Shimansky closed HARMONY-3909.
--------------------------------------


VERIFIED

> [drlvm][thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>            Assignee: Gregory Shimansky
>         Attachments: H3909-Regression-test.patch, H3909.patch, H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Commented: (HARMONY-3909) [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Pavel Pervov commented on HARMONY-3909:
---------------------------------------

Concerning 2) Look here: http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/invocation.html#attach_current_thread
"When a thread is attached to the VM, the context class loader is the bootstrap loader."

> [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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


[jira] Updated: (HARMONY-3909) [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]

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

Pavel Pervov updated HARMONY-3909:
----------------------------------

    Attachment: H3909.patch

1) Fixed assigning finalizer and reference queue threads to "system" thread group instead of "main" thread group.
2) Fixed code which assigns context class loader. Black magic assuming knowledge of field layout was removed.

One question left here: which thread group should GC threads belong to?

> [DRLVM][Thread] Problems with associating native thread with Java thread when using AttachCurrentThread[AsDaemon]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3909
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3909
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: win/linux 32/64
>            Reporter: Li-Gang Wang
>         Attachments: H3909.patch
>
>
> There are two problems when associating native threads to Java ones with the threading API AttachCurrentThread[AsDaemon]:
> 1. The newly associated Java thread's group is not properly assigned. In Eclipse debugger all threads and thread groups can not be seen when turning on 'view thread groups'.
> 2. The newly associated Java threads are not assigned a context class loader.

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