hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From realdawn <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-483. Fix bug for Error in debug1...
Date Thu, 03 Mar 2016 07:15:12 GMT
Github user realdawn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/406#discussion_r54843454
  
    --- Diff: src/backend/tcop/postgres.c ---
    @@ -4880,7 +4881,18 @@ PostgresMain(int argc, char *argv[], const char *username)
     						SetUserIdAndContext(cuid, false); /* Set current userid */
     
     					if (serializedIdentityLen > 0)
    +					{
    +						/*
    +						 * serializedIdentity doesn't include '\0', which will cause core dump in SetupProcessIdentity()
with using elog(DEBUG1).
    +						 * So palloc a new string with '\0'.
    +						 */
    +						completeSerializedIdentity = (char *) palloc((serializedIdentityLen + 1) * sizeof(char)
);
    +						memcpy(completeSerializedIdentity, serializedIdentity, serializedIdentityLen);
    +						completeSerializedIdentity[serializedIdentityLen] = '\0';
    +						serializedIdentity = completeSerializedIdentity;
     						SetupProcessIdentity(serializedIdentity);
    --- End diff --
    
    As the MemoryContext which is MessageContext will reset every time, so it will not cause
memory leak even it  errors. 


---
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.
---

Mime
View raw message