sonic-swss
sonic-swss copied to clipboard
[p4orch] Fix handlePortStatusChangeNotification status deserialize
It's cherry-pick PR from master branch: https://github.com/Azure/sonic-swss/pull/2111
What I did Moved sai_deserialize_free_port_oper_status_ntf(count, port_oper_status); call outside the loop iterating port_oper_status array.
Why I did it Calling sai_deserialize_free_port_oper_status_ntf(count, port_oper_status); in loop causes double-free.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007f66568ed7bb in raise () from /lib/x86_64-linux-gnu/libc.so.6
[Current thread is 1 (Thread 0x7f6656507bc0 (LWP 39))]
(gdb) bt
#0 0x00007f66568ed7bb in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f66568d8535 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f665692f508 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007f6656935c1a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007f66569376fd in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007f665721ab4d in sai_deserialize_free_port_oper_status_ntf(unsigned int, _sai_port_oper_status_notification_t*) ()
from /usr/lib/x86_64-linux-gnu/libsaimeta.so.0
#6 0x000055c90aec135c in P4Orch::handlePortStatusChangeNotification (this=0x55c90bbc1320, op=..., data=...) at p4orch/p4orch.cpp:175
#7 0x000055c90aec1b6e in P4Orch::doTask (this=0x55c90bbc1320, consumer=...) at p4orch/p4orch.cpp:196
#8 0x000055c90acaac77 in OrchDaemon::start (this=this@entry=0x55c90bad3b70) at orchdaemon.cpp:700
#9 0x000055c90ac5c2f1 in main (argc=<optimized out>, argv=<optimized out>) at main.cpp:692
/easycla
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: vboykox / name: Volodymyr Boiko (879a554917e837af5b5cc40ca2d45db7a12e6090)
- :white_check_mark: login: bratashX / name: Petro Bratash (80e66b940421a2a1a4b407f920c63ce3f329b65e, 9e61d62999e9a31389109cfe9d09535411b73d6d, c937bf46f29fc1fc9561482d4e1f57010b01b205)