Skip to content

top-level lists are silenty ignored in get #18

Open

Description

@jktjkt
module wtf {
  prefix "wtf";
  namespace "wtf";
  list foo {
    key x;
    leaf x {
      type string;
    }
  }
}

When using that with either sysrepo-cli or netconf-cli-local, the top-levle items are apparently ignored by get. I do see them in dump json at least:

/> create /wtf:foo[x='a']
/> create /wtf:foo[x='b']
/> commit
/> get /wtf:foo
/> get /wtf:*
/> dump json
...
  "wtf:foo": [
    {
      "x": "a"
    },
    {
      "x": "b"
    }
  ]
}

The yang-cli appears to work OK.

Activity

  1. jktjkt commented on Jan 17, 2024

    @jktjkt
    ContributorAuthor

    ...and it segfaults when I try to delete them :)

    /> delete /wtf:foo[x='a']/
    /> delete /wtf:foo[x='b']/
    /> commit
    Segmentation fault (core dumped)
    line-M0N ~ # coredumpctl debug
               PID: 4441 (sysrepo-cli)
               UID: 0 (root)
               GID: 0 (root)
            Signal: 11 (SEGV)
         Timestamp: Wed 2024-01-17 12:35:10 UTC (11s ago)
      Command Line: sysrepo-cli
        Executable: /usr/bin/sysrepo-cli
     Control Group: /system.slice/sshd.service
              Unit: sshd.service
             Slice: system.slice
           Boot ID: 6893289e9f204bddac0ec69c9b26456d
        Machine ID: 88cf425f75b84e5da8717aa71b769733
          Hostname: line-M0N
           Storage: /var/lib/systemd/coredump/core.sysrepo-cli.0.6893289e9f204bddac0ec69c9b26456d.4441.1705494910000000.zst (present)
      Size on Disk: 805.2K
           Message: Process 4441 (sysrepo-cli) of user 0 dumped core.
                    
                    Module libcrypt.so.1 without build-id.
                    Module libcap.so.2 without build-id.
                    Module libnss_systemd.so.2 without build-id.
                    Module libpcre2-8.so.0 without build-id.
                    Module libatomic.so.1 without build-id.
                    Module libyang.so.2 without build-id.
                    Module libsysrepo.so.7 without build-id.
                    Module ld-linux-armhf.so.3 without build-id.
                    Module libc.so.6 without build-id.
                    Module libgcc_s.so.1 without build-id.
                    Module libm.so.6 without build-id.
                    Module libstdc++.so.6 without build-id.
                    Module libyang-cpp.so without build-id.
                    Module libdocopt.so.0 without build-id.
                    Module libsysrepo-cpp.so without build-id.
                    Module libreplxx.so.0.0.4 without build-id.
                    Module sysrepo-cli without build-id.
                    Stack trace of thread 4441:
                    #0  0x00000000b6a49388 lyd_validate_module_final (libyang.so.2 + 0xda388)
                    #1  0x00000000b6aab824 sr_modinfo_validate (libsysrepo.so.7 + 0x2d824)
                    #2  0x00000000b6a8e6bc sr_changes_notify_store (libsysrepo.so.7 + 0x106bc)
                    #3  0x00000000b6a8f2a4 sr_apply_changes (libsysrepo.so.7 + 0x112a4)
                    #4  0x00000000b6ed6090 _ZN7sysrepo7Session12applyChangesENSt6chrono8durationIxSt5ratioILx1ELx1000EEEE (libsysrepo-cpp.so + 0xa090)
                    #5  0x00000000004e8990 _ZN13SysrepoAccess13commitChangesEv (sysrepo-cli + 0x17990)
                    #6  0x00000000004dc5f8 _ZN5boost13apply_visitorI11InterpreterRNS_7variantINS_6detail7variant13over_sequenceINS_3mpl6l_itemIN4mpl_5long_ILl18EEE7cancel_NS7_INS9_ILl17EEE3cd_NS7_INS9_ILl16EEE7commit_NS7_INS9_ILl15EEE5copy_NS7_INS9_ILl14EEE7create_NS7_INS9_ILl13EEE7delete_NS7_INS9_ILl12EEE9describe_NS7_INS9_ILl11EEE8discard_NS7_INS9_ILl10EEE5dump_NS7_INS9_ILl9EEE5exec_NS7_INS9_ILl8EEE4get_NS7_INS9_ILl7EEE5help_NS7_INS9_ILl6EEE3ls_NS7_INS9_ILl5EEE5move_NS7_INS9_ILl4EEE8prepare_NS7_INS9_ILl3EEE5quit_NS7_INS9_ILl2EEE4set_NS7_INS9_ILl1EEE7switch_NS6_5l_endEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEJEEEEENT_11result_typeERKS1W_OT0_ (sysrepo-cli + 0xb5f8)
                    #7  0x00000000b6b288a8 n/a (libc.so.6 + 0x228a8)
                    ELF object binary architecture: ARM
    
    GNU gdb (GDB) 13.2
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "arm-buildroot-linux-gnueabihf".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <https://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
    
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from /usr/bin/sysrepo-cli...
    [New LWP 4441]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/libthread_db.so.1".
    Core was generated by `sysrepo-cli'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  lyd_validate_module_final (tree=0x0, module=0x1c88bf8, val_opts=val_opts@entry=1) at /home/jkt/work/prog/_build/_br-cfb/build/libyang-custom/src/validation.c:1927
    1927    /home/jkt/work/prog/_build/_br-cfb/build/libyang-custom/src/validation.c: No such file or directory.
    (gdb) bt
    #0  lyd_validate_module_final (tree=0x0, module=0x1c88bf8, val_opts=val_opts@entry=1) at /home/jkt/work/prog/_build/_br-cfb/build/libyang-custom/src/validation.c:1927
    #1  0xb6aab824 in sr_modinfo_validate (mod_info=mod_info@entry=0xbec47988, mod_state=mod_state@entry=516, finish_diff=finish_diff@entry=1)
        at /home/jkt/work/prog/_build/_br-cfb/build/sysrepo-custom/src/modinfo.c:2710
    #2  0xb6a8e6bc in sr_changes_notify_store (mod_info=mod_info@entry=0xbec47988, session=session@entry=0x1b95140, timeout_ms=timeout_ms@entry=1000, cb_err_info=0xbec47984, cb_err_info@entry=0xbec4797c)
        at /home/jkt/work/prog/_build/_br-cfb/build/sysrepo-custom/src/sysrepo.c:3750
    #3  0xb6a8f2a4 in sr_apply_changes (session=0x1b95140, timeout_ms=1000) at /home/jkt/work/prog/_build/_br-cfb/build/sysrepo-custom/src/sysrepo.c:3898
    #4  0xb6ed6090 in sysrepo::Session::applyChanges (this=this@entry=0x1b72c14, timeout=...)
        at /home/jkt/work/prog/_build/_br-cfb/per-package/sysrepo-cpp/host/opt/ext-toolchain/arm-buildroot-linux-gnueabihf/include/c++/13.2.0/bits/chrono.h:600
    #5  0x004e8990 in SysrepoAccess::commitChanges (this=0x1b72c04) at /home/jkt/work/prog/_build/_br-cfb/build/netconf-cli-custom/src/sysrepo_access.cpp:157
    #6  0x004dc5f8 in boost::apply_visitor<Interpreter, boost::variant<boost::detail::variant::over_sequence<boost::mpl::l_item<mpl_::long_<18l>, cancel_, boost::mpl::l_item<mpl_::long_<17l>, cd_, boost::mpl::l_item<mpl_::long_<16l>, commit_, boost::mpl::l_item<mpl_::long_<15l>, copy_, boost::mpl::l_item<mpl_::long_<14l>, create_, boost::mpl::l_item<mpl_::long_<13l>, delete_, boost::mpl::l_item<mpl_::long_<12l>, describe_, boost::mpl::l_item<mpl_::long_<11l>, discard_, boost::mpl::l_item<mpl_::long_<10l>, dump_, boost::mpl::l_item<mpl_::long_<9l>, exec_, boost::mpl::l_item<mpl_::long_<8l>, get_, boost::mpl::l_item<mpl_::long_<7l>, help_, boost::mpl::l_item<mpl_::long_<6l>, ls_, boost::mpl::l_item<mpl_::long_<5l>, move_, boost::mpl::l_item<mpl_::long_<4l>, prepare_, boost::mpl::l_item<mpl_::long_<3l>, quit_, boost::mpl::l_item<mpl_::long_<2l>, set_, boost::mpl::l_item<mpl_::long_<1l>, switch_, boost::mpl::l_end> > > > > > > > > > > > > > > > > > >>&>(Interpreter const&, boost::variant<boost::detail::variant::over_sequence<boost::mpl::l_item<mpl_::long_<18l>, cancel_, boost::mpl::l_item<mpl_::long_<17l>, cd_, boost::mpl::l_item<mpl_::long_<16l>, commit_, boost::mpl::l_item<mpl_::long_<15l>, copy_, boost::mpl::l_item<mpl_::long_<14l>, create_, boost::mpl::l_item<mpl_::long_<13l>, delete_, boost::mpl::l_item<mpl_::long_<12l>, describe_, boost::mpl::l_item<mpl_::long_<11l>, discard_, boost::mpl::l_item<mpl_::long_<10l>, dump_, boost::mpl::l_item<mpl_::long_<9l>, exec_, boost::mpl::l_item<mpl_::long_<8l>, get_, boost::mpl::l_item<mpl_::long_<7l>, help_, boost::mpl::l_item<mpl_::long_<6l>, ls_, boost::mpl::l_item<mpl_::long_<5l>, move_, boost::mpl::l_item<mpl_::long_<4l>, prepare_, boost::mpl::l_item<mpl_::long_<3l>, quit_, boost::mpl::l_item<mpl_::long_<2l>, set_, boost::mpl::l_item<mpl_::long_<1l>, switch_, boost::mpl::l_end> > > > > > > > > > > > > > > > > > >>&) (visitable=..., visitor=...)
        at /home/jkt/work/prog/_build/_br-cfb/per-package/netconf-cli/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/boost/variant/detail/apply_visitor_unary.hpp:66
    #7  main (argc=<optimized out>, argv=<optimized out>) at /home/jkt/work/prog/_build/_br-cfb/build/netconf-cli-custom/src/cli.cpp:299
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions