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

[tlm_teamd]: Fix segfault, when retrying to do teamd_connect() again #1490

Merged
merged 1 commit into from
Nov 1, 2020

Conversation

pavel-shirshov
Copy link
Contributor

@pavel-shirshov pavel-shirshov commented Oct 30, 2020

Fixes: sonic-net/sonic-buildimage#5755
Fixes: sonic-net/sonic-buildimage#5433

What I did
Make the destination for std::transform() to use std::back_inserter() for allocating new space for the copied objects

Why I did it
To fix a bug which causes a segfault.

How I verified it

  • Manually
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel0040      
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel00E0
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel00EB
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel00EC
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel00E5
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel00E6
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel00E6
7admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel00E7
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel0057
admin@str-s6100-acs-1:~$ sudo config portchannel add PortChannel0057
admin@str-s6100-acs-1:~$ ls -la /var/core
total 8
drwxr-xr-x 1 root root 4096 Oct 31 01:20 .
drwxr-xr-x 1 root root 4096 Oct 30 20:28 ..

syslog

admin@str-s6100-acs-1:~$ sudo tail -F /var/log/syslog | grep tlm_
Oct 31 01:23:21.152456 str-s6100-acs-1 NOTICE teamd#tlm_teamd: :- try_add_lag: The LAG 'PortChannel00E0' has been added.
Oct 31 01:23:24.136100 str-s6100-acs-1 NOTICE teamd#tlm_teamd: :- try_add_lag: The LAG 'PortChannel00EB' has been added.
Oct 31 01:23:25.226382 str-s6100-acs-1 NOTICE teamd#tlm_teamd: :- try_add_lag: The LAG 'PortChannel00EC' has been added.
Oct 31 01:23:31.052312 str-s6100-acs-1 NOTICE teamd#tlm_teamd: :- try_add_lag: The LAG 'PortChannel00E5' has been added.
Oct 31 01:23:34.061052 str-s6100-acs-1 NOTICE teamd#tlm_teamd: :- try_add_lag: The LAG 'PortChannel00E6' has been added.
Oct 31 01:23:40.294726 str-s6100-acs-1 NOTICE teamd#tlm_teamd: :- try_add_lag: The LAG 'PortChannel00E7' has been added.
Oct 31 01:23:52.171978 str-s6100-acs-1 NOTICE teamd#tlm_teamd: :- try_add_lag: The LAG 'PortChannel0057' has been added.
  • It is better to cover tlm_teamd with tests. This is ToDo: for the future.

Details if related

…ack_inserter() for allocating new space for the copied objects
@pavel-shirshov
Copy link
Contributor Author

retest this please

@pavel-shirshov pavel-shirshov marked this pull request as ready for review October 31, 2020 01:37
@lguohan
Copy link
Contributor

lguohan commented Nov 1, 2020

the test failure is not related to this pr.

@lguohan lguohan merged commit d7643f2 into sonic-net:master Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants