CESNET / libnetconf2

C NETCONF library
BSD 3-Clause "New" or "Revised" License
202 stars 146 forks source link

Occasional assert seen when notification thread shutting down #468

Open divyanshu0045 opened 6 months ago

divyanshu0045 commented 6 months ago

I have sometimes noticed that my netconf client asserts while shutting down. I can see the below backtrace everytime this issue is observed, Can some compile optimization be done at libnetconf2 to reduce or resolve this issue?

#0  0x00007fcd841d5387 in raise () from /lib64/libc.so.6
#1  0x00007fcd841d6a78 in abort () from /lib64/libc.so.6
#2  0x00007fcd841ce1a6 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007fcd841ce252 in __assert_fail () from /lib64/libc.so.6
#4  0x00007fcd8a5aab36 in nc_session_client_msgs_unlock (
    session=0x7fcd4824a860, func=0x7fcd8a5d3698 <func.28449> "recv_msg")
    at libnetconf2/src/session.c:483
#5  0x00007fcd8a5b3096 in recv_msg (session=0x7fcd4824a860, timeout=10,
    expected=NC_MSG_NOTIF, message=0x7fcd5fffddd0)
    at libnetconf2/src/session_client.c:2000
#6  0x00007fcd8a5b39f4 in recv_notif (session=0x7fcd4824a860, timeout=10,
    envp=0x7fcd5fffde48, op=0x7fcd5fffde40)
    at libnetconf2/src/session_client.c:2258
#7  0x00007fcd8a5b3bc3 in nc_recv_notif (session=0x7fcd4824a860, timeout=10,
    envp=0x7fcd5fffde48, op=0x7fcd5fffde40)
    at libnetconf2/src/session_client.c:2298
#8  0x00007fcd8a5b3c3f in nc_recv_notif_thread (arg=0x7fcd484b3c80)
    at libnetconf2/src/session_client.c:2324
#9  0x00007fcd84574ea5 in start_thread () from /lib64/libpthread.so.0
#10 0x00007fcd8429db0d in clone () from /lib64/libc.so.6
michalvasko commented 6 months ago

What libnetconf2 version are you using? It should be the latest devel to avoid any fixed issues.

divyanshu0045 commented 6 months ago

Name: libnetconf2 Description: NETCONF server and client library in C. Version: 2.1.25

michalvasko commented 6 months ago

That is quite old so please use at least the latest release or the devel branch, of all the projects you are using, ideally (libyang, libnetconf2, sysrepo, netopeer2).

divyanshu0045 commented 6 months ago

Hi Michal,

Thanks for the response, I went through the change logs of all the later versions but could not find anything related to this issue. Can you point me to the stable tag version rather than the tip of the development branch from where this is expected to be working correctly?

michalvasko commented 6 months ago

Sorry, but I cannot. Using the latest release should also be sufficient (always the code in master).