qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] [PATCHv6 08/16] aio / timers: Add QEMUTimerListGr


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC] [PATCHv6 08/16] aio / timers: Add QEMUTimerListGroup to AioContext
Date: Wed, 7 Aug 2013 09:28:48 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Aug 06, 2013 at 03:58:40PM +0100, Alex Bligh wrote:
> --On 6 August 2013 16:45:12 +0200 Stefan Hajnoczi
> <address@hidden> wrote:
> 
> >>Because otherwise make check SEGVs after the patch.
> >
> >It wasn't clear from the patch why there would be a crash.  I looked
> >deeper and timerlistgroup_init() calls qemu_get_clock() indirectly, so
> >we need to make sure that qemu_clocks[] is initialized to avoid a NULL
> >pointer dereference.
> 
> Actually now I recall v4 had:
> 
> @@ -215,6 +216,12 @@ AioContext *aio_context_new(void)
>     aio_set_event_notifier(ctx, &ctx->notifier,
>                            (EventNotifierHandler *)
>                            event_notifier_test_and_clear, NULL);
> +    /* Assert if we don't have rt_clock yet. If you see this assertion
> +     * it means you are using AioContext without having first called
> +     * init_clocks() in main().
> +     */
> +    assert(rt_clock);
> +    ctx->tl = qemu_new_timerlist(rt_clock);
> 
> The equivalent in v7 would be an assert in timerlist_new_from_clock
> to check 'clock' is non-NULL. I shall put that in as the reason for
> this SEGV is non-obvious.

Nice, the comment makes the SEGV clear.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]