You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each call to fib_table_entry_path_add2 expects that it will own the label stack that is passed to it. This was done so there is no need to copy the stack. If an application (like SR) wants to use the same set of labels for more than one prefix, it should allocate/duplicate the label stack. Or if that application wants to keep a copy of the label stack, it must pass FIB a copy.
In this function,path.frp_label_stack alloc only one memory, but be used many times with 'fib_table_entry_path_add2 '. When we delete ,'fib_path_ext_list_remove ' would bw call many times, then repeated memory release,and can't be detected.
#18 0x00007ffff78e7662 in vlib_process_startup (vm=0x7ffff688012e <vec_aligned_header_bytes+54>, p=0x7fffb5875a80,
f=0x6068e5e444211f00) at /home/git_pull_vpp/vpp/build-data/../src/vlib/main.c:1253
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Through the following debug functions, print the small memory cache, We can see that the same offset has been stored 2 times , It is also verified that the memory is repeatedly released.
Description
Hi Xyxue,
Each call to fib_table_entry_path_add2 expects that it will own the label stack that is passed to it. This was done so there is no need to copy the stack. If an application (like SR) wants to use the same set of labels for more than one prefix, it should allocate/duplicate the label stack. Or if that application wants to keep a copy of the label stack, it must pass FIB a copy.
Regards,
neale
From: <[email protected]
> on behalf of 薛欣颖 <[email protected]
>
Date: Thursday, 21 December 2017 at 13:15
To: "[email protected]
" <[email protected]
>
Subject: [vpp-dev] the mheap small cache release more than once
Hi guys,
I'm testing the sr mpls, and there is a small cache release more than once. How should we avoid this ? My debug info is shown below:
create_sl (mpls_sr_policy_t ** sr_policy, mpls_label_t ** sl, u32 weight)
{
mpls_sr_main_t *sm = &sr_mpls_main;
mpls_sr_sl_t *segment_list;
pool_get (sm->sid_lists, segment_list);
memset (segment_list, 0, sizeof (*segment_list));
vec_add1 (sr_policy->segments_lists, segment_list
sm>sid_lists);/** Fill in segment list **/
segment_list->weight =
(weight != (u32) ~ 0 ? weight : SR_SEGMENT_LIST_WEIGHT_DEFAULT);
segment_list->segments = vec_dup (sl);
fib_route_path_t path = {
.frp_proto = DPO_PROTO_MPLS,
.frp_sw_if_index = ~0,
.frp_fib_index = 0,
.frp_weight = segment_list->weight,
.frp_flags = FIB_ROUTE_PATH_FLAG_NONE,
.frp_label_stack = NULL,
.frp_local_label = sl[0],
};
vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
fib_route_path_t *paths = NULL;
vec_add1 (paths, path);
mpls_eos_bit_t eos;
FOR_EACH_MPLS_EOS_BIT (eos)
{
/* INDENT-OFF */
fib_prefix_t
pfx = {
.fp_len = 21,
.fp_proto = FIB_PROTOCOL_MPLS,
.fp_label = sr_policy->bsid,
.fp_eos = eos,
.fp_payload_proto = DPO_PROTO_MPLS,
};
/* INDENT-ON */
fib_table_entry_path_add2 (0,
&pfx,
FIB_SOURCE_SR,
(sr_policy->type == SR_POLICY_TYPE_DEFAULT ?
FIB_ENTRY_FLAG_NONE :
FIB_ENTRY_FLAG_MULTICAST), paths);
}
vec_free (paths);
return segment_list;
}
In this function,path.frp_label_stack alloc only one memory, but be used many times with 'fib_table_entry_path_add2 '. When we delete ,'fib_path_ext_list_remove ' would bw call many times, then repeated memory release,and can't be detected.
void
fib_path_ext_list_remove (fib_path_ext_list_t *list,
fib_path_ext_type_t ext_type,
const fib_route_path_t *rpath)
{
fib_path_ext_t *path_ext;
path_ext = fib_path_ext_list_find(list, ext_type, rpath);
if (NULL != path_ext)
{
/*
* delete the element moving the remaining elements down 1 position.
* this preserves the sorted order.
*/
vec_free(path_ext->fpe_label_stack);
vec_delete(list->fpel_exts, 1, (path_ext
list>fpel_exts));}
}
Actual operation situation:
DBGvpp# sr mpls policy add bsid 999 next 202 next 203 next 204
Thread 1 "vpp_main" hit Breakpoint 2, create_sl (sr_policy=0x7fffb5e47264, sl=0x7fffb5589064, weight=4294967295)
at /home/git_pull_vpp/vpp/build-data/../src/vnet/srmpls/sr_mpls_policy.c:64
64 {
(gdb) n
65 mpls_sr_main_t *sm = &sr_mpls_main;
(gdb)
68 pool_get (sm->sid_lists, segment_list);
(gdb)
69 memset (segment_list, 0, sizeof (*segment_list));
(gdb)
71 vec_add1 (sr_policy->segments_lists, segment_list
sm>sid_lists);(gdb)
75 (weight != (u32) ~ 0 ? weight : SR_SEGMENT_LIST_WEIGHT_DEFAULT);
(gdb)
74 segment_list->weight =
(gdb)
76 segment_list->segments = vec_dup (sl);
(gdb)
78 fib_route_path_t path = {
(gdb)
85 .frp_local_label = sl[0],
(gdb)
78 fib_route_path_t path = {
(gdb)
82 .frp_weight = segment_list->weight,
(gdb)
78 fib_route_path_t path = {
(gdb)
88 vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
(gdb)
90 fib_route_path_t *paths = NULL;
(gdb) set pr pr
(gdb) p paths
$1 = (fib_route_path_t *) 0x0
(gdb) n
91 vec_add1 (paths, path);
(gdb) n
94 FOR_EACH_MPLS_EOS_BIT (eos)
(gdb) p *paths
$2 = {
frp_proto = DPO_PROTO_MPLS,
{
{
{
frp_addr = {
{
pad = {202, 0, 0},
ip4 = {
data = "\000\000\000",
data_u32 = 0,
as_u8 = "\000\000\000",
as_u16 = {0, 0},
as_u32 = 0
}
},
ip6 = {
as_u8 = "\312", '\000' <repeats 14 times>,
as_u16 = {202, 0, 0, 0, 0, 0, 0, 0},
as_u32 = {202, 0, 0, 0},
as_u64 = {202, 0},
as_uword = {202, 0}
},
as_u8 = "\312", '\000' <repeats 14 times>,
as_u64 = {202, 0}
},
{
frp_local_label = 202,
frp_eos = MPLS_NON_EOS
}
},
{
frp_sw_if_index = 4294967295,
frp_rpf_id = 4294967295
},
{
--
Type to continue, or q to quit--frp_fib_index = 0,
frp_bier_fib_index = 0
},
frp_label_stack = 0x7fffb5665c84
},
frp_bier_tbl = {
bti_set = 202,
bti_sub_domain = 0,
bti_ecmp = 0,
bti_hdr_len = BIER_HDR_LEN_64,
bti_type = BIER_TABLE_MPLS_SPF
},
frp_bier_imp = 202,
frp_udp_encap_id = 202,
frp_bier_fmask = 202
},
frp_weight = 1 '\001',
frp_preference = 0 '\000',
frp_flags = FIB_ROUTE_PATH_FLAG_NONE
}
DBGvpp# sr mpls policy del bsid 999 next 202 next 203 next 204
Thread 1 "vpp_main" hit Breakpoint 1, fib_path_ext_list_remove (list=0x7fffb5e4c658, ext_type=FIB_PATH_EXT_MPLS,
rpath=0x7fffb5e471ac) at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_path_ext.c:394
394 {
(gdb) n
397 path_ext = fib_path_ext_list_find(list, ext_type, rpath);
(gdb)
399 if (NULL != path_ext)
(gdb)
405 vec_free(path_ext->fpe_label_stack);
(gdb) p path_ext->fpe_label_stack
There is no member named fpe_label_stack.
(gdb) p *path_ext
$4 = {
fpe_path = {
frp_proto = DPO_PROTO_MPLS,
{
{
{
frp_addr = {
{
pad = {202, 0, 0},
ip4 = {
data = "\000\000\000",
data_u32 = 0,
as_u8 = "\000\000\000",
as_u16 = {0, 0},
as_u32 = 0
}
},
ip6 = {
as_u8 = "\312", '\000' <repeats 14 times>,
as_u16 = {202, 0, 0, 0, 0, 0, 0, 0},
as_u32 = {202, 0, 0, 0},
as_u64 = {202, 0},
as_uword = {202, 0}
},
as_u8 = "\312", '\000' <repeats 14 times>,
as_u64 = {202, 0}
},
{
frp_local_label = 202,
frp_eos = MPLS_NON_EOS
}
},
{
frp_sw_if_index = 4294967295,
frp_rpf_id = 4294967295
},
--
Type to continue, or q to quit--{
frp_fib_index = 0,
frp_bier_fib_index = 0
},
frp_label_stack = 0x7fffb5665c84
},
frp_bier_tbl = {
bti_set = 202,
bti_sub_domain = 0,
bti_ecmp = 0,
bti_hdr_len = BIER_HDR_LEN_64,
bti_type = BIER_TABLE_MPLS_SPF
},
frp_bier_imp = 202,
frp_udp_encap_id = 202,
frp_bier_fmask = 202
},
frp_weight = 1 '\001',
frp_preference = 0 '\000',
frp_flags = FIB_ROUTE_PATH_FLAG_NONE
},
{
fpe_adj_flags = FIB_PATH_EXT_ADJ_FLAG_NONE
},
fpe_type = FIB_PATH_EXT_MPLS,
fpe_path_index = 17
}
(gdb) b mheap_put
Breakpoint 3 at 0x7ffff6845bc0: file /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mheap.c, line 756.
(gdb) c
Continuing.
Thread 1 "vpp_main" hit Breakpoint 3, mheap_put (v=0x7fffb5476000, uoffset=2030720) //first release
at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mheap.c:756
756 {
(gdb) bt
#0 mheap_put (v=0x7fffb5476000, uoffset=2030720) at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mheap.c:756
#1 0x00007ffff73be5dd in clib_mem_free (p=0x7fffb5665c80) at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mem.h:186
#2 0x00007ffff73bf57e in fib_path_ext_list_remove (list=0x7fffb5e4c658, ext_type=FIB_PATH_EXT_MPLS, rpath=0x7fffb5e471ac)
at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_path_ext.c:405
#3 0x00007ffff73a59ae in fib_entry_src_api_path_remove (src=0x7fffb5e4c658, pl_flags=FIB_PATH_LIST_FLAG_NONE,
rpaths=0x7fffb5e471ac) at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_entry_src_api.c:121
#4 0x00007ffff73a2e19 in fib_entry_src_action_path_remove (fib_entry=0x7fffb5e46f98, source=FIB_SOURCE_SR,
rpath=0x7fffb5e471ac) at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_entry_src.c:1241
#5 0x00007ffff739e9c5 in fib_entry_path_remove (fib_entry_index=13, source=FIB_SOURCE_SR, rpath=0x7fffb5e471ac)
at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_entry.c:918
#6 0x00007ffff738a0d5 in fib_table_entry_path_remove2 (fib_index=0, prefix=0x7fffb5e629d0, source=FIB_SOURCE_SR,
rpath=0x7fffb5e471ac) at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_table.c:635
#7 0x00007ffff7193824 in sr_mpls_policy_del (bsid=999)
at /home/git_pull_vpp/vpp/build-data/../src/vnet/srmpls/sr_mpls_policy.c:233
#8 0x00007ffff71953c4 in sr_mpls_policy_command_fn (vm=0x7ffff7b89480 <vlib_global_main>, input=0x7fffb5e62ef0,
cmd=0x7fffb5e32db8) at /home/git_pull_vpp/vpp/build-data/../src/vnet/srmpls/sr_mpls_policy.c:493
#9 0x00007ffff78b30ed in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b89480 <vlib_global_main>,
cm=0x7ffff7b89660 <vlib_global_main+480>, input=0x7fffb5e62ef0, parent_command_index=137)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/cli.c:588
#10 0x00007ffff78b2ffb in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b89480 <vlib_global_main>,
cm=0x7ffff7b89660 <vlib_global_main+480>, input=0x7fffb5e62ef0, parent_command_index=138)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/cli.c:566
#11 0x00007ffff78b2ffb in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b89480 <vlib_global_main>,
cm=0x7ffff7b89660 <vlib_global_main+480>, input=0x7fffb5e62ef0, parent_command_index=0)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/cli.c:566
#12 0x00007ffff78b33d2 in vlib_cli_input (vm=0x7ffff7b89480 <vlib_global_main>, input=0x7fffb5e62ef0,
function=0x7ffff794289b <unix_vlib_cli_output>, function_arg=0)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/cli.c:662
#13 0x00007ffff7948059 in unix_cli_process_input (cm=0x7ffff7b892e0 <unix_cli_main>, cli_file_index=0)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/unix/cli.c:2308
#14 0x00007ffff7948bb7 in unix_cli_process (vm=0x7ffff7b89480 <vlib_global_main>, rt=0x7fffb5e52000, f=0x0)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/unix/cli.c:2420
#15 0x00007ffff78e7537 in vlib_process_bootstrap (_a=140736238934640)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/main.c:1231
#16 0x00007ffff682cdc4 in clib_calljmp () at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/longjmp.S:110
#17 0x00007fffb5875a40 in ?? ()
--
Type to continue, or q to quit--#18 0x00007ffff78e7662 in vlib_process_startup (vm=0x7ffff688012e <vec_aligned_header_bytes+54>, p=0x7fffb5875a80,
f=0x6068e5e444211f00) at /home/git_pull_vpp/vpp/build-data/../src/vlib/main.c:1253
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) n
763 cpu_times[0] = clib_cpu_time_now ();
(gdb)
765 h = mheap_header (v);
(gdb)
767 mheap_maybe_lock (v);
(gdb)
769 if (h->flags & MHEAP_FLAG_VALIDATE)
(gdb)
772 ASSERT (h->n_elts > 0);
(gdb)
773 h->n_elts--;
(gdb)
774 h->stats.n_puts += 1;
(gdb)
776 e = mheap_elt_at_uoffset (v, uoffset);
(gdb)
777 n = mheap_next_elt (e);
(gdb)
778 n_user_data_bytes = mheap_elt_data_bytes (e);
(gdb)
780 trace_uoffset = uoffset;
(gdb)
781 trace_n_user_data_bytes = n_user_data_bytes;
(gdb)
783 bin = user_data_size_to_bin_index (n_user_data_bytes);
(gdb)
784 if (MHEAP_HAVE_SMALL_OBJECT_CACHE
(gdb) p bin
$5 = 1
(gdb) n
785 && bin < 255 && (h->flags & MHEAP_FLAG_SMALL_OBJECT_CACHE))
(gdb)
787 uoffset = mheap_put_small_object (h, bin, uoffset);
(gdb)
788 if (uoffset == 0)
(gdb) p uoffset
$6 = 0
(gdb) info b
Num Type Disp Enb Address What
1 breakpoint keep y 0x00007ffff73bf521 in fib_path_ext_list_remove
at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_path_ext.c:394
breakpoint already hit 1 time
2 breakpoint keep y
breakpoint already hit 1 time
2.1 y 0x00007ffff716a51c in create_sl
at /home/git_pull_vpp/vpp/build-data/../src/vnet/srv6/sr_policy_rewrite.c:295
2.2 y 0x00007ffff71928ea in create_sl
at /home/git_pull_vpp/vpp/build-data/../src/vnet/srmpls/sr_mpls_policy.c:64
3 breakpoint keep y 0x00007ffff6845bc0 in mheap_put
at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mheap.c:756
breakpoint already hit 1 time
(gdb) d 3
(gdb) b mheap_put if (uoffset == 2030720)
Breakpoint 4 at 0x7ffff6845bc0: file /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mheap.c, line 756.
(gdb) c
Continuing.
Thread 1 "vpp_main" hit Breakpoint 1, fib_path_ext_list_remove (list=0x7fffb5e466d4, ext_type=FIB_PATH_EXT_MPLS,
rpath=0x7fffb5e471ac) at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_path_ext.c:394
394 {
(gdb) n
397 path_ext = fib_path_ext_list_find(list, ext_type, rpath);
(gdb)
399 if (NULL != path_ext)
(gdb) p *path_e
path_elem path_ext
(gdb) p *path_ext
$7 = {
fpe_path = {
frp_proto = DPO_PROTO_MPLS,
{
{
{
frp_addr = {
{
pad = {202, 0, 0},
ip4 = {
data = "\000\000\000",
data_u32 = 0,
as_u8 = "\000\000\000",
as_u16 = {0, 0},
as_u32 = 0
}
},
ip6 = {
as_u8 = "\312", '\000' <repeats 14 times>,
as_u16 = {202, 0, 0, 0, 0, 0, 0, 0},
as_u32 = {202, 0, 0, 0},
as_u64 = {202, 0},
as_uword = {202, 0}
},
as_u8 = "\312", '\000' <repeats 14 times>,
as_u64 = {202, 0}
},
{
frp_local_label = 202,
frp_eos = MPLS_NON_EOS
}
},
{
frp_sw_if_index = 4294967295,
frp_rpf_id = 4294967295
},
--
Type to continue, or q to quit--{
frp_fib_index = 0,
frp_bier_fib_index = 0
},
frp_label_stack = 0x7fffb5665c84
},
frp_bier_tbl = {
bti_set = 202,
bti_sub_domain = 0,
bti_ecmp = 0,
bti_hdr_len = BIER_HDR_LEN_64,
bti_type = BIER_TABLE_MPLS_SPF
},
frp_bier_imp = 202,
frp_udp_encap_id = 202,
frp_bier_fmask = 202
},
frp_weight = 1 '\001',
frp_preference = 0 '\000',
frp_flags = FIB_ROUTE_PATH_FLAG_NONE
},
{
fpe_adj_flags = FIB_PATH_EXT_ADJ_FLAG_NONE
},
fpe_type = FIB_PATH_EXT_MPLS,
fpe_path_index = 17
}
(gdb) c
Continuing.
Thread 1 "vpp_main" hit Breakpoint 4, mheap_put (v=0x7fffb5476000, uoffset=2030720)
at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mheap.c:756
756 {
(gdb) bt
#0 mheap_put (v=0x7fffb5476000, uoffset=2030720) at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mheap.c:756 //second release
#1 0x00007ffff73be5dd in clib_mem_free (p=0x7fffb5665c80) at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/mem.h:186
#2 0x00007ffff73bf57e in fib_path_ext_list_remove (list=0x7fffb5e466d4, ext_type=FIB_PATH_EXT_MPLS, rpath=0x7fffb5e471ac)
at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_path_ext.c:405
#3 0x00007ffff73a59ae in fib_entry_src_api_path_remove (src=0x7fffb5e466d4, pl_flags=FIB_PATH_LIST_FLAG_NONE,
rpaths=0x7fffb5e471ac) at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_entry_src_api.c:121
#4 0x00007ffff73a2e19 in fib_entry_src_action_path_remove (fib_entry=0x7fffb5e47028, source=FIB_SOURCE_SR,
rpath=0x7fffb5e471ac) at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_entry_src.c:1241
#5 0x00007ffff739e9c5 in fib_entry_path_remove (fib_entry_index=15, source=FIB_SOURCE_SR, rpath=0x7fffb5e471ac)
at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_entry.c:918
#6 0x00007ffff738a0d5 in fib_table_entry_path_remove2 (fib_index=0, prefix=0x7fffb5e629d0, source=FIB_SOURCE_SR,
rpath=0x7fffb5e471ac) at /home/git_pull_vpp/vpp/build-data/../src/vnet/fib/fib_table.c:635
#7 0x00007ffff7193824 in sr_mpls_policy_del (bsid=999)
at /home/git_pull_vpp/vpp/build-data/../src/vnet/srmpls/sr_mpls_policy.c:233
#8 0x00007ffff71953c4 in sr_mpls_policy_command_fn (vm=0x7ffff7b89480 <vlib_global_main>, input=0x7fffb5e62ef0,
cmd=0x7fffb5e32db8) at /home/git_pull_vpp/vpp/build-data/../src/vnet/srmpls/sr_mpls_policy.c:493
#9 0x00007ffff78b30ed in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b89480 <vlib_global_main>,
cm=0x7ffff7b89660 <vlib_global_main+480>, input=0x7fffb5e62ef0, parent_command_index=137)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/cli.c:588
#10 0x00007ffff78b2ffb in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b89480 <vlib_global_main>,
cm=0x7ffff7b89660 <vlib_global_main+480>, input=0x7fffb5e62ef0, parent_command_index=138)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/cli.c:566
#11 0x00007ffff78b2ffb in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b89480 <vlib_global_main>,
cm=0x7ffff7b89660 <vlib_global_main+480>, input=0x7fffb5e62ef0, parent_command_index=0)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/cli.c:566
#12 0x00007ffff78b33d2 in vlib_cli_input (vm=0x7ffff7b89480 <vlib_global_main>, input=0x7fffb5e62ef0,
function=0x7ffff794289b <unix_vlib_cli_output>, function_arg=0)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/cli.c:662
#13 0x00007ffff7948059 in unix_cli_process_input (cm=0x7ffff7b892e0 <unix_cli_main>, cli_file_index=0)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/unix/cli.c:2308
#14 0x00007ffff7948bb7 in unix_cli_process (vm=0x7ffff7b89480 <vlib_global_main>, rt=0x7fffb5e52000, f=0x0)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/unix/cli.c:2420
#15 0x00007ffff78e7537 in vlib_process_bootstrap (_a=140736238934640)
at /home/git_pull_vpp/vpp/build-data/../src/vlib/main.c:1231
#16 0x00007ffff682cdc4 in clib_calljmp () at /home/git_pull_vpp/vpp/build-data/../src/vppinfra/longjmp.S:110
#17 0x00007fffb5875a40 in ?? ()
--
Type to continue, or q to quit--#18 0x00007ffff78e7662 in vlib_process_startup (vm=0x7ffff688012e <vec_aligned_header_bytes+54>, p=0x7fffb5875a80,
f=0x6068e5e444211f00) at /home/git_pull_vpp/vpp/build-data/../src/vlib/main.c:1253
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Through the following debug functions, print the small memory cache, We can see that the same offset has been stored 2 times , It is also verified that the memory is repeatedly released.
void mheap_small_cache(void *v)
{
mheap_t *h = mheap_header (v);
uword i = 0;
#define CHECK
if (!
) { mheap_validate_breakpoint (); os_panic (); }
for (i = 0; i < ARRAY_LEN (h->small_object_cache.bins.as_u8); i++)
{
if (h->small_object_cache.bins.as_u8[i] != 0)
{
mheap_elt_t *e;
uword b = h->small_object_cache.bins.as_u8[i] - 1;
uword o = h->small_object_cache.offsets[i];
uword s;
e = mheap_elt_at_uoffset (v, o);
s = mheap_elt_data_bytes (e);
printf ("i = %8d, bin =%8d, offset = %8d, data_len = %8d, ptr = %p.\n",
(int)i, (int)b, (int)o, (int)s, e);
}
}
}
/*
* fd.io coding-style-patch-verification: ON
(gdb) call mheap_small_cache (clib_mem_get_heap ())
i = 0, bin = 5, offset = 10059896, data_len = 28, ptr = 0x7fffb5e0e070.
i = 1, bin = 5, offset = 10294812, data_len = 28, ptr = 0x7fffb5e47614.
i = 2, bin = 7, offset = 10295924, data_len = 36, ptr = 0x7fffb5e47a6c.
i = 3, bin = 3, offset = 9642216, data_len = 20, ptr = 0x7fffb5da80e0.
i = 4, bin = 3, offset = 10196536, data_len = 20, ptr = 0x7fffb5e2f630.
i = 5, bin = 1, offset = 2030720, data_len = 12, ptr = 0x7fffb55da6f0.
i = 6, bin = 3, offset = 1493816, data_len = 20, ptr = 0x7fffb55e2b30.
i = 7, bin = 3, offset = 10175184, data_len = 20, ptr = 0x7fffb5e2a2c8.
i = 8, bin = 3, offset = 1953400, data_len = 20, ptr = 0x7fffb5652e70.
i = 9, bin = 3, offset = 9589896, data_len = 20, ptr = 0x7fffb5d9b480.
i = 10, bin = 3, offset = 1576400, data_len = 20, ptr = 0x7fffb55f6dc8.
i = 11, bin = 51, offset = 78000, data_len = 212, ptr = 0x7fffb54890a8.
i = 12, bin = 1, offset = 10027684, data_len = 12, ptr = 0x7fffb5e0629c.
i = 13, bin = 3, offset = 1126496, data_len = 20, ptr = 0x7fffb5589058.
i = 14, bin = 9, offset = 10079012, data_len = 44, ptr = 0x7fffb5e12b1c.
i = 15, bin = 5, offset = 46380, data_len = 28, ptr = 0x7fffb5481524.
i = 16, bin = 2, offset = 10050652, data_len = 16, ptr = 0x7fffb5e0bc54.
i = 17, bin = 1, offset = 9607132, data_len = 12, ptr = 0x7fffb5d9f7d4.
i = 18, bin = 12, offset = 10294940, data_len = 56, ptr = 0x7fffb5e47694.
i = 19, bin = 22, offset = 10314828, data_len = 96, ptr = 0x7fffb5e4c444.
i = 20, bin = 3, offset = 2024832, data_len = 20, ptr = 0x7fffb5664578.
i = 21, bin = 91, offset = 77620, data_len = 372, ptr = 0x7fffb5488f2c.
i = 22, bin = 3, offset = 1518016, data_len = 20, ptr = 0x7fffb55e89b8.
i = 23, bin = 10, offset = 10315032, data_len = 48, ptr = 0x7fffb5e4c510.
i = 24, bin = 10, offset = 10315088, data_len = 48, ptr = 0x7fffb5e4c548.
i = 25, bin = 10, offset = 10315144, data_len = 48, ptr = 0x7fffb5e4c580.
i = 26, bin = 10, offset = 10315200, data_len = 48, ptr = 0x7fffb5e4c5b8.
i = 27, bin = 57, offset = 91480, data_len = 236, ptr = 0x7fffb548c550.
i = 28, bin = 2, offset = 14680072, data_len = 16, ptr = 0x7fffb6276000.
i = 29, bin = 3, offset = 10082776, data_len = 20, ptr = 0x7fffb5e139d0.
i = 30, bin = 1, offset = 1769376, data_len = 12, ptr = 0x7fffb5625f98.
i = 31, bin = 2, offset = 10289660, data_len = 16, ptr = 0x7fffb5e461f4.
i = 32, bin = 2, offset = 10289636, data_len = 16, ptr = 0x7fffb5e461dc.
i = 33, bin = 14, offset = 10317452, data_len = 64, ptr = 0x7fffb5e4ce84.
i = 34, bin = 7, offset = 10317552, data_len = 36, ptr = 0x7fffb5e4cee8.
i = 35, bin = 1, offset = 2030720, data_len = 12, ptr = 0x7fffb55da6f0.
i = 36, bin = 3, offset = 10074264, data_len = 20, ptr = 0x7fffb5e11890.
Thanks,
Xyxue
Assignee
Pablo Camarillo
Reporter
Pablo Camarillo
Comments
No comments.
Original issue: https://jira.fd.io/browse/VPP-1113
The text was updated successfully, but these errors were encountered: