Hi Gary,

       The check to make sure saAmfCompContainerCsi is defined for a
   contained component, was not handling the case in which the comptype
   was being added dynamically in the same ccb. I assume that is what your
   tests are doing...

       Try the attached patch on top of what I sent.

   Alex

   On 08/02/2018 09:50 PM, Gary Lee wrote:
     __________________________________________________________________

   NOTICE: This email was received from an EXTERNAL sender
     __________________________________________________________________

   Some more info from valgrind:
   ==274== Invalid read of size 1
   ==274== at 0x14C080: is_config_valid(std::__cxx11::basic_string<char,
   std::char_traits<char>, std::allocator<char> > const&,
   SaImmAttrValuesT_2 const**, CcbUtilOperationData*) [clone
   .constprop.98] (comp.cc:404)
   ==274== by 0x14C4A0: comp_ccb_completed_cb(CcbUtilOperationData*)
   (comp.cc:1359)
   ==274== by 0x16B4C7: ccb_completed_cb(unsigned long long, unsigned long
   long) (imm.cc:1177)
   ==274== by 0x548D487: imma_process_callback_info(imma_cb*,
   imma_client_node*, imma_callback_info*, unsigned long long)
   (imma_proc.cc:2337)
   ==274== by 0x548EED8: imma_hdl_callbk_dispatch_all(imma_cb*, unsigned
   long long) (imma_proc.cc:1832)
   ==274== by 0x5482FA6: saImmOiDispatch (imma_oi_api.cc:642)
   ==274== by 0x12866B: main_loop (main.cc:713)
   ==274== by 0x12866B: main (main.cc:844)
   ==274== Address 0x20 is not stack'd, malloc'd or (recently) free'd
   On 3/8/18, 11:25 am, "Gary Lee" [1]<gary....@dektech.com.au> wrote:
   Hi Alex
   I haven't had a chance to look at it, but I did run our regression
   tests with the patch.
   amfd is segfaulting regularly, with backtraces like the attachment.
   Thanks
   Gary
   From: Alex Jones [2]<ajo...@rbbn.com>
   Organization: Ribbon
   Date: Thursday, 2 August 2018 at 3:52 am
   To: [3]<hans.nordeb...@ericsson.com>, [4]<gary....@dektech.com.au>,
   [5]<ravisekhar.ko...@oracle.com>, [6]<nagen...@hasolutions.in>
   Cc: [7]<opensaf-devel@lists.sourceforge.net>
   Subject: Re: [PATCH 0/1] Review Request for amf: add support for
   container/contained [#70]
   Hi Guys,
   I realized I forgot to put some notes in this review request...
   75% of this code is from Praveen. I added some stuff that wasn't there
   like shutting down contained sus when the container goes down, allowing
   TRY_AGAIN in contained instantiation, and some more configuration
   checking.
   Everything in the B.04.01 spec regarding container/contained should be
   implemented, but I have not testing everything. Everything in the
   samples/amf/container directory has been tested (container n-way,
   contained 2-n, TRY_AGAIN for contained instantiation), but I have not
   tested other service models for the contained SG. I have also tested
   locking the container SUs, and the container SG, to make sure the
   contained SUs go down.
   Let me know if you see problems, or think something wasn't done right.
   Alex
   On 07/31/2018 04:22 PM, Alex Jones wrote:
   Summary: amf: add support for container/contained [#70]
   Review request for Ticket(s): 70
   Peer Reviewer(s): Nagu, Hans, Ravi, Gary
   Pull request to:
   Affected branch(es): develop
   Development branch: ticket-70
   Base revision: 7f6f6c0531a0f5e4f2b0dc1abf4bab6962a3d1a9
   Personal repository: [8]git://git.code.sf.net/u/trguitar/review
   --------------------------------
   Impacted area Impact y/n
   --------------------------------
   Docs n
   Build system n
   RPM/packaging n
   Configuration files n
   Startup scripts n
   SAF services y
   OpenSAF services n
   Core libraries n
   Samples n
   Tests n
   Other n
   NOTE: Patch(es) contain lines longer than 80 characers
   Comments (indicate scope for each "y" above):
   ---------------------------------------------
   revision d33e50eeb51ccf8808c24a445637d6f1472c396e
   Author: Alex Jones [9]<ajo...@rbbn.com>
   Date: Tue, 31 Jul 2018 16:06:47 -0400
   amf: add support for container/contained [#70]
   This ticket adds support for container/contained for AMF.
   Added Files:
   ------------
   samples/amf/container/amf_container_demo.c
   samples/amf/container/amf_container_script
   samples/amf/container/AppConfig-contained-2N.xml
   samples/amf/container/AppConfig-container.xml
   samples/amf/container/Makefile.am
   samples/amf/container/README
   Complete diffstat:
   ------------------
   samples/amf/container/AppConfig-contained-2N.xml | 327 +++++++++
   samples/amf/container/AppConfig-container.xml | 331 ++++++++++
   samples/amf/container/Makefile.am | 45 ++
   samples/amf/container/README | 36 +
   samples/amf/container/amf_container_demo.c | 803
   +++++++++++++++++++++++
   samples/amf/container/amf_container_script | 101 +++
   src/amf/agent/amf_agent.cc | 73 ++-
   src/amf/agent/ava_cb.h | 1 +
   src/amf/agent/ava_hdl.cc | 31 +
   src/amf/agent/ava_mds.cc | 34 +-
   src/amf/agent/ava_mds.h | 3 +-
   src/amf/agent/ava_op.cc | 6 +
   src/amf/amfd/comp.cc | 55 +-
   src/amf/amfd/comp.h | 4 +-
   src/amf/amfd/comptype.cc | 6 +-
   src/amf/amfd/csi.cc | 6 +
   src/amf/amfd/csi.h | 3 +
   src/amf/amfd/ndproc.cc | 14 +
   src/amf/amfd/node.cc | 29 +
   src/amf/amfd/node.h | 1 +
   src/amf/amfd/sg.cc | 29 +
   src/amf/amfd/sg.h | 4 +
   src/amf/amfd/sgproc.cc | 142 +++-
   src/amf/amfd/si.cc | 17 +
   src/amf/amfd/si.h | 1 +
   src/amf/amfd/su.cc | 155 ++++-
   src/amf/amfd/su.h | 15 +-
   src/amf/amfd/util.cc | 39 ++
   src/amf/amfd/util.h | 2 +
   src/amf/amfnd/amfnd.cc | 5 +-
   src/amf/amfnd/avnd_cb.h | 2 +
   src/amf/amfnd/avnd_comp.h | 64 +-
   src/amf/amfnd/avnd_evt.h | 1 +
   src/amf/amfnd/avnd_proc.h | 2 +
   src/amf/amfnd/avnd_su.h | 4 +
   src/amf/amfnd/cbq.cc | 102 ++-
   src/amf/amfnd/chc.cc | 2 +-
   src/amf/amfnd/clc.cc | 95 ++-
   src/amf/amfnd/comp.cc | 90 ++-
   src/amf/amfnd/compdb.cc | 22 +-
   src/amf/amfnd/err.cc | 2 +-
   src/amf/amfnd/evt.cc | 2 +
   src/amf/amfnd/main.cc | 1 +
   src/amf/amfnd/mds.cc | 19 +
   src/amf/amfnd/proxy.cc | 2 +-
   src/amf/amfnd/su.cc | 8 +
   src/amf/amfnd/susm.cc | 88 ++-
   src/amf/common/amf_amfparam.h | 22 +
   src/amf/common/amf_d2nmsg.h | 10 +
   src/amf/common/amf_defs.h | 2 +
   src/amf/common/amf_util.h | 3 +-
   src/amf/common/d2nedu.c | 22 +-
   src/amf/common/n2avaedu.c | 6 +-
   src/amf/common/n2avamsg.c | 13 +
   src/amf/common/util.c | 32 +-
   tools/cluster_sim_uml/build_uml | 45 ++
   56 files changed, 2852 insertions(+), 127 deletions(-)
   Testing Commands:
   -----------------
   *** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***
   Testing, Expected Results:
   --------------------------
   *** PASTE COMMAND OUTPUTS / TEST RESULTS ***
   Conditions of Submission:
   -------------------------
   *** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***
   Arch Built Started Linux distro
   -------------------------------------------
   mips n n
   mips64 n n
   x86 n n
   x86_64 y y
   powerpc n n
   powerpc64 n n
   Reviewer Checklist:
   -------------------
   [Submitters: make sure that your review doesn't trigger any
   checkmarks!]
   Your checkin has not passed review because (see checked entries):
   ___ Your RR template is generally incomplete; it has too many blank
   entries
   that need proper data filled in.
   ___ You have failed to nominate the proper persons for review and push.
   ___ Your patches do not have proper short+long header
   ___ You have grammar/spelling in your header that is unacceptable.
   ___ You have exceeded a sensible line length in your
   headers/comments/text.
   ___ You have failed to put in a proper Trac Ticket # into your commits.
   ___ You have incorrectly put/left internal data in your comments/files
   (i.e. internal bug tracking tool IDs, product names etc)
   ___ You have not given any evidence of testing beyond basic build
   tests.
   Demonstrate some level of runtime or other sanity testing.
   ___ You have ^M present in some of your files. These have to be
   removed.
   ___ You have needlessly changed whitespace or added whitespace crimes
   like trailing spaces, or spaces before tabs.
   ___ You have mixed real technical changes with whitespace and other
   cosmetic code cleanup changes. These have to be separate commits.
   ___ You need to refactor your submission into logical chunks; there is
   too much content into a single commit.
   ___ You have extraneous garbage in your review (merge commits etc)
   ___ You have giant attachments which should never have been sent;
   Instead you should place your content in a public tree to be pulled.
   ___ You have too many commits attached to an e-mail; resend as threaded
   commits, or place in a public tree for a pull.
   ___ You have resent this content multiple times without a clear
   indication
   of what has changed between each re-send.
   ___ You have failed to adequately and individually address all of the
   comments and change requests that were proposed in the initial review.
   ___ You have a misconfigured ~/.gitconfig file (i.e. [10]user.name,
   [11]user.email etc)
   ___ Your computer have a badly configured date and time; confusing the
   the threaded patch review.
   ___ Your changes affect IPC mechanism, and you don't present any
   results
   for in-service upgradability test.
   ___ Your changes affect user manual and documentation, your patch
   series
   do not contain the patch that updates the Doxygen manual.
   -----------------------------------------------------------------------
   -------
   Check out the vibrant tech community on one of the world's most
   engaging tech sites, Slashdot.org!
   [12]http://sdm.link/slashdot___________________________________________
   ____
   Opensaf-devel mailing list
   [13]Opensaf-devel@lists.sourceforge.net
   [14]https://lists.sourceforge.net/lists/listinfo/opensaf-devel

References

   1. mailto:gary....@dektech.com.au
   2. mailto:ajo...@rbbn.com
   3. mailto:hans.nordeb...@ericsson.com
   4. mailto:gary....@dektech.com.au
   5. mailto:ravisekhar.ko...@oracle.com
   6. mailto:nagen...@hasolutions.in
   7. mailto:opensaf-devel@lists.sourceforge.net
   8. https://protect-us.mimecast.com/s/mVluCpYz3YivzW5c2_FML
   9. mailto:ajo...@rbbn.com
  10. https://protect-us.mimecast.com/s/F00nCqx23xSzO39FqLuUb?domain=user.name
  11. https://protect-us.mimecast.com/s/qiNiCrkY3ki1AYxsQ7i1Z?domain=user.email
  12. https://protect-us.mimecast.com/s/kGYvCv2j32i2W5vcwm__p?domain=sdm.link
  13. mailto:Opensaf-devel@lists.sourceforge.net
  14. 
https://protect-us.mimecast.com/s/YSyhCwpk3pCALmoulLc94?domain=lists.sourceforge.net
diff --git a/src/amf/amfd/comp.cc b/src/amf/amfd/comp.cc
index 288c2ecac..571ac34fb 100644
--- a/src/amf/amfd/comp.cc
+++ b/src/amf/amfd/comp.cc
@@ -358,6 +358,7 @@ static int is_config_valid(const std::string &dn,
   osafassert(rc == SA_AIS_OK);
 
   AVD_COMP_TYPE *comptype(comptype_db->find(Amf::to_string(&aname)));
+  CcbUtilOperationData_t *ccbCompTypeOpData(nullptr);
 
   if (comptype == nullptr) {
     /* Comp type does not exist in current model, check CCB */
@@ -367,7 +368,8 @@ static int is_config_valid(const std::string &dn,
       return 0;
     }
 
-    if (ccbutil_getCcbOpDataByDN(opdata->ccbId, &aname) == nullptr) {
+    ccbCompTypeOpData = ccbutil_getCcbOpDataByDN(opdata->ccbId, &aname);
+    if (ccbCompTypeOpData == nullptr) {
       report_ccb_validation_error(
           opdata, "'%s' does not exist in existing model or in CCB",
           osaf_extended_name_borrow(&aname));
@@ -401,7 +403,13 @@ static int is_config_valid(const std::string &dn,
     return 0;
   }
 
-  if (IS_COMP_CONTAINED(comptype->saAmfCtCompCategory)) {
+  if ((comptype && IS_COMP_CONTAINED(comptype->saAmfCtCompCategory)) ||
+      (ccbCompTypeOpData &&
+      ccbCompTypeOpData->operationType == CCBUTIL_CREATE &&
+      immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtCompCategory"),
+                      ccbCompTypeOpData->param.create.attrValues,
+                      0, &value) == SA_AIS_OK &&
+      value & SA_AMF_COMP_CONTAINED)) {
     rc = immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCompContainerCsi"),
                        attributes, 0, &value);
     if (rc != SA_AIS_OK) {

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to