On Tue, May 09, 2017 at 03:37:12PM -0700, Anthony Xu wrote: > If trace backend is set to TRACE_NOP, trace_get_vcpu_event_count > returns 0, cause bitmap_new call abort. > > Signed-off-by: Anthony Xu <[email protected]> > --- > qom/cpu.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-)
Please post steps for reproducing the abort. I cannot reproduce this
with qemu-system-x86_64.
> diff --git a/qom/cpu.c b/qom/cpu.c
> index f02e9c0..f9111a0 100644
> --- a/qom/cpu.c
> +++ b/qom/cpu.c
> @@ -382,6 +382,7 @@ static void cpu_common_unrealizefn(DeviceState *dev,
> Error **errp)
>
> static void cpu_common_initfn(Object *obj)
> {
> + uint32_t count;
> CPUState *cpu = CPU(obj);
> CPUClass *cc = CPU_GET_CLASS(obj);
>
> @@ -396,7 +397,10 @@ static void cpu_common_initfn(Object *obj)
> QTAILQ_INIT(&cpu->breakpoints);
> QTAILQ_INIT(&cpu->watchpoints);
>
> - cpu->trace_dstate = bitmap_new(trace_get_vcpu_event_count());
> + count = trace_get_vcpu_event_count();
> + if (count) {
> + cpu->trace_dstate = bitmap_new(count);
> + }
>
> cpu_exec_initfn(cpu);
> }
> --
> 1.8.3.1
>
>
signature.asc
Description: PGP signature
