Hi Nguyen, I will send out a new review request as you suggest. I will probably not be able to do this today
I also would like to understand why you get a coredump. I cannot reproduce that problem in my environment also it does not happen in Osaftest or CoreMW test. The imm_modify_config has been on develop branch for a while and this last #2858 fix does not affect that except that I have added protection of adding duplicate create descriptors to the ccb descriptor. There were some issues with make files and the opensaf.spec.in (for creating rpms) that are fixed but I don’t think that has anything to do with this. Can you please help look into this. The only information I have got is the backtrace in this mail-thread. I will continue looking for possible problems based on the backtrace. Thanks Lennart From: Nguyen Luu <nguyen.tk....@dektech.com.au> Sent: den 1 juni 2018 05:39 To: Lennart Lund <lennart.l...@ericsson.com> Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [PATCH 0/1] Review Request for smf: Validation error for rollback CCB and a related core dump [#2858] Hi Lennart, Thanks for your answers to my comments. I agree with most of the major points. So Ack from me for the diff file. I can do a double-check review if you will send out a new patch (with comments removed). Thanks, Nguyen On 5/31/2018 10:48 PM, Lennart Lund wrote: Hi Nguyen, Attached is a diff with your comments still in there and my answers tagged [Lennart]. I have also kept your uncommented fixes. If you ack this I will use the patch with review comments removed. Thanks Lennart From: Nguyen Luu <nguyen.tk....@dektech.com.au><mailto:nguyen.tk....@dektech.com.au> Sent: den 31 maj 2018 11:10 To: Lennart Lund <lennart.l...@ericsson.com><mailto:lennart.l...@ericsson.com> Cc: opensaf-devel@lists.sourceforge.net<mailto:opensaf-devel@lists.sourceforge.net> Subject: Re: [PATCH 0/1] Review Request for smf: Validation error for rollback CCB and a related core dump [#2858] Hi Lennart, I've reviewed and tested your patch. - For the code review, please check comments in the attached diff file. - For the testing, a core dump occurred when executing test_ccbhdl (always reproducible). Test printouts, core dump backtrace, and syslog as shown below. Looks like some issue with setting an extended-name attribute of type SA_IMM_ATTR_SANAMET. Has this test passed in your last run? -----Terminal printouts----- root@SC-1:~# test_ccbhdl ccbhdl_test IMM class used for test: ImmTestValuesConfig Creating: Test1=1,safApp=safSmfService Aborted (core dumped) -----System logs----- 2018-05-31 16:02:35.873 SC-1 osafimmpbed: IN Create of class ImmTestValuesConfig committing with ccbId:100000004 2018-05-31 16:02:35.889 SC-1 osafimmnd[207]: NO Create of class ImmTestValuesConfig is PERSISTENT. 2018-05-31 16:02:35.908 SC-1 osafimmpbed: NO PBE allowing modification to object opensafImm=opensafImm,safApp=safImmService 2018-05-31 16:02:35.922 SC-1 osafimmnd[207]: NO Ccb 2 COMMITTED (immcfg_SC-1_487) 2018-05-31 16:02:35.934 SC-1 test_ccbhdl: src/base/osaf_extended_name.c:144: osaf_extended_name_length: Assertion 'osaf_extended_names_enabled && length >= SA_MAX_UNEXTENDED_NAME_LENGTH' failed. -----Core dump backtrace----- (gdb) bt #0 0x00007faf97b83428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #1 0x00007faf97b8502a in __GI_abort () at abort.c:89 #2 0x00007faf987034ab in __osafassert_fail (__file=__file@entry=0x7faf9873275d "src/base/osaf_extended_name.c", __line=__line@entry=144, __func=__func@entry=0x7faf987327f0 <__FUNCTION__.3368> "osaf_extended_name_length", __assertion=__assertion@entry=0x7faf987327a8 "osaf_extended_names_enabled && length >= SA_MAX_UNEXTENDED_NAME_LENGTH") at src/base/sysf_def.c:286 #3 0x00007faf986fef89 in osaf_extended_name_length (name=0x564decae3796) at src/base/osaf_extended_name.c:143 #4 0x00007faf9895ef1d in imma_copyAttrValue (p=p@entry=0x564decae2d00, attrValueType=SA_IMM_ATTR_SANAMET, attrValue=0x564decae3796) at src/imm/agent/imma_init.cc:434 #5 0x00007faf9896b140 in ccb_object_create_common (ccbHandle=1527757355930828673, className=<optimized out>, parentName=0x7ffefbb72e20, objectName=<optimized out>, objectName@entry=0x0, attrValues=attrValues@entry=0x7ffefbb72cf0) at src/imm/agent/imma_om_api.cc:2079 #6 0x00007faf9896d8cf in saImmOmCcbObjectCreate_2 (ccbHandle=<optimized out>, className=<optimized out>, parentName=<optimized out>, attrValues=attrValues@entry=0x7ffefbb72cf0) at src/imm/agent/imma_om_api.cc:1660 #7 0x0000564dea9df953 in immom::ImmOmCcbObjectCreate::AddObjectCreateToCcb (this=this@entry=0x7ffefbb72ff0) at src/smf/smfd/imm_om_ccapi/om_ccb_object_create.cc:61 #8 0x0000564dea9d8d54 in modelmodify::AddCreateToCcb (ccb_handle=@0x7ffefbb730c8: 1527757355930828673, create_descriptor=...) at src/smf/smfd/imm_modify_config/add_operation_to_ccb.cc:103 #9 0x0000564dea9db26c in modelmodify::ModelModification::AddCreate (this=this@entry=0x7ffefbb73870, create_descriptor=...) at src/smf/smfd/imm_modify_config/immccb.cc:482 #10 0x0000564dea9dca8b in modelmodify::ModelModification::AddCreates (this=this@entry=0x7ffefbb73870, create_descriptors=std::vector of length 1, capacity 1 = {...}) at src/smf/smfd/imm_modify_config/immccb.cc:455 #11 0x0000564dea9dce67 in modelmodify::ModelModification::DoModelModification (this=0x7ffefbb73870, modifications=...) at src/smf/smfd/imm_modify_config/immccb.cc:107 #12 0x0000564dea9c61af in CreateOneObject () at src/smf/smfd/imm_modify_demo/test_ccbhdl.cc:141 #13 0x0000564dea9bd36c in main () at src/smf/smfd/imm_modify_demo/test_ccbhdl.cc:244 Thanks, Nguyen On 5/29/2018 9:40 PM, Lennart Lund wrote: Summary: smf: Validation error for rollback CCB and a related core dump [#2858] Review request for Ticket(s): 2858 Peer Reviewer(s): nguyen.tk....@dektech.com.au<mailto:nguyen.tk....@dektech.com.au> Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE *** Affected branch(es): develop Development branch: ticket-2858 Base revision: 1c4c6ad57fdf44b228ec83f777ae957e878f1d61 Personal repository: git://git.code.sf.net/u/elunlen/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 Comments (indicate scope for each "y" above): --------------------------------------------- The lists of IMM operations that are created in many places may contain object create operations for objects that already exists in the IMM model. The lists may also contain more than one create operation for the same object. If a create operation for any of the duplicates is added to the CCB, ERR_EXSIST will be returned. To avoid this it must be checked for each create operation if the IMM model already contains the object and also that the same object create is not added twice to the CCB. Also if a duplicate object to create is found the rollbackData that is created for all IMM operations must be deleted if the corresponding operation is a duplicate. See doImmOperations() in SmfUtil.cc The patch contains a new class that is used to check if an object to be created exist in the IMM model. This class can be found in the new SmfUtils_ObjExist.* files. A test program for the class is created and can be found in .../imm_modify_demo/test_objexist.cc. A shell command, test_objexist, is created and installed if --enble-tests is used with the configure script. To make sure duplicate object create requests is not added the ccb descriptor is updated so that a duplicate create descriptor is not added. The ccb decriptor AddCreate() method will also return false if a create descriptor is not added. See ../imm_modify_config/immccb.h revision cf93518e220de4e0b9053d46850d926ef0293f33 Author: Lennart Lund <lennart.l...@ericsson.com><mailto:lennart.l...@ericsson.com> Date: Tue, 29 May 2018 15:47:05 +0200 smf: Validation error for rollback CCB and a related core dump [#2858] SMF imm operation lists may contain duplicate create operations. Fix, rollback data shall not be stored for duplicate operations and duplicate operations shall not be added to the CCB. Fix, crash in SmfUtil::doImmoperation if the CCB fails Added Files: ------------ src/smf/smfd/imm_modify_demo/test_objexist.cc src/smf/smfd/SmfUtils_ObjExist.cc src/smf/smfd/SmfUtils_ObjExist.h Complete diffstat: ------------------ opensaf.spec.in | 3 +- src/smf/Makefile.am | 42 ++- src/smf/smfd/SmfUtils.cc | 72 ++++- src/smf/smfd/SmfUtils_ObjExist.cc | 290 +++++++++++++++++++++ src/smf/smfd/SmfUtils_ObjExist.h | 68 +++++ .../smfd/imm_modify_config/add_operation_to_ccb.cc | 5 +- src/smf/smfd/imm_modify_config/immccb.h | 53 +++- .../{ccbhdl_test.cc => test_ccbhdl.cc} | 0 src/smf/smfd/imm_modify_demo/test_objexist.cc | 127 +++++++++ 9 files changed, 633 insertions(+), 27 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 n n 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. user.name, 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! http://sdm.link/slashdot _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel