From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC1B7A0509; Wed, 30 Mar 2022 13:34:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C72B40685; Wed, 30 Mar 2022 13:34:22 +0200 (CEST) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id DA4DB4013F for ; Wed, 30 Mar 2022 13:34:20 +0200 (CEST) Received: by inbox.dpdk.org (Postfix, from userid 33) id AA4CCA050A; Wed, 30 Mar 2022 13:34:20 +0200 (CEST) From: bugzilla@dpdk.org To: dev@dpdk.org Subject: [Bug 987] dead lock in rte_acl_creat and rte_ring_free by list circled Date: Wed, 30 Mar 2022 11:34:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: vhost/virtio X-Bugzilla-Version: 20.02 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sofardware@126.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org https://bugs.dpdk.org/show_bug.cgi?id=3D987 Bug ID: 987 Summary: dead lock in rte_acl_creat and rte_ring_free by list circled Product: DPDK Version: 20.02 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: Normal Component: vhost/virtio Assignee: dev@dpdk.org Reporter: sofardware@126.com Target Milestone: --- In the function rte_acl_creat or rte_ring_free, when run TAILQ_FOREACH, it = can not end if not find the target, because the tailq list has became a circle list, of=20=20=20 whitch the last node's next is the first node. This issue does not alwayse hapen, and I have not find what result it. (gdb) disassemble Dump of assembler code for function rte_acl_create: 0x00000000006057a0 <+0>: push %r15 0x00000000006057a2 <+2>: push %r14 0x00000000006057a4 <+4>: push %r13 0x00000000006057a6 <+6>: push %r12 0x00000000006057a8 <+8>: mov %rdi,%r12 0x00000000006057ab <+11>: push %rbp 0x00000000006057ac <+12>: push %rbx 0x00000000006057ad <+13>: sub $0x38,%rsp 0x00000000006057b1 <+17>: test %rdi,%rdi 0x00000000006057b4 <+20>: mov 0x7a2365(%rip),%r13 # 0xda7b20 0x00000000006057bb <+27>: je 0x6058f0 0x00000000006057c1 <+33>: mov (%rdi),%rcx 0x00000000006057c4 <+36>: test %rcx,%rcx 0x00000000006057c7 <+39>: je 0x6058f0 0x00000000006057cd <+45>: lea 0x10(%rsp),%rdi 0x00000000006057d2 <+50>: mov $0xaf5029,%edx 0x00000000006057d7 <+55>: mov $0x20,%esi 0x00000000006057dc <+60>: xor %eax,%eax 0x00000000006057de <+62>: callq 0x4395c0 0x00000000006057e3 <+67>: mov 0x10(%r12),%eax 0x00000000006057e8 <+72>: mov 0xc(%r12),%r15d 0x00000000006057ed <+77>: mov %eax,0xc(%rsp) 0x00000000006057f1 <+81>: callq 0x5b31e0 0x00000000006057f6 <+86>: mov 0x0(%r13),%r14 0x00000000006057fa <+90>: test %r14,%r14 0x00000000006057fd <+93>: je 0x605840 0x00000000006057ff <+95>: mov (%r12),%rbp 0x0000000000605803 <+99>: jmp 0x605810 0x0000000000605805 <+101>: nopl (%rax) 0x0000000000605808 <+104>: mov (%r14),%r14 0x000000000060580b <+107>: test %r14,%r14 0x000000000060580e <+110>: je 0x605840 0x0000000000605810 <+112>: mov 0x10(%r14),%rbx 0x0000000000605814 <+116>: mov $0x20,%edx 0x0000000000605819 <+121>: mov %rbp,%rdi 0x000000000060581c <+124>: mov %rbx,%rsi 0x000000000060581f <+127>: callq 0x438bc0 =3D> 0x0000000000605824 <+132>: test %eax,%eax 0x0000000000605826 <+134>: jne 0x605808 0x0000000000605828 <+136>: callq 0x5b3230 0x000000000060582d <+141>: mov %rbx,%rax 0x0000000000605830 <+144>: add $0x38,%rsp 0x0000000000605834 <+148>: pop %rbx 0x0000000000605835 <+149>: pop %rbp 0x0000000000605836 <+150>: pop %r12 0x0000000000605838 <+152>: pop %r13 0x000000000060583a <+154>: pop %r14 0x000000000060583c <+156>: pop %r15 0x000000000060583e <+158>: retq=20=20=20 0x000000000060583f <+159>: nop 0x0000000000605840 <+160>: xor %edx,%edx 0x0000000000605842 <+162>: mov $0x18,%esi 0x0000000000605847 <+167>: mov $0xaf5030,%edi 0x000000000060584c <+172>: callq 0x5c0460 0x0000000000605851 <+177>: test %rax,%rax 0x0000000000605854 <+180>: mov %rax,%rbp 0x0000000000605857 <+183>: je 0x605935 ---Type to continue, or q to quit---=20 0x000000000060585d <+189>: mov 0xc(%rsp),%r14d 0x0000000000605862 <+194>: mov 0x8(%r12),%ecx 0x0000000000605867 <+199>: lea 0x10(%rsp),%rdi 0x000000000060586c <+204>: mov $0x40,%edx 0x0000000000605871 <+209>: imul %r15d,%r14d 0x0000000000605875 <+213>: add $0x388,%r14 0x000000000060587c <+220>: mov %r14,%rsi 0x000000000060587f <+223>: callq 0x5c0380 0x0000000000605884 <+228>: test %rax,%rax 0x0000000000605887 <+231>: mov %rax,%rbx 0x000000000060588a <+234>: je 0x605905 0x000000000060588c <+236>: lea 0x388(%rax),%rax 0x0000000000605893 <+243>: mov (%r12),%rcx 0x0000000000605897 <+247>: mov $0xaecc2d,%edx 0x000000000060589c <+252>: mov $0x20,%esi 0x00000000006058a1 <+257>: mov %rbx,%rdi 0x00000000006058a4 <+260>: mov %rax,0x28(%rbx) 0x00000000006058a8 <+264>: mov 0x10(%r12),%eax 0x00000000006058ad <+269>: mov %eax,0x30(%rbx) 0x00000000006058b0 <+272>: mov 0xc(%r12),%eax 0x00000000006058b5 <+277>: mov %eax,0x34(%rbx) 0x00000000006058b8 <+280>: mov 0x8(%r12),%eax 0x00000000006058bd <+285>: mov %eax,0x20(%rbx) 0x00000000006058c0 <+288>: mov 0x7a223a(%rip),%eax # 0xda7b00 0x00000000006058c6 <+294>: mov %eax,0x24(%rbx) 0x00000000006058c9 <+297>: xor %eax,%eax 0x00000000006058cb <+299>: callq 0x4395c0 0x00000000006058d0 <+304>: mov 0x8(%r13),%rax 0x00000000006058d4 <+308>: mov %rbx,0x10(%rbp) 0x00000000006058d8 <+312>: movq $0x0,0x0(%rbp) 0x00000000006058e0 <+320>: mov %rax,0x8(%rbp) 0x00000000006058e4 <+324>: mov %rbp,(%rax) 0x00000000006058e7 <+327>: mov %rbp,0x8(%r13) 0x00000000006058eb <+331>: jmpq 0x605828 0x00000000006058f0 <+336>: mov 0x7916f1(%rip),%rax # 0xd96fe8 0x00000000006058f7 <+343>: movl $0x16,%fs:(%rax) 0x00000000006058fe <+350>: xor %eax,%eax 0x0000000000605900 <+352>: jmpq 0x605830 0x0000000000605905 <+357>: mov 0x8(%r12),%r8d 0x000000000060590a <+362>: lea 0x10(%rsp),%r9 0x000000000060590f <+367>: mov %r14,%rcx 0x0000000000605912 <+370>: mov $0xaf50f0,%edx 0x0000000000605917 <+375>: mov $0x9,%esi 0x000000000060591c <+380>: mov $0x4,%edi 0x0000000000605921 <+385>: xor %eax,%eax 0x0000000000605923 <+387>: callq 0x43ebc6 0x0000000000605928 <+392>: mov %rbp,%rdi 0x000000000060592b <+395>: callq 0x5c01b0 0x0000000000605930 <+400>: jmpq 0x605828 0x0000000000605935 <+405>: mov $0xaf50c8,%edx 0x000000000060593a <+410>: mov $0x9,%esi 0x000000000060593f <+415>: mov $0x4,%edi 0x0000000000605944 <+420>: xor %eax,%eax 0x0000000000605946 <+422>: xor %ebx,%ebx 0x0000000000605948 <+424>: callq 0x43ebc6 0x000000000060594d <+429>: jmpq 0x605828 End of assembler dump. (gdb) p $r14 $16 =3D 8615101376 (gdb) p/x $r14 $17 =3D 0x2018003c0 (gdb) p/x *((long long*)0x2018003c0) $18 =3D 0xf9d5e00 (gdb) p/x *((long long*)0xf9d5e00) $19 =3D 0x1b1a00200 (gdb) p/x *((long long*)0x1b1a00200) $20 =3D 0x201800540 (gdb) p/x *((long long*)0x201800540) $21 =3D 0x2018003c0 (gdb) p/x *((long long*)0x2018003c0) $22 =3D 0xf9d5e00 ------------------------------------------------------ Dump of assembler code for function rte_ring_free: 0x00000000005cbb00 <+0>: push %r12 0x00000000005cbb02 <+2>: test %rdi,%rdi=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E5=88=A4=E6=96=AD=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=8F=82=E6=95=B0r =E6= =98=AF=E5=90=A6=E4=B8=BANULL 0x00000000005cbb05 <+5>: push %rbp 0x00000000005cbb06 <+6>: mov %rdi,%rbp 0x00000000005cbb09 <+9>: push %rbx 0x00000000005cbb0a <+10>: je 0x5cbb98 =20=20= =20=20=20=20=20=20=20=20=20=20 //=E5=A6=82=E6=9E=9C=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=8F=82=E6=95=B0=E4= =B8=BANULL=EF=BC=8C=E8=B0=83=E5=88=B0152=E5=B8=A7=EF=BC=8C=E5=87=BD=E6=95= =B0=E8=BF=94=E5=9B=9E 0x00000000005cbb10 <+16>: mov 0x28(%rdi),%rdi=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E5=8F=96r->memzone=E7=9A=84=E5=80=BC 0x00000000005cbb14 <+20>: test %rdi,%rdi 0x00000000005cbb17 <+23>: je 0x5cbbb7 =20=20= =20=20=20=20=20=20=20=20=20=20 //=E5=88=A4=E6=96=ADr->memzone=E6=98=AF=E5=90=A6=E4=B8=BANULL=EF=BC=8C= =E5=A6=82=E6=9E=9C=E6=98=AF=EF=BC=8C=E5=88=99=E8=B0=83=E5=88=B0183=E5=B8=A7= =E8=BF=94=E5=9B=9E=E3=80=82 0x00000000005cbb1d <+29>: callq 0x5b2290 =20=20=20= =20=20=20=20=20=20=20=20=20=20 //=E5=A6=82=E6=9E=9C r->memzone=E4=B8=8D=E4=B8=BANULL=EF=BC=8C=E5=88= =99=E9=87=8A=E6=94=BEr->memzone 0x00000000005cbb22 <+34>: test %eax,%eax=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E5=A6=82=E6=9E=9C=E6=98=AF=E5=90=A6=E5=A4=B1=E8=B4=A5=EF=BC=8C=E8= =B0=83=E5=88=B0157=E5=B8=A7=E8=BF=94=E5=9B=9E 0x00000000005cbb24 <+36>: jne 0x5cbb9d 0x00000000005cbb26 <+38>: mov 0x7db973(%rip),%r12 # 0xda74a0 //=E8=8E=B7=E5=8F=96rte_ring=E9=93=BE=E8=A1=A8 0x00000000005cbb2d <+45>: callq 0x5b31e0 0x00000000005cbb32 <+50>: mov (%r12),%rbx //(var) =3D ((head)->tqh_first) //=E8=8E=B7=E5=8F=96=E9=93=BE=E8=A1=A8=E7=AC=AC=E4= =B8=80=E4=B8=AA=E8=8A=82=E7=82=B9 0x00000000005cbb36 <+54>: test %rbx,%rbx=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E5=88=A4=E6=96=AD=E8=AF=A5=E8=8A=82=E7=82=B9=E6=98=AF=E5=90=A6=E4= =B8=BA=E7=A9=BA 0x00000000005cbb39 <+57>: jne 0x5cbb48 =20=20=20= =20=20=20=20=20=20=20=20=20=20 //=E5=A6=82=E4=BD=95=E4=B8=8D=E4=B8=BA=E7=A9=BA=EF=BC=8C=E8=B7=B3=E5= =88=B072=E5=B8=A7=E5=88=A4=E6=96=AD=E6=95=B0=E6=8D=AE=E6=98=AF=E5=90=A6=E7= =AD=89=E4=BA=8E=E5=BE=85=E5=88=A0=E9=99=A4=E8=8A=82=E7=82=B9=E3=80=82 0x00000000005cbb3b <+59>: jmp 0x5cbb80 =20=20= =20=20=20=20=20=20=20=20=20=20 //=E5=A6=82=E6=9E=9C=E4=B8=BA=E7=A9=BA=EF=BC=8C=E8=B7=B3=E5=88=B0128= =E5=B8=A7=EF=BC=8C=E8=A7=A3=E9=94=81=E8=BF=94=E5=9B=9E 0x00000000005cbb3d <+61>: nopl (%rax) =3D> 0x00000000005cbb40 <+64>: mov (%rbx),%rbx=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E5=8F=96=E4=B8=8B=E4=B8=80=E4=B8=AA=E8=8A=82=E7=82=B9 0x00000000005cbb43 <+67>: test %rbx,%rbx=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E5=88=A4=E6=96=AD=E8=AF=A5=E8=8A=82=E7=82=B9=E6=98=AF=E5=90=A6=E4= =B8=BA=E7=A9=BA 0x00000000005cbb46 <+70>: je 0x5cbb80 if=20= =20=20=20=20=20=20=20=20 //=E5=A6=82=E6=9E=9C=E4=B8=BA=E7=A9=BA=EF=BC=8C=E8=B7=B3=E5=88=B0128= =E5=B8=A7=EF=BC=8C=E8=A7=A3=E9=94=81=E8=BF=94=E5=9B=9E=E3=80=82 0x00000000005cbb48 <+72>: cmp %rbp,0x10(%rbx) //var =3D ring=20= =20=20=20=20=20=20=20=20=20=20 //=E5=BD=93=E5=89=8D=E6=89=80=E5=8F=96=E7=9A=84=E8=8A=82=E7=82=B9=E4= =B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE=E6=98=AF=E5=90=A6=E7=AD=89=E4=BA=8E=E5=BE= =85=E5=88=A0=E9=99=A4=E8=8A=82=E7=82=B9 0x00000000005cbb4c <+76>: jne 0x5cbb40 =20=20=20= =20=20=20=20=20=20=20=20=20=20 // =E5=A6=82=E6=9E=9C=E4=B8=8D=E7=AD=89,=E8=B7=B3=E5=88=B064=E5=B8=A7= =E7=BB=A7=E7=BB=AD=E5=8F=96=E4=B8=8B=E4=B8=80=E4=B8=AA=E8=8A=82=E7=82=B9 0x00000000005cbb4e <+78>: mov (%rbx),%rax 0x00000000005cbb51 <+81>: test %rax,%rax=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E5=88=A4=E6=96=AD=E5=BD=93=E5=89=8D=E8=8A=82=E7=82=B9=E6=98=AF=E5= =90=A6=E4=B8=BA=E7=A9=BA,=E4=B9=9F=E5=B0=B1=E6=98=AF=E8=AF=B4=E6=98=AF=E5= =90=A6=E9=93=BE=E8=A1=A8=E8=BD=AE=E8=AF=A2=E5=88=B0=E6=9C=AB=E5=B0=BE=E4=BA= =86=E4=BB=8D=E6=9C=AA=E6=89=BE=E5=88=B0=E5=92=8C=E5=BE=85=E5=88=A0=E9=99=A4= =E8=8A=82=E7=82=B9=E7=9B=B8=E7=AD=89=E7=9A=84=E8=8A=82=E7=82=B9=E3=80=82 0x00000000005cbb54 <+84>: je 0x5cbb89 =20=20= =20=20=20=20=20=20=20=20=20=20 //=E5=A6=82=E6=9E=9C=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=88=99=E8=A7=A3=E9= =94=81=E8=BF=94=E5=9B=9E=E3=80=82=E5=90=A6=E5=88=99=E5=88=A0=E9=99=A4=E8=8A= =82=E7=82=B9=E5=90=8E=E8=A7=A3=E9=94=81=EF=BC=8C=E5=86=8D=E6=98=AF=E5=90=A6= =E5=86=85=E5=AD=98=EF=BC=8C=E5=86=8D=E8=BF=94=E5=9B=9E=E3=80=82 0x00000000005cbb56 <+86>: mov 0x8(%rbx),%rdx=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E8=BF=99=E9=87=8C=E4=BB=A3=E8=A1=A8=E6=89=80=E5=8F=96=E7=9A=84=E8= =8A=82=E7=82=B9=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE=E7=AD=89=E4=BA=8E=E5=BE= =85=E5=88=A0=E9=99=A4=E8=8A=82=E7=82=B9=EF=BC=8C =E4=BB=8E=E9=93=BE=E8=A1= =A8=E5=88=A0=E9=99=A4=E8=8A=82=E7=82=B9=E3=80=82 0x00000000005cbb5a <+90>: mov %rdx,0x8(%rax) 0x00000000005cbb5e <+94>: mov 0x8(%rbx),%rdx 0x00000000005cbb62 <+98>: mov %rax,(%rdx) 0x00000000005cbb65 <+101>: callq 0x5b3230 =20=20 //=E8=A7=A3=E9=94=81 0x00000000005cbb6a <+106>: mov %rbx,%rdi 0x00000000005cbb6d <+109>: pop %rbx 0x00000000005cbb6e <+110>: pop %rbp 0x00000000005cbb6f <+111>: pop %r12 0x00000000005cbb71 <+113>: jmpq 0x5c01b0 =20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 //=E9=87=8A=E6=94=BE=E5=86=85=E5=AD=98,=E8=BF=94=E5=9B=9E 0x00000000005cbb76 <+118>: nopw %cs:0x0(%rax,%rax,1) 0x00000000005cbb80 <+128>: pop %rbx 0x00000000005cbb81 <+129>: pop %rbp 0x00000000005cbb82 <+130>: pop %r12 0x00000000005cbb84 <+132>: jmpq 0x5b3230 0x00000000005cbb89 <+137>: mov 0x8(%rbx),%rdx 0x00000000005cbb8d <+141>: mov %rdx,0x8(%r12) 0x00000000005cbb92 <+146>: jmp 0x5cbb62 0x00000000005cbb94 <+148>: nopl 0x0(%rax) 0x00000000005cbb98 <+152>: pop %rbx 0x00000000005cbb99 <+153>: pop %rbp 0x00000000005cbb9a <+154>: pop %r12 0x00000000005cbb9c <+156>: retq=20=20=20 0x00000000005cbb9d <+157>: mov $0xaecad3,%edx 0x00000000005cbba2 <+162>: mov $0x2,%esi 0x00000000005cbba7 <+167>: mov $0x4,%edi 0x00000000005cbbac <+172>: pop %rbx 0x00000000005cbbad <+173>: pop %rbp 0x00000000005cbbae <+174>: pop %r12 0x00000000005cbbb0 <+176>: xor %eax,%eax=20=20 0x00000000005cbbb2 <+178>: jmpq 0x43ebc6 0x00000000005cbbb7 <+183>: mov $0xaeca60,%edx 0x00000000005cbbbc <+188>: mov $0x2,%esi 0x00000000005cbbc1 <+193>: mov $0x4,%dil 0x00000000005cbbc4 <+196>: jmp 0x5cbbac (gdb) p/x *(long long *)0x1b2004840 $26 =3D 0x299a01480 (gdb) p/x *(long long *)0x299a01480=20=20=20=20 $27 =3D 0xf9d5e00 (gdb) p/x *(long long *)0xf9d5e00=20=20 $28 =3D 0x1b2004840 --=20 You are receiving this mail because: You are the assignee for the bug.=