sysrepo / sysrepo

YANG-based configuration and operational state data store for Unix/Linux applications
http://www.sysrepo.org
BSD 3-Clause "New" or "Revised" License
351 stars 233 forks source link

Crash in operational datastore update #2499

Closed pawanmishranitk closed 2 years ago

pawanmishranitk commented 3 years ago

I am trying below scenario but facing application crash.

  1. Running following binaries A. Netopeer Server B. Netopeer client C. App-1 for subscribing the modules (application_changes_example_mod). ( to run use below command) (i) ./application_changes_example_gov _3gpp-common-managed-element D. App-2 for triggering Operdb update (sr_set_item_example_mod).

  2. Triggering edit-config using netopeer-cli (using du_mm.xml )

  3. Triggering OperDb update from App-2 as follows: with value same as default defined in yang:

    /_3gpp-common-managed-element:ManagedElement[id='1']/_3gpp-nr-nrm-gnbdufunction:GNBDUFunction[id='GNBDUFunction']/_3gpp-nr-nrm-nrcelldu:NRCellDU[id='cellindex_1']/attributes/sample_nr-nrm-nrcelldu:cellSample/MaxLayers 2

  4. Triggering OperDb update from App-2 as follow: with non default value.

    /_3gpp-common-managed-element:ManagedElement[id='1']/_3gpp-nr-nrm-gnbdufunction:GNBDUFunction[id='GNBDUFunction']/_3gpp-nr-nrm-nrcelldu:NRCellDU[id='cellindex_1']/attributes/sample_nr-nrm-nrcelldu:cellSample/MaxLayers 4

After Step-4 App-2 is crashing with below Assert: sr_set_item_example_mod: open_source/netconf/sysrepo/src/edit_diff.c:1996: sr_diff_merge_replace: Assertion `sr_ly_is_userord(diff_match) && (diff_match->schema->nodetype == LYS_LIST)' failed. Aborted (core dumped)

I have installed all below yang files using below command:

$SYSREPOCTL -i $MODDIR/_3gpp-common-managed-element.yang -s $MODDIR -e MeasurementsUnderManagedElement -v4 $SYSREPOCTL -i $MODDIR/_3gpp-common-subnetwork.yang -s $MODDIR -v4 $SYSREPOCTL -i $MODDIR/_3gpp-nr-nrm-nrcelldu.yang -s $MODDIR -v4 $SYSREPOCTL -i $MODDIR/_3gpp-nr-nrm-nrsectorcarrier.yang -s $MODDIR -v4 $SYSREPOCTL -i $MODDIR/_3gpp-nr-nrm-bwp.yang -s $MODDIR -v4 $SYSREPOCTL -i $MODDIR/_3gpp-nr-nrm-ep.yang -s $MODDIR -v4 $SYSREPOCTL -i $MODDIR/_3gpp-nr-nrm-commonbeamformingfunction.yang -s $MODDIR -v4 $SYSREPOCTL -i $MODDIR/sample_nr-nrm-nrcelldu.yang -s $MODDIR -v4

Attachments are:

  1. Application code
  2. yang files.
  3. xml file sampleCode.tar.gz
michalvasko commented 3 years ago

What sysrepo/netopeer2 version are you using? Please use latest libyang1 versions if not already and only if you still reproduce the crash I will try to reproduce and fix it.

pawanmishranitk commented 3 years ago

Hi, I am using libsysrepo v1.4.140 (SO v5.6.56) version.

michalvasko commented 3 years ago

Okay, should be fixed with a test included.

pawanmishranitk commented 3 years ago

Michal, will it work in 2.0 ?

michalvasko commented 3 years ago

Yes, it was not affected by this bug.