From 7480a680e30a80b0a3e866fabf75368f49175a4b Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 22 May 2014 00:36:25 +0000 Subject: [PATCH] Turns out that valgrind has issues with strings that don't fall on nice 4-byte alignments with some optimized builds. So make the default security credential a nice 7-characters (so we get 8-bytes with the NULL terminator) to make valgrind shut up. Thanks to Walter Spector for reporting this. cmr=v1.8.2:reviewer=jsquyres:subject=align the default sec credential This commit was SVN r31873. --- opal/mca/sec/basic/sec_basic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opal/mca/sec/basic/sec_basic.c b/opal/mca/sec/basic/sec_basic.c index de7e1721cc..b7d03deef5 100644 --- a/opal/mca/sec/basic/sec_basic.c +++ b/opal/mca/sec/basic/sec_basic.c @@ -69,7 +69,11 @@ static int get_my_cred(int dstorehandle, if (OPAL_SUCCESS == opal_dstore.fetch(dstorehandle, my_id, OPAL_DSTORE_CREDENTIAL, &vals)) { kv = (opal_value_t*)opal_list_remove_first(&vals); if (NULL == kv) { - my_cred.credential = strdup("12345"); + /* make the default credential 7-bytes long so we hit a nice + * 8-byte alignment (including NULL terminator) to keep valgrind + * from barking in optimized builds + */ + my_cred.credential = strdup("1234567"); my_cred.size = strlen(my_cred.credential)+1; // include the NULL } else { my_cred.credential = strdup(kv->data.string);