hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject incubator-hawq git commit: HAWQ-483. Fix 'unexpected internal error' in dispatcher while doing 'insert into select' with DEBUG1 mode
Date Thu, 03 Mar 2016 07:27:15 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 2d36f1340 -> 12d2bd635


HAWQ-483. Fix 'unexpected internal error' in dispatcher while doing 'insert into select' with
DEBUG1 mode


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/12d2bd63
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/12d2bd63
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/12d2bd63

Branch: refs/heads/master
Commit: 12d2bd6354fc722fd168f5cbc899ce390291d12a
Parents: 2d36f13
Author: Ruilong Huo <rhuo@pivotal.io>
Authored: Wed Mar 2 23:23:27 2016 -0800
Committer: Ruilong Huo <rhuo@pivotal.io>
Committed: Wed Mar 2 23:23:27 2016 -0800

----------------------------------------------------------------------
 src/backend/tcop/postgres.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/12d2bd63/src/backend/tcop/postgres.c
----------------------------------------------------------------------
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index c946a42..c42046d 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -4880,7 +4880,17 @@ PostgresMain(int argc, char *argv[], const char *username)
 						SetUserIdAndContext(cuid, false); /* Set current userid */
 
 					if (serializedIdentityLen > 0)
-						SetupProcessIdentity(serializedIdentity);
+					{
+						/*
+						 * serializedIdentity doesn't include '\0', which will cause core dump in SetupProcessIdentity()
with using elog(DEBUG1).
+						 * So palloc a new string with '\0'.
+						 */
+						char *completeSerializedIdentity = (char *) palloc((serializedIdentityLen + 1) * sizeof(char)
);
+						memcpy(completeSerializedIdentity, serializedIdentity, serializedIdentityLen);
+						completeSerializedIdentity[serializedIdentityLen] = '\0';
+						SetupProcessIdentity((const char*)completeSerializedIdentity);
+						pfree(completeSerializedIdentity);
+					}
 
 					if (serializedQuerytreelen==0 && serializedPlantreelen==0)
 					{


Mime
View raw message