Hi Hung, Reviewed the patch. Ack from me.
Thanks, Zoran -----Original Message----- From: Hung Duc Nguyen Sent: Thursday, January 21, 2016 9:46 AM To: Zoran Milinkovic; reddy.neelaka...@oracle.com Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] imm: Fix problems in pbeAuditClasses [#1668] osaf/libs/common/immsv/immpbe_dump.cc | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) Fix these problems in pbeAuditClasses: 1. sqlite3_column_text() is called after sqlite3_finalize() and that causes segmentation fault. 2. Don't 'continue' when we meet an error, all errors must be printed out. 3. Change 'RDN attribute not having SA_IMM_ATTR_INITIALIZED' from ER to WA. diff --git a/osaf/libs/common/immsv/immpbe_dump.cc b/osaf/libs/common/immsv/immpbe_dump.cc --- a/osaf/libs/common/immsv/immpbe_dump.cc +++ b/osaf/libs/common/immsv/immpbe_dump.cc @@ -3473,10 +3473,10 @@ static int pbeAuditClasses(sqlite3 *dbHa } if(sqlite3_step(stmt2) != SQLITE_ROW) { - sqlite3_finalize(stmt2); LOG_ER("Config class '%s' does not have corresponding table in PBE", (char *)sqlite3_column_text(stmt, 2)); err = 1; + sqlite3_finalize(stmt2); continue; } @@ -3496,42 +3496,39 @@ static int pbeAuditClasses(sqlite3 *dbHa } if(sqlite3_step(stmt2) != SQLITE_ROW) { - sqlite3_finalize(stmt2); LOG_ER("Class '%s' does not have RDN attribute", (char *)sqlite3_column_text(stmt, 2)); err = 1; + sqlite3_finalize(stmt2); continue; } attr_type = sqlite3_column_int(stmt2, 0); if(attr_type != SA_IMM_ATTR_SANAMET && attr_type != SA_IMM_ATTR_SASTRINGT) { - sqlite3_finalize(stmt2); LOG_ER("RDN attribute '%s' of class '%s' is not type of SaNameT or SaStringT", (char *)sqlite3_column_text(stmt2, 2), (char *)sqlite3_column_text(stmt, 2)); err = 1; - continue; } attr_flags = sqlite3_column_int64(stmt2, 1); if((attr_flags & SA_IMM_ATTR_CONFIG) != SA_IMM_ATTR_CONFIG) { - sqlite3_finalize(stmt2); LOG_ER("RDN attribute '%s' of class '%s' is not a config attribute. Flags: %lld", (char *)sqlite3_column_text(stmt2, 2), (char *)sqlite3_column_text(stmt, 2), attr_flags); err = 1; - continue; } if((attr_flags & SA_IMM_ATTR_INITIALIZED) != SA_IMM_ATTR_INITIALIZED) { - sqlite3_finalize(stmt2); - LOG_ER("RDN attribute '%s' of class '%s' does not have SA_IMM_ATTR_INITIALIZED flag. Flags: %lld", + /* ImmModel doesn't rely on this flag to check if + * RDN attribute is initialized when creating objects. + * This flag is on in all RDN attributes implicitly, + * but it's good to have it in RDN attributes of configuration classes. */ + LOG_WA("RDN attribute '%s' of class '%s' does not have SA_IMM_ATTR_INITIALIZED flag. Flags: %lld", (char *)sqlite3_column_text(stmt2, 2), (char *)sqlite3_column_text(stmt, 2), attr_flags); - err = 1; - continue; } sqlite3_finalize(stmt2); ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel