]> git.proxmox.com Git - mirror_ovs.git/commit
ofproto: Fix coredump in ofproto_destroy__().
authorliucheng (J) <liucheng11@huawei.com>
Tue, 14 Aug 2018 04:08:27 +0000 (04:08 +0000)
committerBen Pfaff <blp@ovn.org>
Wed, 15 Aug 2018 17:22:28 +0000 (10:22 -0700)
commit6d917cd2bad1bfc1483f8cff7ef348fd30ed1a21
tree0191f7c94482bbb7ad8a048ac3df4580f57146a7
parent102781cc02c65dcfe7d154c042f703cc626a7875
ofproto: Fix coredump in ofproto_destroy__().

There is a coredump when I add and delete bridges. When the rcu thread call
ofproto_destroy__, the main thread may call ofproto_create. But the
ofproto_destroy__ fun doesn't have the ofproto_mutex when access the
all_ofprotos.

 #0  0x00007f824aa0d197 in raise () from /usr/lib64/libc.so.6
 #1  0x00007f824aa0e888 in abort () from /usr/lib64/libc.so.6
 #2  0x0000000000658249 in PAT_abort ()
 #3  0x000000000065538d in patchIllInsHandler ()
 #4  <signal handler called>
 #5  0x0000000000478a5b in hmap_remove (node=0x3320150, hmap=0x95fc40 <all_ofprotos>) at include/openvswitch/hmap.h:287
 #6  ofproto_destroy__ (ofproto=0x3320150) at ofproto/ofproto.c:1642
 #7  0x0000000000535e46 in ovsrcu_call_postponed () at lib/ovs_rcu.c:323
 #8  0x0000000000536014 in ovsrcu_postpone_thread (arg=<optimized out>) at lib/ovs_rcu.c:338
 #9  0x0000000000538488 in ovsthread_wrapper (aux_=<optimized out>) at lib/ovs_thread.c:682
 #10 0x00007f824c130dc5 in start_thread () from /usr/lib64/libpthread.so.0
 #11 0x00007f824aacf7bd in clone () from /usr/lib64/libc.so.6

Signed-off-by: Cheng Liu <liucheng11@huawei.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ofproto/ofproto.c