runtimejs / runtime

[not maintained] Lightweight JavaScript library operating system for the cloud
http://runtimejs.org
Apache License 2.0
1.93k stars 128 forks source link

qemu-net "Kernel error: Assertion failed: buf (src/kernel/initrd.cc: Init: 22)" #31

Closed cjb closed 9 years ago

cjb commented 9 years ago

Not sure whether this is really a bug, but: qemu-kvm works fine, qemu-net fails with:

Memory map addr 36864, len 120
RANGE 32 MB - 508 MB
Detected available 478 MiB of memory.
T0 ident pages : 16, loc 1 = 2000000, loc 2 = 1a00000
CR3 value = 0x1a00000
Kernel error: Assertion failed: buf (src/kernel/initrd.cc: Init: 22)

If I add "-enable-kvm" to the boot args in qemu-net.sh, it works.

iefserge commented 9 years ago

Thanks for the information. Looks like the initrd package is loaded incorrectly. What qemu version do you use? And please post your full qemu command line in case you changed qemu-net.sh file.

cjb commented 9 years ago

Hi, it's:

QEMU emulator version 1.5.0 (Debian 1.5.0+dfsg-3ubuntu5.4), Copyright (c) 2003-2008 Fabrice Bellard

as shipped in Ubuntu 13.10. The same version works when I just add -enable-kvm, so I guess it can't be a general problem with initrd support.

git diff is empty and I'm at master HEAD (a041f13dd923b), so it's definitely unchanged.

cjb commented 9 years ago

By the way, qemu.sh / qemu-snapshot.sh / qemu-test.sh all fail too. So it's not "net is broken", it's "only KVM works".

cjb commented 9 years ago

The same setup works on Ubuntu 14.04, which ships qemu 2.0.0, so I think it would be reasonable to close this as an upstream qemu bug fixed in 2.0.0, and maybe add a note somewhere about the requirement. Or I can do more debugging if you can think of anything to try.

iefserge commented 9 years ago

Added a note to wiki and readme. Looks like different versions of QEMU load modules differently. I'll look into it.

You can try to uncomment this line https://github.com/runtimejs/runtime/blob/master/src/kernel/kernel-main.cc#L116 (not sure if this will fix the problem).

cjb commented 9 years ago

Yep, uncommenting that line worked!

cjb commented 9 years ago

The uncommented version works on qemu-2.0 too -- is there a reason not to leave it uncommented for everyone?

iefserge commented 9 years ago

I think there was a problem with real hardware boot (using GRUB). This needs more testing.

iefserge commented 9 years ago

Looks like it works in GRUB with line uncommented. Pushed into master https://github.com/runtimejs/runtime/commit/5736489296818aecf9deaec55c7e3a49bf4e4750