Skip to contentSkip to conversation

Windows build crash problem

Qemu-devel 武田 俊也 3 participants 3 messages Dec 12, 2007 – Dec 16, 2007

lore
Share & tools
lore
#0 lore raw

Hi all.

I encountered the crash problem with windows build on Core-Duo host. Qemu crashes in cpu_interrupt() called from host_alarm_handler() in vl.c because CPUState *env = next_cpu is null.

I tried the patch to check env is not null in host_alarm_handler() and now qemu does not crash.

        CPUState *env = next_cpu;
+	if(env) {
        /* stop the currently executing cpu because a timer occured */
        cpu_interrupt(env, CPU_INTERRUPT_EXIT);
#ifdef USE_KQEMU
        if (env->kqemu_enabled) {
            kqemu_cpu_interrupt(env);
        }
#endif
+	}
        event_pending = 1;
}

This is very temporary patch and I need to investigate why next_cpu is null but sorry now I dont have enough time.

Thanks,
TAKEDA, toshiya

#1 lore raw

Actually somebody has already described the problem on the mailing list and Paul Brook replied to that message. Hopefully you can find it in the archives.

F.

Quoted 31 lines · 武田 俊也

Hi all.

I encountered the crash problem with windows build on Core-Duo host. Qemu crashes in cpu_interrupt() called from host_alarm_handler() in vl.c because CPUState *env = next_cpu is null.

I tried the patch to check env is not null in host_alarm_handler() and now qemu does not crash.

       CPUState *env = next_cpu;
+       if(env) {
       /* stop the currently executing cpu because a timer occured */
       cpu_interrupt(env, CPU_INTERRUPT_EXIT);
#ifdef USE_KQEMU
       if (env->kqemu_enabled) {
           kqemu_cpu_interrupt(env);
       }
#endif
+       }
       event_pending = 1;
}

This is very temporary patch and I need to investigate why next_cpu is null but sorry now I dont have enough time.

Thanks,
TAKEDA, toshiya

#2 lore raw
In reply to 武田 俊也

Hi,

Quoted 20 lines · 武田 俊也

I encountered the crash problem with windows build on Core-Duo host. Qemu crashes in cpu_interrupt() called from host_alarm_handler() in vl.c because CPUState *env = next_cpu is null.

I tried the patch to check env is not null in host_alarm_handler() and now qemu does not crash.

        CPUState *env = next_cpu;
+       if(env) {
        /* stop the currently executing cpu because a timer occured */
        cpu_interrupt(env, CPU_INTERRUPT_EXIT);
#ifdef USE_KQEMU
        if (env->kqemu_enabled) {
            kqemu_cpu_interrupt(env);
        }
#endif
+       }
        event_pending = 1;
}
Quoted 2 lines

This is very temporary patch and I need to investigate why next_cpu is null but sorry now I dont have enough time.

It is NULL before main_loop starts. I thought the alarm wouldn't occur before main_loop but apparently it happens. A better solution might be not scheduling SIG_ALRM if next_cpu is unset, but that would be more messy. _rearm must execute at least as many times as host_alarm_handler so a check there would be less optimal. I committed your patch.
Cheers