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

[jira] Resolved: (HARMONY-5235) [drlvm][thread] Thread arguments are prepared/processed incorrectly

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

Gregory Shimansky resolved HARMONY-5235.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M4

Patch is applied at 601425.

> [drlvm][thread] Thread arguments are prepared/processed incorrectly
> -------------------------------------------------------------------
>
>                 Key: HARMONY-5235
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5235
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Ilya Berezhniuk
>            Assignee: Gregory Shimansky
>             Fix For: 5.0M4
>
>         Attachments: H-5235.patch, H-5235.patch
>
>
> When investigating HARMONY-5167 (see Bounds Checker logs in 5167), I've found 2 bugs in processing of arguments passed to newly created threads.
> 1) hythread_create_ex() function always casts thread argument to hythread_start_proc_data_t and fills 4 fields in this structure.
> Looks like this was made for the case when wrapper function is NULL, to fill allocated data needed to start thread with its own hythread_wrapper_start_proc function.
> The memory for hythread_start_proc_data_t is allocated under "if (!wrapper)", but fields are filled out always.
> On the other hand, the data passed with non-NULL wrapper pointer can differ from hythread_start_proc_data_t; it's often (void*)[2] array or something else.
> So writing 4 fields to this pointer leads to writing data to unallocated memory.
> 2) jthread_wrapper_start_proc always frees an argument passed to it.
> But Java_java_lang_VMThreadManager_start() and jvmtiRunAgentThread() functions pass local structure instances to this function.
> I guess the structure should be allocated in these functions.

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