Skip to contentSkip to conversation

Running kvm/use/kvmctl just segfault

DISCUSSION shawn du 3 participants 12 messages Sep 13, 2009 – Sep 16, 2009 KVM

lore
Share & tools
lore

shawn du

author
#0 lore raw

Hi,

No matter what flatfile in the test/x86 directory I provide, it just "Segmentation fault".
Does these tests still work?

Regards,
Shawn

#1 lore raw
Quoted 7 lines · shawn du

Hi,

No matter what flatfile in the test/x86 directory I provide, it just "Segmentation fault".
Does these tests still work?

The tests do work. How are you launching them?

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#2 lore raw

Are these commands right?

./kvmctl -s 1 -m 256 test/x86/smptest.flat
or ./kvmctl -s 1 -m 128 text/x86/bootstrap test/x86/smptest.flat

And I am using Linux kernel 2.6.27.18 downloaded from Ubuntu repository, my qemu-kvm is qemu-kvm-0.11.0-rc1 downloaded from kvm website.

Before that, I just make the kvm/libkvm and the kvm/user directory.

Thanks,
Shawn

Quoted 16 lines · Avi Kivity
Quoted 8 lines · shawn du

Hi,

No matter what flatfile in the test/x86 directory I provide, it just "Segmentation fault".
Does these tests still work?

The tests do work.  How are you launching them?

--
error compiling committee.c: too many arguments to function

#3 lore raw
Quoted 6 lines · shawn du

Are these commands right?

./kvmctl -s 1 -m 256 test/x86/smptest.flat
or ./kvmctl -s 1 -m 128 text/x86/bootstrap test/x86/smptest.flat

That is the correct way. However I haven't tested the smp tests in a while (probably since kvm gained smp support), they're probably completely bitrotted.

I am now in the process of eliminating kvmctl and running the tests through qemu.

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
author
#4 lore raw

Thank you for your information.

Although those tests will be eliminated, I will try to fix them. I just consider running these tests will be an easier and quicker way for me to dissect kvm. If there is another way, please let me know.

Regards,
Shawn

Quoted 21 lines · Avi Kivity
Quoted 7 lines · shawn du

Are these commands right?

./kvmctl -s 1 -m 256 test/x86/smptest.flat
or ./kvmctl -s 1 -m 128 text/x86/bootstrap test/x86/smptest.flat

That is the correct way.  However I haven't tested the smp tests in a while (probably since kvm gained smp support), they're probably completely bitrotted.

I am now in the process of eliminating kvmctl and running the tests through qemu.

--
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.

#5 lore raw
Quoted 6 lines · shawn du

Thank you for your information.

Although those tests will be eliminated, I will try to fix them. I just consider running these tests will be an easier and quicker way for me to dissect kvm. If there is another way, please let me know.

I recommend moving smptest to use the real APIC, not the fake APIC provided by kvmctl.

It's true that kvmctl is a lot easier to understand than qemu, that's a downside of moving the testsuite to qemu.

Signature · 1 line
error compiling committee.c: too many arguments to function
#6 lore raw
Quoted 7 lines · Avi Kivity
Quoted 4 lines · shawn du

Thank you for your information.

Although those tests will be eliminated, I will try to fix them. I just consider running these tests will be an easier and quicker way

for me to dissect kvm. If there is another way, please let me know.

Yes, smp is broken (and its not worthwhile to fix the fake apic support).

Quoted 2 lines

I recommend moving smptest to use the real APIC, not the fake APIC provided by kvmctl.

+1.

Quoted 2 lines

It's true that kvmctl is a lot easier to understand than qemu, that's a downside of moving the testsuite to qemu.

author
#7 lore raw

Well, in fact not only the smp test failed, all tests failed. I don't know it is just me or not. But after debugging the kvmctl main.c and libkvm.c code, I found out that it is the invocation to pre_kvm_run() and post_kvm_run() caused the segfault, it is really mysterious. Then I just commented out them, and the tests (including smp and others) aborted at case KVM_EXIT_EXCEPTION, which seems not successful either.

This is all what I have done up to now. Thank you for your reply.

Shawn

Quoted 21 lines · Marcelo Tosatti
Quoted 7 lines · Avi Kivity
Quoted 4 lines · shawn du

Thank you for your information.

Although those tests will be eliminated, I will try to fix them. I just consider running these tests will be an easier and quicker way

for me to dissect kvm. If there is another way, please let me know.

Yes, smp is broken (and its not worthwhile to fix the fake apic support).

Quoted 2 lines

I recommend moving smptest to use the real APIC, not the fake APIC provided by kvmctl.

+1.

Quoted 2 lines

It's true that kvmctl is a lot easier to understand than qemu, that's a downside of moving the testsuite to qemu.

#8 lore raw
Quoted 9 lines · shawn du

Well, in fact not only the smp test failed, all tests failed. I don't know it is just me or not. But after debugging the kvmctl main.c and libkvm.c code, I found out that it is the invocation to pre_kvm_run() and post_kvm_run() caused the segfault, it is really mysterious. Then I just commented out them, and the tests (including smp and others) aborted at case KVM_EXIT_EXCEPTION, which seems not successful either.

This is all what I have done up to now. Thank you for your reply.

Are you running the latest qemu-kvm.git?

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
author
#9 lore raw

Yes, I am running the latest qemu-kvm.git against the not so latest 2.6.27.18 kernel in Ubuntu 8.10. Normal VMs just run smoothly. Is there a problem?

Shawn

Quoted 19 lines · Avi Kivity
Quoted 10 lines · shawn du

Well, in fact not only the smp test failed, all tests failed. I don't know it is just me or not. But after debugging the kvmctl main.c and libkvm.c code, I found out that it is the invocation to pre_kvm_run() and post_kvm_run() caused the segfault, it is really mysterious. Then I just commented out them, and the tests (including smp and others) aborted at case KVM_EXIT_EXCEPTION, which seems not successful either.

This is all what I have done up to now. Thank you for your reply.

Are you running the latest qemu-kvm.git?

--
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.

#10 lore raw
Quoted 4 lines · shawn du

Yes, I am running the latest qemu-kvm.git against the not so latest 2.6.27.18 kernel in Ubuntu 8.10. Normal VMs just run smoothly. Is there a problem?

It should work. If it doesn't, well, debug it with gdb.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#11 lore raw

After debugging with gdb, I find out the mistake is me.

It turns out that there should be three configures to do: in qemu-kvm root, in kvm, and in kvm/user, sadly, I missed the one in the middle. So, the consequence is that the definition of the type struct kvm_callbacks is different between kvm/user/main.c and kvm/libkvm/libkvm.c, and the consequence is that the kvm->callbacks->pre_kvm_run is a wild pointer.

Still, I don't know it is me or not, the configure in kvm infinitely loops, and says "./configure: line 135: cd: qemu: No such file or directory".
Clearly, there misses a qemu directory in kvm.

Regards,
Shawn

Quoted 13 lines · Avi Kivity
Quoted 5 lines · shawn du

Yes, I am running the latest qemu-kvm.git against the not so latest 2.6.27.18 kernel in Ubuntu 8.10. Normal VMs just run smoothly. Is there a problem?

It should work.  If it doesn't, well, debug it with gdb.

--
error compiling committee.c: too many arguments to function