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
Compile FRRouting with the following flag:
export LDFLAGS="-L/libyang/build"
Start the zebra daemon:
frr/zebra/zebra --limit-fds 100000 -d
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
The following runtime error is observed:
lib/zlog_targets.c:211:8: runtime error: member access within null pointer of type 'struct zlt_fd'
Warnings indicating missing YANG model directories:
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
This issue may be related to how libyang is linked. Instead of building libyang directly as part of FRR, external libraries were used.
The runtime error suggests there could be an uninitialized structure or misconfiguration in lib/zlog_targets.c, leading to improper access within struct zlt_fd.
Checklist
[X] I have searched the open issues for this bug.
[X] I have not included sensitive information in this report.
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
How to reproduce
export LDFLAGS="-L/libyang/build"
make -j$(nproc)
frr/zebra/zebra --limit-fds 100000 -d
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'
Additional context
This issue may be related to how libyang is linked. Instead of building libyang directly as part of FRR, external libraries were used.
The runtime error suggests there could be an uninitialized structure or misconfiguration in lib/zlog_targets.c, leading to improper access within struct zlt_fd.
Checklist