Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

kraft-compilation: invalid dbg file format (possible bug KVM) #126

Open
Daparrag opened this issue Mar 3, 2023 · 1 comment
Open

kraft-compilation: invalid dbg file format (possible bug KVM) #126

Daparrag opened this issue Mar 3, 2023 · 1 comment
Assignees

Comments

@Daparrag
Copy link

Daparrag commented Mar 3, 2023

Describe the bug
After compiling the helloworld project . I noticed the files helloworld_kvm-x86_64.dbg , helloworld_kvm-x86_64 have different formats. I don't know the exact reason but this miss-mach affect the execution of helloworld_kvm-x86_64.dbg in qemu/kvm environments.

I believe this is highly related with the flags used for compilation.
In order to solve this issue I would need some input form your side.

Environment

  1. OS
Linux 5.19.16-051916-generic #202210150742 SMP PREEMPT_DYNAMIC Sat Oct 15 08:5│6, version 1 (SYSV), statically linked, stripped
6:00 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux 
  1. Compiler
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0                                  
Copyright (C) 2019 Free Software Foundation, Inc.                          
This is free software; see the source for copying conditions.  There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1. Kraft version:
  kraft, version 0.5.0.dev492

To Reproduce
a. follow the get-started guide: https://unikraft.org/docs/getting-started to build the helloworld example for KVM.
b. Identify the miss match between the files by tipping the following command.

$ file helloworld_kvm-x86_64.dbg

helloworld_kvm-x86_64.dbg: **ELF 64-bit** LSB executable, **x86-64**, 
version 1 (SYSV), statically linked, with debug_info, not stripped

$ file helloworld_kvm-x86_64

helloworld_kvm-x86_64: **ELF 32-bit** LSB executable, **Intel 80386**, 
version 1 (SYSV), statically linked, stripped

c. follow the guide for debuging: https://unikraft.org/community/hackathons/sessions/debugging

d. after executing helloworld_kvm-x86_64.dbg as KVM partition for debuging you will notice that QEMU cannot execute the binary because there is an incompatibility

$ sudo qemu-system-x86_64 -s -S -cpu host -enable-kvm -m 128 -nodefaults -no-acpi -display none -nographic -device isa-debu
kg-exit  -kernel unikraft/images/helloworld_kvm-x86_64.dbg -nographic  -append verbose             
-- Output
qemu-system-x86_64: Cannot load x86-64 image, give a 32bit one.

Expected behavior
expect the qemu launch the kvm partition for debugging

Desktop (please complete the following information):

  • OS: [Linux 5.19.16-051916-generic #202210150742 SMP PREEMPT_DYNAMIC Sat Oct 15 08:5│6, version 1 (SYSV), statically linked, stripped]
  • gcc [gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 ]
@Daparrag
Copy link
Author

Daparrag commented Mar 3, 2023

Dears.

About my previous message:
I seams there is not bug at all.

It is just a typo in the documentation:
https://unikraft.org/community/hackathons/sessions/debugging/
https://unikraft.org/docs/develop/debugging/

there is something like:
$ qemu-guest -P -g 1234 -k build/app-helloworld_kvm-x86_64.dbg
but it should be:
$ qemu-guest -P -g 1234 -k build/app-helloworld_kvm-x86_64

Should I fix the documentation and push a commit?

Best.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants