Bug 910264

Summary: libvirtd: SEGFAULT when creating xen domain
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Pluskal <mpluskal>
Component: BasesystemAssignee: Charles Arnold <carnold>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: carnold, cyliu, jdouglas, jfehlig, mlatimer
Version: 201412*   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: libvirt bt

Description Martin Pluskal 2014-12-16 10:11:00 UTC
Created attachment 617411 [details]
libvirt bt

When creating xen paravirtualized vm, via virt-manager (all from current Virtualization repository), following occurs:
# virt-manager --debug
[Tue, 16 Dec 2014 11:05:15 virt-manager 2223] DEBUG (installer:186) Removing /var/lib/xen/virtinst-vmlinuz-xen.21rmIS
[Tue, 16 Dec 2014 11:05:15 virt-manager 2223] DEBUG (installer:186) Removing /var/lib/xen/virtinst-initrd-xen.EzL2i6
[Tue, 16 Dec 2014 11:05:15 virt-manager 2223] DEBUG (connection:1124) Error polling connection xen:///
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 1104, in tick
    self._tick(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/connection.py", line 1157, in _tick
    self.hostinfo = self._backend.getInfo()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3677, in getInfo
    if ret is None: raise libvirtError ('virNodeGetInfo() failed', conn=self)
libvirtError: internal error: received hangup / error event on socket
[Tue, 16 Dec 2014 11:05:15 virt-manager 2223] DEBUG (connection:882) conn.close() uri=xen:///
[Tue, 16 Dec 2014 11:05:15 virt-manager 2223] DEBUG (connection:900) Failed to deregister events in conn cleanup
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 895, in close
    self._backend.domainEventDeregisterAny(eid)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4752, in domainEventDeregisterAny
    if ret == -1: raise libvirtError ('virConnectDomainEventDeregisterAny() failed', conn=self)
libvirtError: internal error: client socket is closed
[Tue, 16 Dec 2014 11:05:15 virt-manager 2223] DEBUG (create:179) Closing new vm wizard
[Tue, 16 Dec 2014 11:05:15 virt-manager 2223] DEBUG (error:80) error dialog message:
summary=Error polling connection 'xen:///': internal error: received hangup / error event on socket
details=Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 355, in _handle_tick_queue
    conn.tick(**kwargs)
  File "/usr/share/virt-manager/virtManager/connection.py", line 1135, in tick
    raise e  # pylint: disable=raising-bad-type
libvirtError: internal error: received hangup / error event on socket

And dmesg shows:
libvirtd[1648]: segfault at 7 ip 00007fae4047f934 sp 00007fae3924f108 error 6 in libc-2.20.so[7fae403fb000+194000

From bt:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fbc486ef700 (LWP 2546)]
__memset_sse2 () at ../sysdeps/x86_64/memset.S:78
78              movdqu  %xmm8, (%rdi)
(gdb) bt
#0  __memset_sse2 () at ../sysdeps/x86_64/memset.S:78
#1  0x00007fbc415ddacd in memset (__len=102400, __ch=0, __dest=0xffffffffffffffff) at /usr/include/bits/string3.h:84
#2  xc__hypercall_buffer_alloc_pages (xch=xch@entry=0x7fbc100011b0, b=b@entry=0x7fbc486d6180, nr_pages=nr_pages@entry=25) at xc_hcall_buf.c:138
#3  0x00007fbc415ddc4c in xc__hypercall_buffer_alloc (xch=xch@entry=0x7fbc100011b0, b=b@entry=0x7fbc486d6180, size=<optimized out>) at xc_hcall_buf.c:162
#4  0x00007fbc415ddcb9 in xc__hypercall_bounce_pre (xch=xch@entry=0x7fbc100011b0, b=b@entry=0x7fbc486d6180) at xc_hcall_buf.c:204
#5  0x00007fbc415ccf71 in xc_domain_getinfolist (xch=0x7fbc100011b0, first_domain=first_domain@entry=0, max_domains=max_domains@entry=1024, info=info@entry=0x7fbc486d6280) at xc_domain.c:374
#6  0x00007fbc417fdd60 in libxl_list_domain (ctx=ctx@entry=0x7fbc10018e50, nb_domain_out=nb_domain_out@entry=0x7fbc486ee2dc) at libxl.c:555
#7  0x00007fbc4181e1c4 in libxl_name_to_domid (ctx=ctx@entry=0x7fbc10018e50, name=name@entry=0x7fbc10005390 "opensuse13", domid=domid@entry=0x7fbc486ee38c) at libxl_utils.c:73
#8  0x00007fbc417fd4bb in libxl__domain_rename (gc=gc@entry=0x7fbc10001000, domid=2, old_name=old_name@entry=0x0, new_name=0x7fbc10005390 "opensuse13", trans=trans@entry=2) at libxl.c:306
#9  0x00007fbc4180c55b in libxl__domain_make (gc=gc@entry=0x7fbc10001000, info=info@entry=0x7fbc486ee6f0, domid=domid@entry=0x7fbc486ee52c) at libxl_create.c:552
#10 0x00007fbc4180d39a in initiate_domain_create (dcs=0x7fbc1001a470, egc=0x7fbc486ee530) at libxl_create.c:760
#11 do_domain_create (ctx=<optimized out>, d_config=d_config@entry=0x7fbc486ee6f0, domid=domid@entry=0x7fbc486ee630, restore_fd=restore_fd@entry=-1, checkpointed_stream=checkpointed_stream@entry=0, ao_how=ao_how@entry=0x0, 
    aop_console_how=aop_console_how@entry=0x0) at libxl_create.c:1374
#12 0x00007fbc4180d7dc in libxl_domain_create_new (ctx=<optimized out>, d_config=d_config@entry=0x7fbc486ee6f0, domid=domid@entry=0x7fbc486ee630, ao_how=ao_how@entry=0x0, aop_console_how=aop_console_how@entry=0x0)
    at libxl_create.c:1397
#13 0x00007fbc41a66396 in libxlDomainStart (driver=driver@entry=0x7fbc3800bed0, vm=vm@entry=0x7fbc10001070, start_paused=start_paused@entry=false, restore_fd=restore_fd@entry=-1) at libxl/libxl_domain.c:1246
#14 0x00007fbc41a6c683 in libxlDomainCreateXML (conn=0x7fbc340009a0, xml=<optimized out>, flags=0) at libxl/libxl_driver.c:659
#15 0x00007fbc4ff8761c in virDomainCreateXML (conn=0x7fbc340009a0, 
    xmlDesc=0x7fbc10018a80 "<domain type=\"xen\">\n  <name>opensuse13</name>\n  <uuid>ba5cf724-a394-4d1b-a4a4-b3a5e69d521b</uuid>\n  <memory>1048576</memory>\n  <currentMemory>1048576</currentMemory>\n  <vcpu>1</vcpu>\n  <os>\n    <type "..., flags=0) at libvirt-domain.c:180
#16 0x00007fbc50a4d854 in remoteDispatchDomainCreateXML (server=<optimized out>, msg=<optimized out>, ret=0x7fbc1001b910, args=0x7fbc10018800, rerr=0x7fbc486eec50, client=0x7fbc525a3fa0) at remote_dispatch.h:3303
#17 remoteDispatchDomainCreateXMLHelper (server=<optimized out>, client=0x7fbc525a3fa0, msg=<optimized out>, rerr=0x7fbc486eec50, args=0x7fbc10018800, ret=0x7fbc1001b910) at remote_dispatch.h:3283
#18 0x00007fbc4fffeab2 in virNetServerProgramDispatchCall (msg=0x7fbc525a3f30, client=0x7fbc525a3fa0, server=0x7fbc525986b0, prog=0x7fbc5259fd00) at rpc/virnetserverprogram.c:437
#19 virNetServerProgramDispatch (prog=0x7fbc5259fd00, server=server@entry=0x7fbc525986b0, client=0x7fbc525a3fa0, msg=0x7fbc525a3f30) at rpc/virnetserverprogram.c:307
#20 0x00007fbc50a5b41d in virNetServerProcessMsg (msg=<optimized out>, prog=<optimized out>, client=<optimized out>, srv=0x7fbc525986b0) at rpc/virnetserver.c:172
#21 virNetServerHandleJob (jobOpaque=<optimized out>, opaque=0x7fbc525986b0) at rpc/virnetserver.c:193
#22 0x00007fbc4fef91c5 in virThreadPoolWorker (opaque=opaque@entry=0x7fbc525a1330) at util/virthreadpool.c:144
#23 0x00007fbc4fef8c31 in virThreadHelper (data=<optimized out>) at util/virthread.c:197
#24 0x00007fbc4fc273a4 in start_thread (arg=0x7fbc486ef700) at pthread_create.c:310
#25 0x00007fbc4f966a4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
Comment 1 James Fehlig 2014-12-18 02:42:45 UTC
Charles is seeing a similar segfault on a fresh install of openSUSE 13.2 "GA", i.e. 13.2 with no updates.  Charles, did I say that right?  Or does the segfault only occur after applying the updates?
Comment 2 Charles Arnold 2014-12-18 13:21:32 UTC
(In reply to Jim Fehlig from comment #1)
> Charles is seeing a similar segfault on a fresh install of openSUSE 13.2
> "GA", i.e. 13.2 with no updates.  Charles, did I say that right?  Or does
> the segfault only occur after applying the updates?

It occurs with both.  This bug appears to be the same as 909547.
Comment 3 James Fehlig 2014-12-19 17:54:01 UTC
We are missing 537c9c77-libxc-check-return-values-on-mmap-and-madvise.patch in 13.2/Factory.  With that patch applied, I'm able to start domains on 13.2/Factory.

Reassigning to Charles.  I would fix it, but he keeps xen synced across these various code streams and might want to investigate a bug in that process.

Also, I noticed the xen-xend-tools package is being built for 13.2 (and Factory too I suppose).  For enabling/disabling building xend, I think the spec file logic could be simplified with something like:

%define with_xend   0
%if %suse_version < 1315
%define with_xend   1
%endif
Comment 4 Charles Arnold 2015-01-07 21:12:58 UTC
(In reply to Jim Fehlig from comment #3)
> We are missing 537c9c77-libxc-check-return-values-on-mmap-and-madvise.patch
> in 13.2/Factory.  With that patch applied, I'm able to start domains on
> 13.2/Factory.

A maintenance release has been submitted for 13.2 (mr#280175).
The Virtualization:openSUSE13.2/xen repo has the RPMs.
Factory will be getting Xen version 4.5 in about two weeks which
contains this fix.