You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by jiny2 <gi...@git.apache.org> on 2015/11/10 23:56:04 UTC

[GitHub] incubator-hawq pull request: HAWQ-145. Memory leak when free the a...

GitHub user jiny2 opened a pull request:

    https://github.com/apache/incubator-hawq/pull/94

    HAWQ-145. Memory leak when free the argument instance of resource lea…

    This is to fix a memory leak.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jiny2/incubator-hawq HAWQ-145

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/94.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #94
    
----
commit f9ce488b2be8dc4852ded450b627c3bea72572b1
Author: Yi Jin <yj...@pivotal.io>
Date:   2015-11-10T22:54:42Z

    HAWQ-145. Memory leak when free the argument instance of resource lease heart-beat thread in dispatcher process

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-145. Memory leak when free the a...

Posted by jiny2 <gi...@git.apache.org>.
Github user jiny2 closed the pull request at:

    https://github.com/apache/incubator-hawq/pull/94


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-145. Memory leak when free the a...

Posted by zhangh43 <gi...@git.apache.org>.
Github user zhangh43 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/94#discussion_r44493523
  
    --- Diff: src/backend/resourcemanager/communication/rmcomm_QD2RM.c ---
    @@ -1438,6 +1438,7 @@ void freeHeartBeatThreadArg(HeartBeatThreadArg *arg)
     	{
     		free((*arg)->HostAddrs[i]);
     	}
    +	free((*arg)->HostAddrs);
    --- End diff --
    
    sorry. It's OK to free(malloc(0)).
    +1



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-145. Memory leak when free the a...

Posted by jiny2 <gi...@git.apache.org>.
Github user jiny2 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/94#discussion_r44499509
  
    --- Diff: src/backend/resourcemanager/communication/rmcomm_QD2RM.c ---
    @@ -1438,6 +1438,7 @@ void freeHeartBeatThreadArg(HeartBeatThreadArg *arg)
     	{
     		free((*arg)->HostAddrs[i]);
     	}
    +	free((*arg)->HostAddrs);
    --- End diff --
    
    In the code, I have logic to prevent this case :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-145. Memory leak when free the a...

Posted by zhangh43 <gi...@git.apache.org>.
Github user zhangh43 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/94#discussion_r44493044
  
    --- Diff: src/backend/resourcemanager/communication/rmcomm_QD2RM.c ---
    @@ -1438,6 +1438,7 @@ void freeHeartBeatThreadArg(HeartBeatThreadArg *arg)
     	{
     		free((*arg)->HostAddrs[i]);
     	}
    +	free((*arg)->HostAddrs);
    --- End diff --
    
    have a look at the code: tharg->HostAddrs = malloc(sizeof(char *) * tharg->HostAddrSize);
    where tharg->HostAddrSize maybe zero and malloc(0) happens.
    what i mean yesterday is to test whether tharg->HostAddrSize > 0 before free arg->HostAddrs 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-145. Memory leak when free the a...

Posted by linwen <gi...@git.apache.org>.
Github user linwen commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/94#issuecomment-155637129
  
    +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---