Re: [Qemu-devel] [PATCH v2 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine

2017-11-21 Thread Paolo Bonzini
On 21/11/2017 14:47, Kevin Wolf wrote: > Am 21.11.2017 um 03:23 hat Jeff Cody geschrieben: >> The previous patch fixed a race condition, in which there were >> coroutines being executing doubly, or after coroutine deletion. >> >> We can detect common scenarios when this happens, and print an error

Re: [Qemu-devel] [PATCH v2 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine

2017-11-21 Thread Kevin Wolf
Am 21.11.2017 um 03:23 hat Jeff Cody geschrieben: > The previous patch fixed a race condition, in which there were > coroutines being executing doubly, or after coroutine deletion. > > We can detect common scenarios when this happens, and print an error > message and abort before we corrupt memory

Re: [Qemu-devel] [PATCH v2 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine

2017-11-21 Thread Paolo Bonzini
On 21/11/2017 11:59, Stefan Hajnoczi wrote: > On Mon, Nov 20, 2017 at 09:23:24PM -0500, Jeff Cody wrote: >> @@ -438,6 +439,16 @@ fail: >> void aio_co_schedule(AioContext *ctx, Coroutine *co) >> { >> trace_aio_co_schedule(ctx, co); >> +const char *scheduled = atomic_read(&co->scheduled);

Re: [Qemu-devel] [PATCH v2 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine

2017-11-21 Thread Eric Blake
On 11/20/2017 08:23 PM, Jeff Cody wrote: > The previous patch fixed a race condition, in which there were > coroutines being executing doubly, or after coroutine deletion. > > We can detect common scenarios when this happens, and print an error > message and abort before we corrupt memory / data,

Re: [Qemu-devel] [PATCH v2 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine

2017-11-21 Thread Stefan Hajnoczi
On Mon, Nov 20, 2017 at 09:23:24PM -0500, Jeff Cody wrote: > @@ -438,6 +439,16 @@ fail: > void aio_co_schedule(AioContext *ctx, Coroutine *co) > { > trace_aio_co_schedule(ctx, co); > +const char *scheduled = atomic_read(&co->scheduled); > + > +if (scheduled) { > +fprintf(stde

[Qemu-devel] [PATCH v2 for-2.11 2/4] coroutine: abort if we try to schedule or enter a pending coroutine

2017-11-20 Thread Jeff Cody
The previous patch fixed a race condition, in which there were coroutines being executing doubly, or after coroutine deletion. We can detect common scenarios when this happens, and print an error message and abort before we corrupt memory / data, or segfault. This patch will abort if an attempt t