-
Notifications
You must be signed in to change notification settings - Fork 84
Perhaps frr.log should be writable by frr itself #20
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
Open
aduitsis
wants to merge
1
commit into
sonic-net:master
Choose a base branch
from
aduitsis:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creating the frr.log with root as owner, prevents frr itself from writing to that file, in case we want to have frr write to its log directly instead of going though rsyslog.
marcosfsch
pushed a commit
to marcosfsch/sonic-frr
that referenced
this pull request
Jan 30, 2024
This commit ensures proper cleanup by deleting the gm_join_list when a PIM interface is deleted. The gm_join_list was previously not being freed, causing a memory leak. The ASan leak log for reference: ``` *********************************************************************************** Address Sanitizer Error detected in multicast_mld_join_topo1.test_multicast_mld_local_join/r1.asan.pim6d.28070 ================================================================= ==28070==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) sonic-net#1 0x56230373dd6b in qcalloc lib/memory.c:105 sonic-net#2 0x56230372180f in list_new lib/linklist.c:49 sonic-net#3 0x56230361b589 in pim_if_gm_join_add pimd/pim_iface.c:1313 sonic-net#4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 sonic-net#5 0x562303767280 in nb_callback_create lib/northbound.c:1235 sonic-net#6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 sonic-net#7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 sonic-net#8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 sonic-net#9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 sonic-net#10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 sonic-net#11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 sonic-net#12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 sonic-net#13 0x5623036c5f1b in cmd_execute_command lib/command.c:1053 sonic-net#14 0x5623036c6392 in cmd_execute lib/command.c:1221 sonic-net#15 0x5623037e75da in vty_command lib/vty.c:591 sonic-net#16 0x5623037e7a74 in vty_execute lib/vty.c:1354 sonic-net#17 0x5623037f0253 in vtysh_read lib/vty.c:2362 sonic-net#18 0x5623037db4e8 in event_call lib/event.c:1995 sonic-net#19 0x562303720f97 in frr_run lib/libfrr.c:1213 sonic-net#20 0x56230368615d in main pimd/pim6_main.c:184 sonic-net#21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) Indirect leak of 192 byte(s) in 4 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) sonic-net#1 0x56230373dd6b in qcalloc lib/memory.c:105 sonic-net#2 0x56230361b91d in gm_join_new pimd/pim_iface.c:1288 sonic-net#3 0x56230361b91d in pim_if_gm_join_add pimd/pim_iface.c:1326 sonic-net#4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 sonic-net#5 0x562303767280 in nb_callback_create lib/northbound.c:1235 sonic-net#6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 sonic-net#7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 sonic-net#8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 sonic-net#9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 sonic-net#10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 sonic-net#11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 sonic-net#12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 sonic-net#13 0x5623036c5f1b in cmd_execute_command lib/command.c:1053 sonic-net#14 0x5623036c6392 in cmd_execute lib/command.c:1221 sonic-net#15 0x5623037e75da in vty_command lib/vty.c:591 sonic-net#16 0x5623037e7a74 in vty_execute lib/vty.c:1354 sonic-net#17 0x5623037f0253 in vtysh_read lib/vty.c:2362 sonic-net#18 0x5623037db4e8 in event_call lib/event.c:1995 sonic-net#19 0x562303720f97 in frr_run lib/libfrr.c:1213 sonic-net#20 0x56230368615d in main pimd/pim6_main.c:184 sonic-net#21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) Indirect leak of 96 byte(s) in 4 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) sonic-net#1 0x56230373dd6b in qcalloc lib/memory.c:105 sonic-net#2 0x562303721651 in listnode_new lib/linklist.c:71 sonic-net#3 0x56230372182b in listnode_add lib/linklist.c:92 sonic-net#4 0x56230361ba9a in gm_join_new pimd/pim_iface.c:1295 sonic-net#5 0x56230361ba9a in pim_if_gm_join_add pimd/pim_iface.c:1326 sonic-net#6 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 sonic-net#7 0x562303767280 in nb_callback_create lib/northbound.c:1235 sonic-net#8 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 sonic-net#9 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 sonic-net#10 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 sonic-net#11 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 sonic-net#12 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 sonic-net#13 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 sonic-net#14 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 sonic-net#15 0x5623036c5f1b in cmd_execute_command lib/command.c:1053 sonic-net#16 0x5623036c6392 in cmd_execute lib/command.c:1221 sonic-net#17 0x5623037e75da in vty_command lib/vty.c:591 sonic-net#18 0x5623037e7a74 in vty_execute lib/vty.c:1354 sonic-net#19 0x5623037f0253 in vtysh_read lib/vty.c:2362 sonic-net#20 0x5623037db4e8 in event_call lib/event.c:1995 sonic-net#21 0x562303720f97 in frr_run lib/libfrr.c:1213 sonic-net#22 0x56230368615d in main pimd/pim6_main.c:184 sonic-net#23 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) Indirect leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) sonic-net#1 0x56230373dd6b in qcalloc lib/memory.c:105 sonic-net#2 0x56230361b91d in gm_join_new pimd/pim_iface.c:1288 sonic-net#3 0x56230361b91d in pim_if_gm_join_add pimd/pim_iface.c:1326 sonic-net#4 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 sonic-net#5 0x562303767280 in nb_callback_create lib/northbound.c:1235 sonic-net#6 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 sonic-net#7 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 sonic-net#8 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 sonic-net#9 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 sonic-net#10 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 sonic-net#11 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 sonic-net#12 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 sonic-net#13 0x5623036c5f6f in cmd_execute_command lib/command.c:1072 sonic-net#14 0x5623036c6392 in cmd_execute lib/command.c:1221 sonic-net#15 0x5623037e75da in vty_command lib/vty.c:591 sonic-net#16 0x5623037e7a74 in vty_execute lib/vty.c:1354 sonic-net#17 0x5623037f0253 in vtysh_read lib/vty.c:2362 sonic-net#18 0x5623037db4e8 in event_call lib/event.c:1995 sonic-net#19 0x562303720f97 in frr_run lib/libfrr.c:1213 sonic-net#20 0x56230368615d in main pimd/pim6_main.c:184 sonic-net#21 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) Indirect leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f3605dbfd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) sonic-net#1 0x56230373dd6b in qcalloc lib/memory.c:105 sonic-net#2 0x562303721651 in listnode_new lib/linklist.c:71 sonic-net#3 0x56230372182b in listnode_add lib/linklist.c:92 sonic-net#4 0x56230361ba9a in gm_join_new pimd/pim_iface.c:1295 sonic-net#5 0x56230361ba9a in pim_if_gm_join_add pimd/pim_iface.c:1326 sonic-net#6 0x562303642247 in lib_interface_gmp_address_family_static_group_create pimd/pim_nb_config.c:2868 sonic-net#7 0x562303767280 in nb_callback_create lib/northbound.c:1235 sonic-net#8 0x562303767280 in nb_callback_configuration lib/northbound.c:1579 sonic-net#9 0x562303768a1d in nb_transaction_process lib/northbound.c:1710 sonic-net#10 0x56230376904a in nb_candidate_commit_apply lib/northbound.c:1104 sonic-net#11 0x5623037692ba in nb_candidate_commit lib/northbound.c:1137 sonic-net#12 0x562303769dec in nb_cli_classic_commit lib/northbound_cli.c:49 sonic-net#13 0x56230376fb79 in nb_cli_pending_commit_check lib/northbound_cli.c:88 sonic-net#14 0x5623036c5bcb in cmd_execute_command_real lib/command.c:991 sonic-net#15 0x5623036c5f6f in cmd_execute_command lib/command.c:1072 sonic-net#16 0x5623036c6392 in cmd_execute lib/command.c:1221 sonic-net#17 0x5623037e75da in vty_command lib/vty.c:591 sonic-net#18 0x5623037e7a74 in vty_execute lib/vty.c:1354 sonic-net#19 0x5623037f0253 in vtysh_read lib/vty.c:2362 sonic-net#20 0x5623037db4e8 in event_call lib/event.c:1995 sonic-net#21 0x562303720f97 in frr_run lib/libfrr.c:1213 sonic-net#22 0x56230368615d in main pimd/pim6_main.c:184 sonic-net#23 0x7f360461bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) SUMMARY: AddressSanitizer: 400 byte(s) leaked in 11 allocation(s). *********************************************************************************** ``` Signed-off-by: Keelan Cannoo <[email protected]>
eddieruan-alibaba
pushed a commit
to eddieruan-alibaba/sonic-frr
that referenced
this pull request
Mar 11, 2025
The following ASAN error can be seen. > ERROR: AddressSanitizer: attempting to call malloc_usable_size() for pointer which is not owned: 0x608000036c20 > #0 0x7f3d7a4b5425 in __interceptor_malloc_usable_size ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:198 > sonic-net#1 0x7f3d7a426a16 in __sanitizer::BufferedStackTrace::Unwind(unsigned long, unsigned long, void*, bool, unsigned int) ../../../../src/libsanitizer/sanitizer_common > /sanitizer_stacktrace.h:122 > sonic-net#2 0x7f3d7a426a16 in __asan::asan_malloc_usable_size(void const*, unsigned long, unsigned long) ../../../../src/libsanitizer/asan/asan_allocator.cpp:1074 > sonic-net#3 0x7f3d7a03f330 in mt_count_free lib/memory.c:78 > sonic-net#4 0x7f3d7a03f330 in qfree lib/memory.c:130 > sonic-net#5 0x7f3d76ccf89b in bmp_peer_status_changed bgpd/bgp_bmp.c:982 > sonic-net#6 0x560ae2aa6a94 in hook_call_peer_status_changed bgpd/bgp_fsm.c:47 > sonic-net#7 0x560ae2aa6a94 in bgp_fsm_change_status bgpd/bgp_fsm.c:1287 > sonic-net#8 0x560ae2c4f2e5 in peer_delete bgpd/bgpd.c:2777 > sonic-net#9 0x560ae2c58d24 in bgp_delete bgpd/bgpd.c:4140 > sonic-net#10 0x560ae2bbb47e in no_router_bgp bgpd/bgp_vty.c:1764 > sonic-net#11 0x7f3d79fb74ed in cmd_execute_command_real lib/command.c:1003 > sonic-net#12 0x7f3d79fb78a3 in cmd_execute_command lib/command.c:1062 > sonic-net#13 0x7f3d79fb7e03 in cmd_execute lib/command.c:1228 > sonic-net#14 0x7f3d7a107b53 in vty_command lib/vty.c:625 > sonic-net#15 0x7f3d7a109902 in vty_execute lib/vty.c:1388 > sonic-net#16 0x7f3d7a10cc32 in vtysh_read lib/vty.c:2400 > sonic-net#17 0x7f3d7a0f848b in event_call lib/event.c:2019 > sonic-net#18 0x7f3d7a01e627 in frr_run lib/libfrr.c:1232 > sonic-net#19 0x560ae29e0037 in main bgpd/bgp_main.c:555 > sonic-net#20 0x7f3d79a29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 > sonic-net#21 0x7f3d79a29e3f in __libc_start_main_impl ../csu/libc-start.c:392 > sonic-net#22 0x560ae29e4ef4 in _start (/usr/lib/frr/bgpd+0x2eeef4) > > 0x608000036c20 is located 0 bytes inside of 81-byte region [0x608000036c20,0x608000036c71) > freed by thread T0 here: > #0 0x7f3d7a4b4537 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 > sonic-net#1 0x7f3d76ccf85f in bmp_peer_status_changed bgpd/bgp_bmp.c:981 > sonic-net#2 0x560ae2aa6a94 in hook_call_peer_status_changed bgpd/bgp_fsm.c:47 > sonic-net#3 0x560ae2aa6a94 in bgp_fsm_change_status bgpd/bgp_fsm.c:1287 > sonic-net#4 0x560ae2c4f2e5 in peer_delete bgpd/bgpd.c:2777 > sonic-net#5 0x560ae2c58d24 in bgp_delete bgpd/bgpd.c:4140 > sonic-net#6 0x560ae2bbb47e in no_router_bgp bgpd/bgp_vty.c:1764 > sonic-net#7 0x7f3d79fb74ed in cmd_execute_command_real lib/command.c:1003 > sonic-net#8 0x7f3d79fb78a3 in cmd_execute_command lib/command.c:1062 > sonic-net#9 0x7f3d79fb7e03 in cmd_execute lib/command.c:1228 > sonic-net#10 0x7f3d7a107b53 in vty_command lib/vty.c:625 > sonic-net#11 0x7f3d7a109902 in vty_execute lib/vty.c:1388 > sonic-net#12 0x7f3d7a10cc32 in vtysh_read lib/vty.c:2400 > sonic-net#13 0x7f3d7a0f848b in event_call lib/event.c:2019 > sonic-net#14 0x7f3d7a01e627 in frr_run lib/libfrr.c:1232 > sonic-net#15 0x560ae29e0037 in main bgpd/bgp_main.c:555 > sonic-net#16 0x7f3d79a29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 > > previously allocated by thread T0 here: > #0 0x7f3d7a4b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 > sonic-net#1 0x7f3d7a03f0e9 in qmalloc lib/memory.c:101 > sonic-net#2 0x7f3d76cd0166 in bmp_bgp_peer_vrf bgpd/bgp_bmp.c:2194 > sonic-net#3 0x7f3d76cd0166 in bmp_bgp_update_vrf_status bgpd/bgp_bmp.c:2236 > sonic-net#4 0x7f3d76cd29b8 in bmp_vrf_state_changed bgpd/bgp_bmp.c:3479 > sonic-net#5 0x560ae2c45b34 in hook_call_bgp_instance_state bgpd/bgpd.c:88 > sonic-net#6 0x560ae2c4d158 in bgp_instance_up bgpd/bgpd.c:3936 > sonic-net#7 0x560ae29e5ed1 in bgp_vrf_enable bgpd/bgp_main.c:299 > sonic-net#8 0x7f3d7a0ff8b1 in vrf_enable lib/vrf.c:286 > sonic-net#9 0x7f3d7a0ff8b1 in vrf_enable lib/vrf.c:275 > sonic-net#10 0x7f3d7a12ab66 in zclient_vrf_add lib/zclient.c:2561 > sonic-net#11 0x7f3d7a12eb43 in zclient_read lib/zclient.c:4624 > sonic-net#12 0x7f3d7a0f848b in event_call lib/event.c:2019 > sonic-net#13 0x7f3d7a01e627 in frr_run lib/libfrr.c:1232 > sonic-net#14 0x560ae29e0037 in main bgpd/bgp_main.c:555 > sonic-net#15 0x7f3d79a29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Signed-off-by: Philippe Guibert <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Creating the frr.log with root as owner, prevents frr itself from writing to that file, in case we want to have frr write to its log directly instead of going though rsyslog.