Hi,all:
Threr 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.
The statack is under below:
#0 0x00007f824aa0d197 in raise () from /usr/lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install
dpdk-mlx4-pmd-16.11-R5.RC6.003.x86_64 glibc-2.17-157.h13.x86_64
keyutils-libs-1.5.8-3.x86_64 krb5-libs-1.13.2-12.h2.x86_64
libcom_err-1.42.9-9.h1.x86_64 libgcc-4.8.3-10.h2.x86_64
libibverbs-1.2.1mlnx1-OFED.4.0.1.5.3.40200.x86_64 libnl-1.1.4-3.x86_64
libselinux-2.2.2-6.x86_64 numactl-libs-2.0.9-4.x86_64
openssl-libs-1.0.1e-60.1.h2.x86_64 pcre-8.32-15.1.h2.x86_64
uvpkmc-1.0.0-725.x86_64 xz-libs-5.1.2-9alpha.x86_64 zlib-1.2.7-14.x86_64
(gdb) bt
#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
Here is the fix patch:
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 4d72dd8..9552a58 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1593,7 +1593,9 @@ ofproto_destroy__(struct ofproto *ofproto)
cmap_destroy(&ofproto->groups);
+ ovs_mutex_lock(&ofproto_mutex);
hmap_remove(&all_ofprotos, &ofproto->hmap_node);
+ ovs_mutex_unlock(&ofproto_mutex);
free(ofproto->name);
free(ofproto->type);
_______________________________________________
discuss mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss