[Bug 271764] buf_ring_dequeue_sc not holding strong for arm64 Azure

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 01 Jun 2023 14:23:31 UTC

            Bug ID: 271764
           Summary: buf_ring_dequeue_sc not holding strong for arm64 Azure
           Product: Base System
           Version: CURRENT
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: schakrabarti@microsoft.com


In our testing in Azure ARM64, if we are running wget in a infinite while loop
in a multicore
VM, then we are hitting a panic because of incorrect  head.
Please help on fixing it.

To repro:
multicore Azure / Hyper-V run in a while loop wget

 while [ 1 ]
wget https://releases.ubuntu.com/focal/ubuntu-20.04.6-desktop-amd64.iso
rm ubuntu*

Then we are seeing this panic:
db> bt
Tracing pid 0 tid 100090 td 0xffff0000cca37880
db_trace_self() at db_trace_self
db_stack_trace() at db_stack_trace+0x11c
db_command() at db_command+0x2d8
db_command_loop() at db_command_loop+0x54
db_trap() at db_trap+0xf8
kdb_trap() at kdb_trap+0x20c
handle_el1h_sync() at handle_el1h_sync+0x14
--- exception, esr 0xf2000000
kdb_enter() at kdb_enter+0x44
vpanic() at vpanic+0x178
panic() at panic+0x44
hn_txdesc_put() at hn_txdesc_put+0x210
hn_txpkt_done() at hn_txpkt_done+0x2c
hn_chan_callback() at hn_chan_callback+0x78
vmbus_chan_task() at vmbus_chan_task+0x28
taskqueue_run_locked() at taskqueue_run_locked+0x17c
taskqueue_thread_loop() at taskqueue_thread_loop+0xc8
fork_exit() at fork_exit+0x74
fork_trampoline() at fork_trampoline+0x14

This following assert is hitting

2722 hn_txdesc_put(struct hn_tx_ring *txr, struct hn_txdesc *txd)
2723 {
2725     KASSERT((txd->flags & HN_TXD_FLAG_ONLIST) == 0,

This txd is dequeued from
txd = buf_ring_dequeue_sc(txr->hn_txdesc_br);

and getting enqueued hn_txdesc_put() after txd getting reseted .

You are receiving this mail because:
You are the assignee for the bug.