You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mark Hindess (JIRA)" <ji...@apache.org> on 2006/05/24 20:53:30 UTC

[jira] Created: (HARMONY-503) Launcher allocates exeName twice and never frees it

Launcher allocates exeName twice and never frees it
---------------------------------------------------

         Key: HARMONY-503
         URL: http://issues.apache.org/jira/browse/HARMONY-503
     Project: Harmony
        Type: Bug

  Components: Classlib  
    Reporter: Mark Hindess
    Priority: Minor


Launcher main.c gpProtectedMain calls hysysinfo_get_executable_name twice.  It should only be called once.  Also the memory alloc'd by this call is not freed.

I will attach a patch.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-503) Launcher allocates exeName twice and never frees it

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-503?page=all ]

Mark Hindess updated HARMONY-503:
---------------------------------

    Attachment: launcher.exename.allocd.twice.never.freed.diff

The patch also fixes to 'return 0' statements to "goto bail" to ensure that memory is free'd on those paths too.


> Launcher allocates exeName twice and never frees it
> ---------------------------------------------------
>
>          Key: HARMONY-503
>          URL: http://issues.apache.org/jira/browse/HARMONY-503
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Priority: Minor
>  Attachments: launcher.exename.allocd.twice.never.freed.diff
>
> Launcher main.c gpProtectedMain calls hysysinfo_get_executable_name twice.  It should only be called once.  Also the memory alloc'd by this call is not freed.
> I will attach a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (HARMONY-503) Launcher allocates exeName twice and never frees it

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-503?page=all ]
     
Tim Ellison closed HARMONY-503:
-------------------------------


Verified by Mark


> Launcher allocates exeName twice and never frees it
> ---------------------------------------------------
>
>          Key: HARMONY-503
>          URL: http://issues.apache.org/jira/browse/HARMONY-503
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Assignee: Tim Ellison
>     Priority: Minor
>  Attachments: launcher.exename.allocd.twice.never.freed.diff
>
> Launcher main.c gpProtectedMain calls hysysinfo_get_executable_name twice.  It should only be called once.  Also the memory alloc'd by this call is not freed.
> I will attach a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-503) Launcher allocates exeName twice and never frees it

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-503?page=comments#action_12413431 ] 

Mark Hindess commented on HARMONY-503:
--------------------------------------

Looks good.  Thanks Tim.

> Launcher allocates exeName twice and never frees it
> ---------------------------------------------------
>
>          Key: HARMONY-503
>          URL: http://issues.apache.org/jira/browse/HARMONY-503
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Assignee: Tim Ellison
>     Priority: Minor
>  Attachments: launcher.exename.allocd.twice.never.freed.diff
>
> Launcher main.c gpProtectedMain calls hysysinfo_get_executable_name twice.  It should only be called once.  Also the memory alloc'd by this call is not freed.
> I will attach a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HARMONY-503) Launcher allocates exeName twice and never frees it

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-503?page=all ]
     
Tim Ellison resolved HARMONY-503:
---------------------------------

    Resolution: Fixed

Thanks Mark,

I applied a version of your patch manually to shared/launcher/main.c at repo revision r409620.

Please check that this fixes the problem you saw.


> Launcher allocates exeName twice and never frees it
> ---------------------------------------------------
>
>          Key: HARMONY-503
>          URL: http://issues.apache.org/jira/browse/HARMONY-503
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Assignee: Tim Ellison
>     Priority: Minor
>  Attachments: launcher.exename.allocd.twice.never.freed.diff
>
> Launcher main.c gpProtectedMain calls hysysinfo_get_executable_name twice.  It should only be called once.  Also the memory alloc'd by this call is not freed.
> I will attach a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-503) Launcher allocates exeName twice and never frees it

Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-503?page=comments#action_12413421 ] 

Mark Hindess commented on HARMONY-503:
--------------------------------------

Two points:

1)  My original patch had:

+  endPathPtr = exeBaseName = strrchr(exeName, HY_PATH_SLASH);

but the 'endPathPtr = ' is redundant since it is set in both if and else clauses below.

2) My original patch had:

+  if (exeName)
+  {
+         hymem_free_memory (exeName);
+  }

but yours had a cut'n'paste error:

+  if (exeName) {
+    hymem_free_memory (mainClass);
+  }

That is, mainClass should read exeName.




> Launcher allocates exeName twice and never frees it
> ---------------------------------------------------
>
>          Key: HARMONY-503
>          URL: http://issues.apache.org/jira/browse/HARMONY-503
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Assignee: Tim Ellison
>     Priority: Minor
>  Attachments: launcher.exename.allocd.twice.never.freed.diff
>
> Launcher main.c gpProtectedMain calls hysysinfo_get_executable_name twice.  It should only be called once.  Also the memory alloc'd by this call is not freed.
> I will attach a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-503) Launcher allocates exeName twice and never frees it

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-503?page=comments#action_12413426 ] 

Tim Ellison commented on HARMONY-503:
-------------------------------------

Both fixed.

Please check again.


> Launcher allocates exeName twice and never frees it
> ---------------------------------------------------
>
>          Key: HARMONY-503
>          URL: http://issues.apache.org/jira/browse/HARMONY-503
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Assignee: Tim Ellison
>     Priority: Minor
>  Attachments: launcher.exename.allocd.twice.never.freed.diff
>
> Launcher main.c gpProtectedMain calls hysysinfo_get_executable_name twice.  It should only be called once.  Also the memory alloc'd by this call is not freed.
> I will attach a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (HARMONY-503) Launcher allocates exeName twice and never frees it

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-503?page=all ]

Tim Ellison reassigned HARMONY-503:
-----------------------------------

    Assign To: Tim Ellison

> Launcher allocates exeName twice and never frees it
> ---------------------------------------------------
>
>          Key: HARMONY-503
>          URL: http://issues.apache.org/jira/browse/HARMONY-503
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Assignee: Tim Ellison
>     Priority: Minor
>  Attachments: launcher.exename.allocd.twice.never.freed.diff
>
> Launcher main.c gpProtectedMain calls hysysinfo_get_executable_name twice.  It should only be called once.  Also the memory alloc'd by this call is not freed.
> I will attach a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira