qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Qemu master crashing on boot when using file backend for memory
@ 2020-03-12  5:36 Raphael Norwitz
  2020-03-12 10:54 ` Igor Mammedov
  0 siblings, 1 reply; 4+ messages in thread
From: Raphael Norwitz @ 2020-03-12  5:36 UTC (permalink / raw)
  To: qemu-devel

When I try run master qemu I am hitting a divide by zero error. It seems
to be coming from util/oslib-posix.c in touch_all_pages(). see line 477:

numpages_per_thread = numpages / memset_num_threads;

Poking around the crash dumps, I can see that the smp_cpus parameter
passed in to touch_all_pages() is 0. Going up the stack to
host_memory_backend_memory_complete() I see backend->prealloc_threads is
also 0.

Here’s how I am running qemu

./x86_64-softmmu/qemu-system-x86_64 \
	-kernel /boot/vmlinuz-3.10.0-1062.el7.x86_64  \
 	-netdev user,id=net0,hostfwd=tcp::2250-:22 \
	-device e1000e,netdev=net0 \
	-m 1G \
	-initrd /boot/initramfs-3.10.0-1062.el7.x86_64.img  \
	-object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=mem,share=yes,size=1G \
	-numa node,nodeid=0,cpus=0,memdev=ram-node0 

I don't see this error on a slightly older qemu, as of commit 105b07f1
(January 27th).

Interestingly when I remove the memory-backend-file parameter I don’t
see the error, i.e. this works:

./x86_64-softmmu/qemu-system-x86_64 \
	-kernel /boot/vmlinuz-3.10.0-1062.el7.x86_64  \
 	-netdev user,id=net0,hostfwd=tcp::2250-:22 \
	-device e1000e,netdev=net0 \
	-m 1G \
	-initrd /boot/initramfs-3.10.0-1062.el7.x86_64.img

Looking at the blame data for backends/hostmem.c I see commit ffac16fa
introduced some churn in this part of the code. Has anyone else seen
this issue? Could I be doing something wrong here?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Qemu master crashing on boot when using file backend for memory
  2020-03-12  5:36 Qemu master crashing on boot when using file backend for memory Raphael Norwitz
@ 2020-03-12 10:54 ` Igor Mammedov
  2020-03-25  2:50   ` Raphael Norwitz
  0 siblings, 1 reply; 4+ messages in thread
From: Igor Mammedov @ 2020-03-12 10:54 UTC (permalink / raw)
  To: Raphael Norwitz; +Cc: qemu-devel

On Thu, 12 Mar 2020 01:36:48 -0400
Raphael Norwitz <raphael.norwitz@nutanix.com> wrote:

> When I try run master qemu I am hitting a divide by zero error. It seems
> to be coming from util/oslib-posix.c in touch_all_pages(). see line 477:
> 
> numpages_per_thread = numpages / memset_num_threads;
> 
> Poking around the crash dumps, I can see that the smp_cpus parameter
> passed in to touch_all_pages() is 0. Going up the stack to
> host_memory_backend_memory_complete() I see backend->prealloc_threads is
> also 0.
> 
> Here’s how I am running qemu
> 
> ./x86_64-softmmu/qemu-system-x86_64 \
> 	-kernel /boot/vmlinuz-3.10.0-1062.el7.x86_64  \
>  	-netdev user,id=net0,hostfwd=tcp::2250-:22 \
> 	-device e1000e,netdev=net0 \
> 	-m 1G \
> 	-initrd /boot/initramfs-3.10.0-1062.el7.x86_64.img  \
> 	-object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=mem,share=yes,size=1G \
> 	-numa node,nodeid=0,cpus=0,memdev=ram-node0 
> 
> I don't see this error on a slightly older qemu, as of commit 105b07f1
> (January 27th).
> 
> Interestingly when I remove the memory-backend-file parameter I don’t
> see the error, i.e. this works:
> 
> ./x86_64-softmmu/qemu-system-x86_64 \
> 	-kernel /boot/vmlinuz-3.10.0-1062.el7.x86_64  \
>  	-netdev user,id=net0,hostfwd=tcp::2250-:22 \
> 	-device e1000e,netdev=net0 \
> 	-m 1G \
> 	-initrd /boot/initramfs-3.10.0-1062.el7.x86_64.img
> 
> Looking at the blame data for backends/hostmem.c I see commit ffac16fa
> introduced some churn in this part of the code. Has anyone else seen
> this issue? Could I be doing something wrong here?

It's know issue, see
 "[PATCH] oslib-posix: initialize mutex and condition variable
for a fix
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Qemu master crashing on boot when using file backend for memory
  2020-03-12 10:54 ` Igor Mammedov
@ 2020-03-25  2:50   ` Raphael Norwitz
  2020-03-25  9:46     ` Igor Mammedov
  0 siblings, 1 reply; 4+ messages in thread
From: Raphael Norwitz @ 2020-03-25  2:50 UTC (permalink / raw)
  To: Igor Mammedov; +Cc: qemu-devel

On Thu, Mar 12, 2020 at 11:54:50AM +0100, Igor Mammedov wrote:
> 
> On Thu, 12 Mar 2020 01:36:48 -0400
> Raphael Norwitz <raphael.norwitz@nutanix.com> wrote:
> 
> > When I try run master qemu I am hitting a divide by zero error. It seems
> > to be coming from util/oslib-posix.c in touch_all_pages(). see line 477:
> > 
> > numpages_per_thread = numpages / memset_num_threads;
> > 
> > Poking around the crash dumps, I can see that the smp_cpus parameter
> > passed in to touch_all_pages() is 0. Going up the stack to
> > host_memory_backend_memory_complete() I see backend->prealloc_threads is
> > also 0.
> > 
> > Here’s how I am running qemu
> > 
> > ./x86_64-softmmu/qemu-system-x86_64 \
> > 	-kernel /boot/vmlinuz-3.10.0-1062.el7.x86_64  \
> >  	-netdev user,id=net0,hostfwd=tcp::2250-:22 \
> > 	-device e1000e,netdev=net0 \
> > 	-m 1G \
> > 	-initrd /boot/initramfs-3.10.0-1062.el7.x86_64.img  \
> > 	-object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=mem,share=yes,size=1G \
> > 	-numa node,nodeid=0,cpus=0,memdev=ram-node0 
> > 
> > I don't see this error on a slightly older qemu, as of commit 105b07f1
> > (January 27th).
> > 
> > Interestingly when I remove the memory-backend-file parameter I don’t
> > see the error, i.e. this works:
> > 
> > ./x86_64-softmmu/qemu-system-x86_64 \
> > 	-kernel /boot/vmlinuz-3.10.0-1062.el7.x86_64  \
> >  	-netdev user,id=net0,hostfwd=tcp::2250-:22 \
> > 	-device e1000e,netdev=net0 \
> > 	-m 1G \
> > 	-initrd /boot/initramfs-3.10.0-1062.el7.x86_64.img
> > 
> > Looking at the blame data for backends/hostmem.c I see commit ffac16fa
> > introduced some churn in this part of the code. Has anyone else seen
> > this issue? Could I be doing something wrong here?
> 
> It's know issue, see
>  "[PATCH] oslib-posix: initialize mutex and condition variable
> for a fix
> > 
>

I'm testing on qemu master now. Looks like this patch has been merged
and I'm still seeing the same crash.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Qemu master crashing on boot when using file backend for memory
  2020-03-25  2:50   ` Raphael Norwitz
@ 2020-03-25  9:46     ` Igor Mammedov
  0 siblings, 0 replies; 4+ messages in thread
From: Igor Mammedov @ 2020-03-25  9:46 UTC (permalink / raw)
  To: Raphael Norwitz; +Cc: qemu-devel

On Tue, 24 Mar 2020 22:50:46 -0400
Raphael Norwitz <raphael.norwitz@nutanix.com> wrote:

> On Thu, Mar 12, 2020 at 11:54:50AM +0100, Igor Mammedov wrote:
> > 
> > On Thu, 12 Mar 2020 01:36:48 -0400
> > Raphael Norwitz <raphael.norwitz@nutanix.com> wrote:
> >   
> > > When I try run master qemu I am hitting a divide by zero error. It seems
> > > to be coming from util/oslib-posix.c in touch_all_pages(). see line 477:
> > > 
> > > numpages_per_thread = numpages / memset_num_threads;
> > > 
> > > Poking around the crash dumps, I can see that the smp_cpus parameter
> > > passed in to touch_all_pages() is 0. Going up the stack to
> > > host_memory_backend_memory_complete() I see backend->prealloc_threads is
> > > also 0.
> > > 
> > > Here’s how I am running qemu
> > > 
> > > ./x86_64-softmmu/qemu-system-x86_64 \
> > > 	-kernel /boot/vmlinuz-3.10.0-1062.el7.x86_64  \
> > >  	-netdev user,id=net0,hostfwd=tcp::2250-:22 \
> > > 	-device e1000e,netdev=net0 \
> > > 	-m 1G \
> > > 	-initrd /boot/initramfs-3.10.0-1062.el7.x86_64.img  \
> > > 	-object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=mem,share=yes,size=1G \
> > > 	-numa node,nodeid=0,cpus=0,memdev=ram-node0 
> > > 
> > > I don't see this error on a slightly older qemu, as of commit 105b07f1
> > > (January 27th).
> > > 
> > > Interestingly when I remove the memory-backend-file parameter I don’t
> > > see the error, i.e. this works:
> > > 
> > > ./x86_64-softmmu/qemu-system-x86_64 \
> > > 	-kernel /boot/vmlinuz-3.10.0-1062.el7.x86_64  \
> > >  	-netdev user,id=net0,hostfwd=tcp::2250-:22 \
> > > 	-device e1000e,netdev=net0 \
> > > 	-m 1G \
> > > 	-initrd /boot/initramfs-3.10.0-1062.el7.x86_64.img
> > > 
> > > Looking at the blame data for backends/hostmem.c I see commit ffac16fa
> > > introduced some churn in this part of the code. Has anyone else seen
> > > this issue? Could I be doing something wrong here?  
> > 
> > It's know issue, see
> >  "[PATCH] oslib-posix: initialize mutex and condition variable
> > for a fix  
> > >   
> >  
> 
> I'm testing on qemu master now. Looks like this patch has been merged
> and I'm still seeing the same crash.

Thanks for report, fix is on the way to qemu-devel



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-25  9:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12  5:36 Qemu master crashing on boot when using file backend for memory Raphael Norwitz
2020-03-12 10:54 ` Igor Mammedov
2020-03-25  2:50   ` Raphael Norwitz
2020-03-25  9:46     ` Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).