[ovs-discuss] fix coredump in ofproto_destroy__

Ben Pfaff blp at ovn.org
Tue Aug 14 21:23:56 UTC 2018


On Tue, Aug 14, 2018 at 04:08:27AM +0000, liucheng (J) wrote:
> 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:

Thanks.  May I have a Signed-off-by for this?

Q: What's a Signed-off-by and how do I provide one?

    A: Free and open source software projects usually require a contributor to
    provide some assurance that they're entitled to contribute the code that
    they provide.  Some projects, for example, do this with a Contributor
    License Agreement (CLA) or a copyright assignment that is signed on paper
    or electronically.

    For this purpose, Open vSwitch has adopted something called the Developer's
    Certificate of Origin (DCO), which is also used by the Linux kernel and
    originated there.  Informally stated, agreeing to the DCO is the
    developer's way of attesting that a particular commit that they are
    contributing is one that they are allowed to contribute.  You should visit
    https://developercertificate.org/ to read the full statement of the DCO,
    which is less than 200 words long.

    To certify compliance with the Developer's Certificate of Origin for a
    particular commit, just add the following line to the end of your commit
    message, properly substituting your name and email address:

        Signed-off-by: Firstname Lastname <email at example.org>

    Git has special support for adding a Signed-off-by line to a commit
    message: when you run "git commit", just add the -s option, as in "git
    commit -s".  If you use the "git citool" GUI for commits, you can add a
    Signed-off-by line to the commit message by pressing Control+S.  Other Git
    user interfaces may provide similar support.


More information about the discuss mailing list