Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Oct 2015 00:25:38 +0300
From:      Nikos Vassiliadis <nvass@gmx.com>
To:        =?UTF-8?Q?Ermal_Lu=c3=a7i?= <eri@freebsd.org>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: carp on if_bridge deadlock
Message-ID:  <561047D2.1010303@gmx.com>
In-Reply-To: <CAPBZQG3=%2BboSOy%2BfSrj5_g9SkUm0xjqf97zKp1tC08QOe44hUg@mail.gmail.com>
References:  <560F00E6.5010503@gmx.com> <CAPBZQG3=%2BboSOy%2BfSrj5_g9SkUm0xjqf97zKp1tC08QOe44hUg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Ermal,

Thanks for the pointer. I just tried and I get this panic:

> bridge0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         ether 00:a0:98:27:8d:55
>         inet 10.0.0.11 netmask 0xff000000 broadcast 10.255.255.255
>         inet 10.0.0.2 netmask 0xff000000 broadcast 10.25panic: Lock carp_if not exclusively locked @ /usr/src/sys/modules/carp/../../netinet/ip_carp.c:1744
>
> cpuid = 2
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0092cd56f0
> vpanic() at vpanic+0x189/frame 0xfffffe0092cd5770
> panic() at panic+0x43/frame 0xfffffe0092cd57d0
> __rw_assert() at __rw_assert+0xa1/frame 0xfffffe0092cd57e0
> carp_ioctl() at carp_ioctl+0x334/frame 0xfffffe0092cd5860
> kern_ioctl() at kern_ioctl+0x230/frame 0xfffffe0092cd58c0
> sys_ioctl() at sys_ioctl+0x153/frame 0xfffffe0092cd59a0
> amd64_syscall() at amd64_syscall+0x2e1/frame 0xfffffe0092cd5ab0
> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0092cd5ab0
> --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x8011e927a, rsp = 0x7fffffffbd08, rbp = 0x7fffffffe500 ---
> KDB: enter: panic
> [ thread pid 295 tid 100060 ]
> Stopped at      kdb_enter+0x3e: movq    $0,kdb_why
> db>


On 10/03/15 20:52, Ermal Luçi wrote:
> This should apply https://reviews.freebsd.org/D3133
>
> Somehow it is still pending on gnn@ for some reason!
>
> On Sat, Oct 3, 2015 at 12:10 AM, Nikos Vassiliadis <nvass@gmx.com> wrote:
>
>> Hi,
>>
>> I am trying to use carp over an if_bridge and am getting
>> this LOR:
>>
>>> login: lock order reversal:
>>>   1st 0xfffff8000848a018 if_bridge (if_bridge) @
>>> /usr/src/sys/modules/if_bridge/../../net/if_bridge.c:2315
>>>   2nd 0xfffff80003a58778 carp_if (carp_if) @
>>> /usr/src/sys/modules/carp/../../netinet/ip_carp.c:1118
>>> KDB: stack backtrace:
>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
>>> 0xfffffe0092c3b6a0
>>> witness_checkorder() at witness_checkorder+0xe7a/frame 0xfffffe0092c3b720
>>> __mtx_lock_flags() at __mtx_lock_flags+0xa8/frame 0xfffffe0092c3b770
>>> carp_forus() at carp_forus+0x7a/frame 0xfffffe0092c3b7b0
>>> bridge_input() at bridge_input+0x338/frame 0xfffffe0092c3b820
>>> ether_nh_input() at ether_nh_input+0x2ab/frame 0xfffffe0092c3b860
>>> netisr_dispatch_src() at netisr_dispatch_src+0x86/frame 0xfffffe0092c3b8d0
>>> ether_input() at ether_input+0x4f/frame 0xfffffe0092c3b900
>>> vtnet_rxq_eof() at vtnet_rxq_eof+0x845/frame 0xfffffe0092c3b9b0
>>> vtnet_rx_vq_intr() at vtnet_rx_vq_intr+0x4e/frame 0xfffffe0092c3b9e0
>>> intr_event_execute_handlers() at intr_event_execute_handlers+0xe4/frame
>>> 0xfffffe0092c3ba20
>>> ithread_loop() at ithread_loop+0xa6/frame 0xfffffe0092c3ba70
>>> fork_exit() at fork_exit+0x84/frame 0xfffffe0092c3bab0
>>> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0092c3bab0
>>> --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
>>>
>>
>> Eventually all network activity will stop and this will happen:
>>
>>> load: 0.33  cmd: ifconfig 665 [*carp_if] 228.29r 0.00u 0.01s 0% 2716k
>>>
>> Or:
>>
>>> load: 2.86  cmd: ifconfig 720 [running] 104.92r 0.00u 36.53s 100% 2716k
>>>
>>
>> A single ping to the carp address is enough to trigger the problem.
>> The debugger says:
>>
>>> db> show all locks
>>> Process 669 (sysctl) thread 0xfffff800084269a0 (100082)
>>> exclusive sleep mutex Giant (Giant) r = 0 (0xffffffff81cc4e90) locked @
>>> /usr/src/sys/kern/kern_sysctl.c:164
>>> Process 668 (ifconfig) thread 0xfffff8000842e9a0 (100079)
>>> exclusive sx carp_sx (carp_sx) r = 0 (0xffffffff820b0ac0) locked @
>>> /usr/src/sys/modules/carp/../../netinet/ip_carp.c:1644
>>> Process 12 (intr) thread 0xfffff800038a89a0 (100010)
>>> exclusive sleep mutex carp_softc (carp_softc) r = 0 (0xfffff80008266508)
>>> locked @ /usr/src/sys/kern/kern_mutex.c:158
>>> Process 12 (intr) thread 0xfffff80003a679a0 (100031)
>>> exclusive sleep mutex carp_if (carp_if) r = 0 (0xfffff8000825b078) locked
>>> @ /usr/src/sys/modules/carp/../../netinet/ip_carp.c:1118
>>> exclusive sleep mutex if_bridge (if_bridge) r = 0 (0xfffff80008467018)
>>> locked @ /usr/src/sys/modules/if_bridge/../../net/if_bridge.c:2315
>>> db>
>>>
>>
>> There is a related PR
>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200319
>> But I couldn't apply cleanly the patch to HEAD or 10-STABLE.
>>
>> Thanks for any insights,
>> Nikos
>>
>> _______________________________________________
>> freebsd-net@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-net
>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>>
>> --
>> Ermal
>>
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?561047D2.1010303>