FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.35k stars 1.25k forks source link

Missing YANG Model Directory and Runtime Error During BGPd Execution #17170

Open lobby-manager opened 2 weeks ago

lobby-manager commented 2 weeks ago

Description

When running the bgpd daemon, there are repeated warnings that the YANG model directory /usr/share/yang does not exist. Additionally, a runtime error occurs related to a null pointer access within lib/zlog_targets.c. The issue appears when linking to external libyang libraries instead of building libyang directly within the FRR project.

Version

commit 382e4e933

How to reproduce

  1. Compile FRRouting with the following flag: export LDFLAGS="-L/libyang/build"
  2. Configure the project:
    ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --enable-dev-build \
    --enable-user=frr \
    --enable-group=frr \
    --enable-vty-group=frrvty \
    --with-pkg-git-version \
    --with-pkg-extra-version=-my-manual-build \
    --enable-backtrace \
    --enable-rpki \
    --enable-mgmtd-test-be-client \
    --enable-sharpd \
    --enable-multipath=64 \
    --enable-snmp=agentx \
    --enable-irdp \
    --enable-snmp \
    --enable-static || exit 1
  3. Compile the project: make -j$(nproc)
  4. Start the zebra daemon: frr/zebra/zebra --limit-fds 100000 -d
  5. Run the bgpd daemon: frr/bgpd/bgpd --limit-fds 100000 -p 179 -f /etc/bgpd.conf -i /var/run/frr/bgpd_1.pid --log stdout

Expected behavior

The bgpd daemon should start without any warnings or runtime errors, and it should correctly resolve paths to YANG models if needed.

Actual behavior

lib/zlog_targets.c:211:8: runtime error: member access within null pointer of type 'struct zlt_fd'

 BGP: [X25ZY-TGTPJ] yang model directory "/usr/share/yang" does not exist
 BGP: [X25ZY-TGTPJ] yang model directory "/usr/share/yang" does not exist
 BGP: [T83RR-8SM5G] bgpd 10.2-dev-my-manual-build-g382e4e933-dirty starting: vty@2605, bgp@<all>:179

Additional context

Checklist

eqvinox commented 1 week ago

I need to look at the zlog_targets thing. Where is that error message coming from, it looks like you're building with some sanitizer?