CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
301 stars 189 forks source link

SIGSEGV after netopeer2 server restart #1364

Closed pfeige closed 1 year ago

pfeige commented 1 year ago

Hi Michal,

when the netopeer2 server is restarted during a running confirmed commit it crashes with SIGSEGV.

Core was generated by `netopeer2-server -d -t 600'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __timer_delete_new (timerid=0x0) at ../sysdeps/unix/sysv/linux/timer_delete.c:38
38  ../sysdeps/unix/sysv/linux/timer_delete.c: No such file or directory.
[Current thread is 1 (Thread 0x7f8b5eb509c0 (LWP 4120))]
(gdb) bt
#0  __timer_delete_new (timerid=0x0) at ../sysdeps/unix/sysv/linux/timer_delete.c:38
#1  0x000055e85cc197e6 in ncc_commit_confirmed () at /root/package/install/generic/resources/netopeer2/build/src/netconf_confirmed_commit.c:358
#2  0x000055e85cc19caa in ncc_changes_rollback_cb (sev=...) at /root/package/install/generic/resources/netopeer2/build/src/netconf_confirmed_commit.c:468
#3  0x000055e85cc1a40b in ncc_try_restore () at /root/package/install/generic/resources/netopeer2/build/src/netconf_confirmed_commit.c:662
#4  0x000055e85cc0b985 in server_init () at /root/package/install/generic/resources/netopeer2/build/src/main.c:697
#5  0x000055e85cc0e668 in main (argc=4, argv=0x7ffd8f3738c8) at /root/package/install/generic/resources/netopeer2/build/src/main.c:1409

In ncc_commit_confirmed() the function timer_delete() is called with parameter commit_ctx.timer but the whole commit_ctx structure is initialized with 0 on restart. There should be a check whether the timer is NULL.

BR, Peter

michalvasko commented 1 year ago

Fixed, thanks.

pfeige commented 1 year ago

Thanks!