hawq-dev mailing list archives

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

    https://github.com/apache/incubator-hawq/pull/406#discussion_r54839613
  
    --- 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 --
    
    Here pfree only handle the situation when SetupProcessIdentity successfully compltes.
We also need to do the pfree if it errors in SetupProcessIdentity.


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