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

[VPP-1083] "ip punt redirect add" crashed due to mem alloc failure if not mentioned any other parameter #2516

Closed
vvalderrv opened this issue Feb 1, 2025 · 1 comment

Comments

@vvalderrv
Copy link
Contributor

Description

DBGvpp# ip punt redirect add

Thread 1 "vpp_main" received signal SIGABRT, Aborted.

0x00007ffff6040428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54

54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

(gdb) bt

#0 0x00007ffff6040428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54

#1 0x00007ffff604202a in __GI_abort () at abort.c:89

#2 0x00000000004068e4 in os_panic () at /vpp/build-data/../src/vpp/vnet/main.c:268

#3 0x00007ffff68d5011 in os_out_of_memory () at /vpp/build-data/../src/vppinfra/unix-misc.c:221

#4 0x00007ffff68b24cf in clib_mem_alloc_aligned_at_offset (size=73286285596, align=4, align_offset=4, os_out_of_memory_on_failure=1) at /vpp/build-data/../src/vppinfra/mem.h:105

#5 0x00007ffff68b27bc in vec_resize_allocate_memory (v=0x0, length_increment=3053595233, data_bytes=73286285596, header_bytes=4, data_align=4) at /vpp/build-data/../src/vppinfra/vec.c:59

#6 0x00007ffff6dc4e2e in _vec_resize (v=0x0, length_increment=3053595233, data_bytes=73286285592, header_bytes=0, data_align=0) at /vpp/build-data/../src/vppinfra/vec.h:142

#7 0x00007ffff6dc8294 in ip_punt_redirect_add (cfg=0x7ffff78560e0 <ip4_punt_redirect_cfg>, rx_sw_if_index=3053595232, redirect=0x7fffb60229d0, fproto=FIB_PROTOCOL_IP4, linkt=VNET_LINK_IP4)

at /vpp/build-data/../src/vnet/ip/ip4_punt_drop.c:329

#8 0x00007ffff6dc8481 in ip4_punt_redirect_add (rx_sw_if_index=3053595232, tx_sw_if_index=32767, nh=0x7fffb6022a80) at /vpp/build-data/../src/vnet/ip/ip4_punt_drop.c:367

#9 0x00007ffff6dc8764 in ip4_punt_redirect_cmd (vm=0x7ffff7b8a400 <vlib_global_main>, main_input=0x7fffb6022ef0, cmd=0x7fffb5fd7d14) at /vpp/build-data/../src/vnet/ip/ip4_punt_drop.c:427

#10 0x00007ffff78b5e07 in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b8a400 <vlib_global_main>, cm=0x7ffff7b8a5e0 <vlib_global_main+480>, input=0x7fffb6022ef0, parent_command_index=608)

at /vpp/build-data/../src/vlib/cli.c:588

#11 0x00007ffff78b5d15 in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b8a400 <vlib_global_main>, cm=0x7ffff7b8a5e0 <vlib_global_main+480>, input=0x7fffb6022ef0, parent_command_index=183)

at /vpp/build-data/../src/vlib/cli.c:566

#12 0x00007ffff78b5d15 in vlib_cli_dispatch_sub_commands (vm=0x7ffff7b8a400 <vlib_global_main>, cm=0x7ffff7b8a5e0 <vlib_global_main+480>, input=0x7fffb6022ef0, parent_command_index=0)

at /vpp/build-data/../src/vlib/cli.c:566

#13 0x00007ffff78b60ec in vlib_cli_input (vm=0x7ffff7b8a400 <vlib_global_main>, input=0x7fffb6022ef0, function=0x7ffff7944815 <unix_vlib_cli_output>, function_arg=0)

at /vpp/build-data/../src/vlib/cli.c:662

#14 0x00007ffff7949fd3 in unix_cli_process_input (cm=0x7ffff7b8a280 <unix_cli_main>, cli_file_index=0) at /vpp/build-data/../src/vlib/unix/cli.c:2307

#15 0x00007ffff794ab31 in unix_cli_process (vm=0x7ffff7b8a400 <vlib_global_main>, rt=0x7fffb6012000, f=0x0) at /vpp/build-data/../src/vlib/unix/cli.c:2419

#16 0x00007ffff78e95e1 in vlib_process_bootstrap (_a=140736245349008) at /vpp/build-data/../src/vlib/main.c:1231

#17 0x00007ffff684abc0 in clib_calljmp () at /vpp/build-data/../src/vppinfra/longjmp.S:110

#18 0x00007fffb5e93a60 in ?? ()

#19 0x00007ffff78e970c in vlib_process_startup (vm=0x7ffff689dd12 <vec_aligned_header_bytes+54>, p=0x7fffb5e93aa0, f=0xc1307aaa5b538f00) at /vpp/build-data/../src/vlib/main.c:1253

Backtrace stopped: previous frame inner to this frame (corrupt stack?)

(gdb)

If rx_sw_if_index, nh and tx_sw_if_index are not mentioned the exception occurs.

Because of very high values of uninitialized fields it tries to allocate very large memory which led to malloc failure.

Same problem occurs for "ip6 punt redirect add".

Assignee

Swarup Nayak

Reporter

Swarup Nayak

Comments

Original issue: https://jira.fd.io/browse/VPP-1083

@vvalderrv
Copy link
Contributor Author

done with https://gerrit.fd.io/r/c/9787/

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

No branches or pull requests

1 participant