Skip to content

The debug version detects buffer double‑free in a timely manner. #3734

Description

@eh25041

Due to untimely detection of buffer double‑free, the original packet is often overwritten by new packets, resulting in missed optimal troubleshooting opportunities. The current situation is that although the double‑free is triggered by broadcast packets, the core file inspected via GDB shows that the relevant memory has already been overwritten by other packets.

This GDB supports auto-downloading debuginfo from the following URLs:
https://debuginfod.ubuntu.com
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./build-root/install-vpp_debug-native/vpp/bin/vpp -c ./minimal_startup.conf'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_abort () at ./stdlib/abort.c:95

warning: 95 ./stdlib/abort.c: No such file or directory
--Type for more, q to quit, c to continue without paging--
[Current thread is 1 (Thread 0x77dc2f3f56c0 (LWP 4846))]
(gdb) bt
#0 __GI_abort () at ./stdlib/abort.c:95
#1 0x000058ded51c931d in os_exit (code=1) at /home/zhangqi/C/vpp/src/vpp/vnet/main.c:471
#2 0x000077dc767857d4 in unix_signal_handler (signum=6, si=0x77dc2f3f3df0, uc=0x77dc2f3f3cc0)
at /home/zhangqi/C/vpp/src/vlib/unix/main.c:236
#3
#4 __pthread_kill_implementation (threadid=, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
#5 __pthread_kill_internal (threadid=, signo=6) at ./nptl/pthread_kill.c:89
#6 __GI___pthread_kill (threadid=, signo=signo@entry=6) at ./nptl/pthread_kill.c:100
#7 0x000077dc76245e2e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8 0x000077dc76228888 in __GI_abort () at ./stdlib/abort.c:77
#9 0x000058ded51c92cb in os_panic () at /home/zhangqi/C/vpp/src/vpp/vnet/main.c:447
#10 0x000077dc766356a9 in debugger () at /home/zhangqi/C/vpp/src/vppinfra/error.c:52
#11 0x000077dc766354ae in _clib_error (how_to_die=2, function_name=0x77dc767c013d "vlib_buffer_validate_alloc_free",
line_number=305, fmt=0x77dc767c015d "%s %U buffer 0x%x") at /home/zhangqi/C/vpp/src/vppinfra/error.c:111
#12 0x000077dc766eea5a in vlib_buffer_validate_alloc_free (vm=0x77dc379e0c40, buffers=0x77dc2f3f4660, n_buffers=32,
expected_state=VLIB_BUFFER_KNOWN_ALLOCATED) at /home/zhangqi/C/vpp/src/vlib/buffer.c:304
#13 0x000077dc352a69d8 in vlib_buffer_pool_put (vm=0x77dc379e0c40, buffer_pool_index=0 '\000', buffers=0x77dc2f3f4660, n_buffers=32)
at /home/zhangqi/C/vpp/src/vlib/buffer_funcs.h:742
#14 0x000077dc352a6305 in dpdk_ops_vpp_enqueue_x86_64_v3 (mp=0xac02c7b00, obj_table=0xac02cb140, n=96)
at /home/zhangqi/C/vpp/src/plugins/dpdk/buffer.c:231
#15 0x000077dc3511fd5c in rte_pktmbuf_free ()
from /home/zhangqi/C/vpp/build-root/install-vpp_debug-native/vpp/lib/x86_64-linux-gnu/vpp_plugins/dpdk_plugin.so
#16 0x000077dc3511df7f in vmxnet3_xmit_pkts ()
from /home/zhangqi/C/vpp/build-root/install-vpp_debug-native/vpp/lib/x86_64-linux-gnu/vpp_plugins/dpdk_plugin.so
#17 0x000077dc352ac8d0 in rte_eth_tx_burst (port_id=0, queue_id=1, tx_pkts=0x77dc37a65c80, nb_pkts=30)
at /opt/vpp/external/x86_64/include/rte_ethdev.h:6738
#18 0x000077dc352aa024 in tx_burst_vector_internal (vm=0x77dc379e0c40, xd=0x77dc37a267c0, mb=0x77dc37a65c80, n_left=30, queue_id=1,
is_shared=0 '\000') at /home/zhangqi/C/vpp/src/plugins/dpdk/device/device.c:164
#19 0x000077dc352a9249 in dpdk_device_class_tx_fn_x86_64_v3 (vm=0x77dc379e0c40, node=0x77dc36477580, f=0x77dc36daac80)
--Type for more, q to quit, c to continue without paging--
at /home/zhangqi/C/vpp/src/plugins/dpdk/device/device.c:456
#20 0x000077dc7672920a in dispatch_node (vm=0x77dc379e0c40, node=0x77dc36477580, type=VLIB_NODE_TYPE_INTERNAL, frame=0x77dc36daac80,
dispatch_reason=VLIB_NODE_DISPATCH_REASON_PENDING_FRAME, last_time_stamp=1123958823067)
at /home/zhangqi/C/vpp/src/vlib/main.c:903
#21 0x000077dc76729eb4 in dispatch_pending_node (vm=0x77dc379e0c40, pending_frame_index=21, last_time_stamp=1123958823067)
at /home/zhangqi/C/vpp/src/vlib/main.c:1059
#22 0x000077dc76725115 in vlib_main_or_worker_loop (vm=0x77dc379e0c40, is_main=0) at /home/zhangqi/C/vpp/src/vlib/main.c:1592
#23 0x000077dc7672bbc5 in vlib_worker_thread_fn (arg=0x77dc38f6e600) at /home/zhangqi/C/vpp/src/vlib/main.c:2046
#24 0x000077dc7675afd5 in vlib_worker_thread_bootstrap_fn (arg=0x77dc38f6e600) at /home/zhangqi/C/vpp/src/vlib/threads.c:499
#25 0x000077dc762a3d64 in start_thread (arg=) at ./nptl/pthread_create.c:448
#26 0x000077dc763373bc in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions