test-aio-multithread fails with 'Co-routine re-entered recursively'

Bug #1729623 reported by R.Nageswara Sastry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

git head is at fa73e146250181852c0915aa65df8d54d35485fa

configure with the following

./configure --enable-attr --enable-bsd-user --enable-cap-ng\
 --enable-coroutine-pool --enable-crypto-afalg --enable-curl\
 --enable-curses --enable-debug --enable-debug-info\
 --enable-debug-tcg --enable-fdt --enable-gcrypt \
 --enable-gnutls --enable-gprof --enable-gtk \
 --enable-guest-agent --enable-kvm --enable-libiscsi \
 --enable-libssh2 --enable-linux-aio --enable-linux-user \
 --enable-live-block-migration --enable-modules \
 --enable-numa --enable-pie --enable-profiler \
 --enable-qom-cast-debug --enable-rbd --enable-replication \
 --enable-seccomp --enable-smartcard --enable-stack-protector \
 --enable-system --enable-tcg --enable-tcg-interpreter \
 --enable-tools --enable-tpm --enable-trace-backend=ftrace \
 --enable-user --enable-vhost-net --enable-vhost-scsi \
 --enable-vhost-user --enable-vhost-vsock --enable-virtfs \
 --enable-vnc --enable-tpm --enable-vnc-png \
 --enable-vnc-sasl --enable-werror --enable-xfsctl \
 --enable-gcov --enable-debug-stack-usage

make -j 32

make test-aio-multithread V=1

...
File '/home/nasastry/qemu/include/qapi/qmp/qobject.h'
No executable lines

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} gtester -k --verbose -m=quick tests/test-aio-multithread
TEST: tests/test-aio-multithread... (pid=86877)
  /aio/multi/lifecycle: OK
  /aio/multi/schedule: Co-routine re-entered recursively
FAIL
GTester: last random seed: R02S681209ce87fc22715b41223212d9f6f0
(pid=86891)
  /aio/multi/mutex/contended: OK
  /aio/multi/mutex/handoff: OK
  /aio/multi/mutex/mcs: OK
  /aio/multi/mutex/pthread: OK
FAIL: tests/test-aio-multithread
make: *** [check-tests/test-aio-multithread] Error 1

Full log will be attached.

Revision history for this message
R.Nageswara Sastry (nasastry) wrote :
Revision history for this message
R.Nageswara Sastry (nasastry) wrote :

This try is inspiration from tests/docker/test-full.

Revision history for this message
Stefan Hajnoczi (stefanha) wrote : Re: [Qemu-devel] [Bug 1729623] [NEW] test-aio-multithread fails with 'Co-routine re-entered recursively'

On Thu, Nov 02, 2017 at 03:11:30PM -0000, R.Nageswara Sastry wrote:
> Public bug reported:
>
> git head is at fa73e146250181852c0915aa65df8d54d35485fa
>
> configure with the following
>
> ./configure --enable-attr --enable-bsd-user --enable-cap-ng\
> --enable-coroutine-pool --enable-crypto-afalg --enable-curl\
> --enable-curses --enable-debug --enable-debug-info\
> --enable-debug-tcg --enable-fdt --enable-gcrypt \
> --enable-gnutls --enable-gprof --enable-gtk \
> --enable-guest-agent --enable-kvm --enable-libiscsi \
> --enable-libssh2 --enable-linux-aio --enable-linux-user \
> --enable-live-block-migration --enable-modules \
> --enable-numa --enable-pie --enable-profiler \
> --enable-qom-cast-debug --enable-rbd --enable-replication \
> --enable-seccomp --enable-smartcard --enable-stack-protector \
> --enable-system --enable-tcg --enable-tcg-interpreter \
> --enable-tools --enable-tpm --enable-trace-backend=ftrace \
> --enable-user --enable-vhost-net --enable-vhost-scsi \
> --enable-vhost-user --enable-vhost-vsock --enable-virtfs \
> --enable-vnc --enable-tpm --enable-vnc-png \
> --enable-vnc-sasl --enable-werror --enable-xfsctl \
> --enable-gcov --enable-debug-stack-usage
>
> make -j 32
>
> make test-aio-multithread V=1
>
> ...
> File '/home/nasastry/qemu/include/qapi/qmp/qobject.h'
> No executable lines
>
> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} gtester -k --verbose -m=quick tests/test-aio-multithread
> TEST: tests/test-aio-multithread... (pid=86877)
> /aio/multi/lifecycle: OK
> /aio/multi/schedule: Co-routine re-entered recursively
> FAIL

I cannot reproduce it locally.

Please run with gdb tests/test-aio-multithread and post the backtrace
when the "Co-routine re-entered recursively" message is printed using
the "thread apply all bt" gdb command.

Stefan

Revision history for this message
R.Nageswara Sastry (nasastry) wrote :
Download full text (10.1 KiB)

I could re-produce using the following command,

# MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} gtester -k --verbose -m=quick tests/test-aio-multithread
TEST: tests/test-aio-multithread... (pid=116074)
  /aio/multi/lifecycle: OK
  /aio/multi/schedule: Co-routine re-entered recursively
FAIL
GTester: last random seed: R02Seb8ebc3a9c10406e7725cdff556c14e4
(pid=116088)
  /aio/multi/mutex/contended: OK
  /aio/multi/mutex/handoff: OK
  /aio/multi/mutex/mcs: OK
  /aio/multi/mutex/pthread: OK
FAIL: tests/test-aio-multithread
[root@zzfp365-lp1 qemu]# echo $?
1

No important dmesg messages.

Trying with gdb

When I ran only the test case seeing a segfault.
[root@zzfp365-lp1 qemu]# tests/test-aio-multithread
/aio/multi/lifecycle: OK
/aio/multi/schedule: Segmentation fault

from dmesg:
test-aio-multit[117118]: unhandled signal 11 at 00007fff88a2fe88 nip 00007fff8c08ed24 lr 00007fff8c08ebb0 code 30001

from gdb:
# gdb tests/test-aio-multithread core.117109
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "ppc64le-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/nasastry/qemu/tests/test-aio-multithread...done.

warning: core file may not match specified executable file.
[New LWP 117118]
[New LWP 117116]
[New LWP 117109]
[New LWP 117120]
[New LWP 117119]
[New LWP 117117]
[New LWP 117110]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `tests/test-aio-multithread '.
Program terminated with signal 11, Segmentation fault.
#0 0x00007fff8c08ed24 in __vmx__longjmp () from /lib64/libc.so.6
warning: File "/home/nasastry/qemu/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py:/usr/lib/golang/src/pkg/runtime/runtime-gdb.py".
To enable execution of this file add
 add-auto-load-safe-path /home/nasastry/qemu/.gdbinit
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
 set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
 info "(gdb)Auto-loading safe path"
Missing separate debuginfos, use: debuginfo-install glib2-2.50.3-3.el7.ppc64le glibc-2.17-196.el7.ppc64le gmp-6.0.0-15.el7.ppc64le gnutls-3.3.26-9.el7.ppc64le libaio-0.3.109-13.el7.ppc64le libcap-ng-0.7.5-4.el7.ppc64le libffi-3.0.13-18.el7.ppc64le libgcrypt-1.5....

Revision history for this message
Stefan Hajnoczi (stefanha) wrote : Re: [Qemu-devel] [Bug 1729623] Re: test-aio-multithread fails with 'Co-routine re-entered recursively'

On Mon, Nov 06, 2017 at 04:57:13AM -0000, R.Nageswara Sastry wrote:
> I could re-produce using the following command,
>
> # MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))} gtester -k --verbose -m=quick tests/test-aio-multithread
> TEST: tests/test-aio-multithread... (pid=116074)
> /aio/multi/lifecycle: OK
> /aio/multi/schedule: Co-routine re-entered recursively
> FAIL
> GTester: last random seed: R02Seb8ebc3a9c10406e7725cdff556c14e4
> (pid=116088)
> /aio/multi/mutex/contended: OK
> /aio/multi/mutex/handoff: OK
> /aio/multi/mutex/mcs: OK
> /aio/multi/mutex/pthread: OK
> FAIL: tests/test-aio-multithread
> [root@zzfp365-lp1 qemu]# echo $?
> 1
>
> No important dmesg messages.
>
> Trying with gdb

Thanks, the backtrace was useful. I have sent a patch and CCed you.

Stefan

Revision history for this message
Murilo Opsfelder Araújo (mopsfelder) wrote :

I confirmed with Stefan and this bug was fixed by https://git.qemu.org/?p=qemu.git;a=commitdiff;h=fb0c43f34eed8b18678c6e1f481d8564b35c99ed

commit fb0c43f34eed8b18678c6e1f481d8564b35c99ed
Author: Stefan Hajnoczi <email address hidden>
Date: Mon Nov 6 19:02:33 2017 +0000

    tests-aio-multithread: fix /aio/multi/schedule race condition

Changed in qemu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.