Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[p4orch] Fix handlePortStatusChangeNotification status deserialize #2272

Open
wants to merge 4 commits into
base: 202111
Choose a base branch
from

Conversation

bratashX
Copy link
Contributor

It's cherry-pick PR from master branch: #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

@bratashX bratashX requested a review from prsunny as a code owner May 13, 2022 14:42
@bratashX bratashX force-pushed the 202111_fix-double-free-p4orch branch 2 times, most recently from 35d8d7c to 9d6ad34 Compare May 19, 2022 07:24
@bratashX bratashX force-pushed the 202111_fix-double-free-p4orch branch from 9d6ad34 to 879a554 Compare June 6, 2022 08:51
vboykox and others added 4 commits June 6, 2022 02:22
…onic-net#2111)

*Moved sai_deserialize_free_port_oper_status_ntf(count, port_oper_status); call outside the loop iterating port_oper_status array.

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
@bratashX
Copy link
Contributor Author

bratashX commented Aug 9, 2022

/easycla

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 9, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants