From: Ian Campbell <ian.campbell@citrix.com>
To: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: Iurii Konovalenko <iurii.konovalenko@globallogic.com>,
Embedded-pv-devel@lists.xenproject.org,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
David Vrabel <david.vrabel@citrix.com>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: Deadlock in /proc/xen/xenbus watch+read on 3.17+ (maybe earlier)
Date: Thu, 19 Mar 2015 10:38:32 +0000 [thread overview]
Message-ID: <1426761512.610.18.camel@citrix.com> (raw)
In-Reply-To: <20150319011911.GA29029@mail-itl>
On Thu, 2015-03-19 at 02:19 +0100, Marek Marczykowski-Górecki wrote:
> Hi,
>
> I've hit some deadlock in kernel xenstore client exposed via
> /proc/xen/xenbus.
Sounds similar to what Iurii also reported last night in "Userspace PV
backend hangs".
Iurri's case was all 3.14 kernels, which is in your range too.
> Steps to reproduce are simple:
> int main() {
> struct xs_handle *xs;
> xs = xs_open(0);
> xs_watch(xs, "domid", "token");
> xs_read(xs, 0, "name", NULL);
> return 0;
> }
>
> xs_watch internally creates new thread, which uses read to wait for the
> watch. And in the same time, the program tries to read some value,
> but actually it hangs at sending the command (before even sending a path to be
> read). Strace gives this (simplified for readability):
> [pid 2494] write(3, "\4\0\0\0\0\0\0\0\0\0\0\0\f\0\0\0", 160 = 16
> [pid 2494] write(3, "domid\0", 6) = 6
> [pid 2494] write(3, "token\0", 6) = 6
> [pid 2495] read(3, <unfinished ...>
> [pid 2494] futex(0x71c0d4, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
> [pid 2495] <... read resumed>
> "\17\0\0\0\377\377\377\377\220~\255\27\f\0\0\0", 16) = 16
> [pid 2495] read(3, "domid\0token\0", 12) = 12
> [pid 2495] read(3, "\4\0\0\0\0\0\0\0\0\0\0\0\3\0\0\0", 16) = 16
> [pid 2495] read(3, "OK\0", 3) = 3
> [pid 2495] futex(0x71c0d4, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x71c0d0,
> {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} <unfinished ...>
> [pid 2494] <... futex resumed> ) = 0
> [pid 2495] <... futex resumed> ) = 1
> [pid 2494] futex(0x71c0a8, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
> [pid 2495] futex(0x71c0a8, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
> [pid 2494] <... futex resumed> ) = -1 EAGAIN (Resource
> temporarily unavailable)
> [pid 2495] <... futex resumed> ) = 0
> [pid 2494] futex(0x71c0a8, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
> [pid 2495] read(3, <unfinished ...>
> [pid 2494] <... futex resumed> ) = 0
> [pid 2494] rt_sigaction(SIGPIPE, {SIG_DFL, [], SA_RESTORER,
> 0x7fc78c1488f0}, NULL, 8) = 0
> [pid 2494] rt_sigaction(SIGPIPE, {SIG_IGN, [], SA_RESTORER,
> 0x7fc78c1488f0}, {SIG_DFL, [], SA_RESTORER, 0x7fc78c1488f0}, 8) = 0
> [pid 2494] write(3, "\2\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0", 16
>
> And thats all - 2494 is waiting on write, 2495 is waiting on read.
>
> On 3.12.x it is working. On 3.17.0 and 3.18.7 it is broken. I haven't
> checked versions in the middle.
>
> Any ideas?
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-03-19 10:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 1:19 Deadlock in /proc/xen/xenbus watch+read on 3.17+ (maybe earlier) Marek Marczykowski-Górecki
2015-03-19 10:38 ` Ian Campbell [this message]
2015-03-19 12:10 ` Iurii Konovalenko
2015-03-19 12:32 ` [Embedded-pv-devel] " Vitaly Chernooky
2015-03-19 13:00 ` David Vrabel
2015-03-19 13:10 ` Vitaly Chernooky
2015-03-20 4:04 ` Marek Marczykowski-Górecki
2015-03-20 9:58 ` Vitaly Chernooky
2015-03-20 10:08 ` Vitaly Chernooky
2015-03-20 10:38 ` Vitaly Chernooky
2015-03-20 10:46 ` David Vrabel
2015-03-20 11:39 ` Vitaly Chernooky
2015-03-20 10:41 ` Marek Marczykowski-Górecki
2015-03-19 11:10 ` David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1426761512.610.18.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Embedded-pv-devel@lists.xenproject.org \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=iurii.konovalenko@globallogic.com \
--cc=marmarek@invisiblethingslab.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.