virtme-ng icon indicating copy to clipboard operation
virtme-ng copied to clipboard

segfault in virtme-ng-init

Open jimc opened this issue 1 year ago • 3 comments

this is happening on my desktop, but not laptop. it happens on multiple virtme-ng versions and on multiple kernel versions, v6.11 for example.

[    2.074391] virtme-ng-init: mount devtmpfs -> /dev: EBUSY: Device or resource busy
[    2.136213] systemd-tmpfile[83]: segfault at 565 ip 00007f6df5f85ddf sp 00007ffc2e11f3d8 error 4 in ld-linux-x86-64.so.2[13ddf,7f6df5f73000+28000] likely on CPU 1 (core 1, socket 0)
[    2.137726] Code: c1 68 00 48 8d 0c c5 00 00 00 00 74 0e 48 85 d2 74 09 49 8d 7c 09 58 ff e2 66 90 c3 0f 1f 80 00 00 00 00 89 01 eb cc 0f 1f 40 <00> 49 8d 44 01 58 eb be 66 2e 0f 1f 84 00 00 00 00 00 66 2e 0f 1f
[    2.149653] systemd-tmpfile (83) used greatest stack depth: 12952 bytes left
[    2.154465] virtme-ng-init[1]: segfault at 2cf ip 00007f5127c000da sp 00007ffd784b6818 error 6 in libc.so.6[940da,7f5127b94000+16d000] likely on CPU 3 (core 3, socket 0)
[    2.156736] Code: f3 0f 1e fa 48 8b 05 d5 2e 15 00 48 89 fa 48 83 ca 01 48 89 90 f0 10 00 00 48 8b 16 66 48 0f 6e ce 66 48 0f 6e c2 66 0f 6c c1 <0f> 11 07 48 89 7a 08 48 89 3e 48 c7 80 f0 10 00 00 00 00 00 00 c3
[    2.158736] virtme-ng-init[1]: segfault at 2cf ip 00007f5127c000da sp 00007ffd784b6818 error 6 in libc.so.6[940da,7f5127b94000+16d000] likely on CPU 3 (core 3, socket 0)
[    2.159374] Code: f3 0f 1e fa 48 8b 05 d5 2e 15 00 48 89 fa 48 83 ca 01 48 89 90 f0 10 00 00 48 8b 16 66 48 0f 6e ce 66 48 0f 6e c2 66 0f 6c c1 <0f> 11 07 48 89 7a 08 48 89 3e 48 c7 80 f0 10 00 00 00 00 00 00 c3
[    2.160261] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    2.160910] CPU: 3 UID: 0 PID: 1 Comm: virtme-ng-init Not tainted 6.11.0-dd-00101-g733170a09f16 #2
[    2.161084] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014
[    2.161084] Call Trace:
[    2.161084]  <TASK>
[    2.161084]  dump_stack_lvl+0x4e/0x70
[    2.161084]  panic+0x113/0x2b1
[    2.161084]  do_exit.cold+0x15/0x3c
[    2.161084]  do_group_exit+0x30/0x80
[    2.161084]  get_signal+0x8e6/0x8f0
[    2.161084]  arch_do_signal_or_restart+0x3b/0x240
[    2.161084]  irqentry_exit_to_user_mode+0xdb/0x120
[    2.161084]  asm_exc_page_fault+0x26/0x30
[    2.161084] RIP: 0033:0x7f5127c000da
[    2.161084] Code: f3 0f 1e fa 48 8b 05 d5 2e 15 00 48 89 fa 48 83 ca 01 48 89 90 f0 10 00 00 48 8b 16 66 48 0f 6e ce 66 48 0f 6e c2 66 0f 6c c1 <0f> 11 07 48 89 7a 08 48 89 3e 48 c7 80 f0 10 00 00 00 00 00 00 c3
[    2.161084] RSP: 002b:00007ffd784b6818 EFLAGS: 00000206
[    2.161084] RAX: 00007f5127dee000 RBX: 000000000000000f RCX: 00007f5127dee000
[    2.161084] RDX: 00007f5127def0b8 RSI: 00007f5127def0b8 RDI: 00000000000002cf
[    2.161084] RBP: 00007ffd784b6960 R08: 00000000ffffffff R09: 0000000000000000
[    2.161084] R10: 0000000000200000 R11: 0000000000001000 R12: 00007ffd784b6830
[    2.161084] R13: 0000559098b2b606 R14: 00007f5127dee000 R15: 00007f5127dcba72
[    2.161084]  </TASK>
[    2.161084] Kernel Offset: 0x20800000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[    2.161084] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---




jimc avatar Oct 10 '24 16:10 jimc

Hm.. it looks like systemd-tmpfile is also segfaulting. Are you booting in a separate rootfs than your host's rootfs (using --root)? I'm wondering if there's a libc / ld-linux incompatibility with the binaries between the host's rootfs and the guest's rootfs.

arighi avatar Oct 13 '24 07:10 arighi

This might not be it, but I would try with this file having at least "--qemu-opts": "-cpu host" in it.

❯ cat ~/.config/virtme-ng/virtme-ng.conf 
{
"default_opts" : {
    "user": "root",
    "--qemu-opts": "-cpu host"
}
}

I ran into a similar looking issue (presumably due to my non-standard-ish setup) and those two were enough to get VM's booted/running.

cpu in particular felt a bit like the default maybe should be host due to x86-64-level being an increasingly common thing, but idk.

likewhatevs avatar Oct 13 '24 18:10 likewhatevs

-cpu host fixed it for me as well. my setup include running virtme-ng in docker container that is itself in a KVM

jeromecst avatar Oct 25 '24 13:10 jeromecst