Xen BUG at page_alloc.c:1738 (Xen 4.5)
Hello there,
I've been doing some testing of Xen 4.5 on Fedora 22 (due out within a week) and I have an error that prevents the server from booting in the very early boot process:
Quoted 11 lines
(XEN) Xen call trace:
(XEN) [<ffff82d08011d160>] free_domheap_pages+0x240/0x430 (XEN) [<ffff82d08018c944>] mmio_ro_do_page_fault+0x114/0x160 (XEN) [<ffff82d0801a4c10>] do_page_fault+0x1a0/0x4f0 (XEN) [<ffff82d080239768>] handle_exception_saved+0x2e/0x6c(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Xen BUG at page_alloc.c:1738
(XEN) ****************************************
The full output is over in a Github Gist[1].
I've tested this on some physical machines (Dell, HP, and SuperMicro servers) as well as within a KVM virtual machine but I get the same boot error each time. It occurs with Xen 4.5 and Linux 3.17-4.0.x. Xen 4.5.1-rc1 fails in the same way. I've opened a Red Hat Bug[2] as well as a Xen bug[3] on it.
The code within free_domheap_pages() hasn't changed much since late 2014 so I'm not sure if that's the culprit. Does anyone have any suggestions on how to debug it further?
Thanks in advance!
[1] https://gist.github.com/major/baa0e2eee7de51a2bcd1
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1219197
[3] http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1908
--
Major Hayden
Quoted 19 lines · Major Hayden
Hello there,
I've been doing some testing of Xen 4.5 on Fedora 22 (due out within a week) and I have an error that prevents the server from booting in the very early boot process:
Quoted 11 lines
(XEN) Xen call trace:
(XEN) [<ffff82d08011d160>] free_domheap_pages+0x240/0x430 (XEN) [<ffff82d08018c944>] mmio_ro_do_page_fault+0x114/0x160 (XEN) [<ffff82d0801a4c10>] do_page_fault+0x1a0/0x4f0 (XEN) [<ffff82d080239768>] handle_exception_saved+0x2e/0x6c(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Xen BUG at page_alloc.c:1738
(XEN) ****************************************The full output is over in a Github Gist[1].
I've tested this on some physical machines (Dell, HP, and SuperMicro servers) as well as within a KVM virtual machine but I get the same boot error each time. It occurs with Xen 4.5 and Linux 3.17-4.0.x. Xen 4.5.1-rc1 fails in the same way. I've opened a Red Hat Bug[2] as well as a Xen bug[3] on it.
Quoted 7 lines
The code within
free_domheap_pages()hasn't changed much since late 2014 so I'm not sure if that's the culprit. Does anyone have any suggestions on how to debug it further?Thanks in advance!
[1] https://gist.github.com/major/baa0e2eee7de51a2bcd1
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1219197
[3] http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1908
Can you try a debug hypervisor and rerun, to confirm the stack trace and see whether any assertions fire.
Can you identify exactly which line xen/common/page_alloc.c:1738 is in your source?
~Andrew
I compiled Xen with debugging enabled and it appears to pass the initial boot but then fails later in the boot process. I'm working through that now. Here's what my source of page_alloc.c looks like around line 1738:
1731 if ( likely(d) && likely(d != dom_cow) )
1732 {
1733 /* NB. May recursively lock from relinquish_memory(). */
1734 spin_lock_recursive(&d->page_alloc_lock);
1735
1736 for ( i = 0; i < (1 << order); i++ )
1737 {
1738 BUG_ON((pg[i].u.inuse.type_info & PGT_count_mask) != 0);
1739 page_list_del2(&pg[i], &d->page_list,&d->arch.relmem_list);
1740 }
1741
1742 drop_dom_ref = !domain_adjust_tot_pages(d, -(1 << order));
1743
1744 spin_unlock_recursive(&d->page_alloc_lock);
1745
1746 /*
1747 * Normally we expect a domain to clear pages before
freeing them,
1748 * if it cares about the secrecy of their contents.
However, after
1749 * a domain has died we assume responsibility for erasure.
1750 */
1751 scrub = !!d->is_dying;
1752 }
Quoted 6 lines · Andrew Cooper
Can you try a debug hypervisor and rerun, to confirm the stack trace and see whether any assertions fire.
Can you identify exactly which line
xen/common/page_alloc.c:1738is in your source?
Signature · 1 line
Major Hayden
Quoted 17 lines
Quoted 1 line
Quoted 1 line · On 19.05.15 at 20:06, <[email protected]> wrote:
I've been doing some testing of Xen 4.5 on Fedora 22 (due out within a week) and I have an error that prevents the server from booting in the very early boot process:
Quoted 11 lines
(XEN) Xen call trace:
(XEN) [<ffff82d08011d160>] free_domheap_pages+0x240/0x430 (XEN) [<ffff82d08018c944>] mmio_ro_do_page_fault+0x114/0x160 (XEN) [<ffff82d0801a4c10>] do_page_fault+0x1a0/0x4f0 (XEN) [<ffff82d080239768>] handle_exception_saved+0x2e/0x6c(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Xen BUG at page_alloc.c:1738
(XEN) ****************************************
Quoted 5 lines
The full output is over in a Github Gist[1].
I've tested this on some physical machines (Dell, HP, and SuperMicro servers) as well as within a KVM virtual machine but I get the same boot error each time.
Considering that no-one else is seeing this - is this perhaps connected to you building Xen with pre-release gcc 5.0.1? This is also because in order for the above to indeed occur, mmio_ro_do_page_fault()'s put_page() would need to drop the last reference of a page, yet page_get_owner_and_reference() doesn't obtain a reference when a page is unallocated (and hence unowned), i.e. normally a page would have a refcount of at least 2 here. Hence this would be possible only due to a race, but the exact same race to be observed on different hardware _and_ under an emulator is extremely unlikely.
Jan
Quoted 9 lines · Jan Beulich
Considering that no-one else is seeing this - is this perhaps connected to you building Xen with pre-release gcc 5.0.1? This is also because in order for the above to indeed occur, mmio_ro_do_page_fault()'s
put_page()would need to drop the last reference of a page, yetpage_get_owner_and_reference()doesn't obtain a reference when a page is unallocated (and hence unowned), i.e. normally a page would have a refcount of at least 2 here. Hence this would be possible only due to a race, but the exact same race to be observed on different hardware _and_ under an emulator is extremely unlikely.
That could be a possibility. There is one Fedora patch[1] to fix a GCC 5 compile error but that's probably unrelated to the crash.
I'm still hunting around to see what I can figure out.
[1] http://pkgs.fedoraproject.org/cgit/xen.git/tree/?h=f22
--
Major Hayden
Quoted 10 lines · Major Hayden
Quoted 9 lines · Jan Beulich
Considering that no-one else is seeing this - is this perhaps connected to you building Xen with pre-release gcc 5.0.1? This is also because in order for the above to indeed occur, mmio_ro_do_page_fault()'s
put_page()would need to drop the last reference of a page, yetpage_get_owner_and_reference()doesn't obtain a reference when a page is unallocated (and hence unowned), i.e. normally a page would have a refcount of at least 2 here. Hence this would be possible only due to a race, but the exact same race to be observed on different hardware _and_ under an emulator is extremely unlikely.
You could try with the xen.gz file from
https://copr-be.cloud.fedoraproject.org/results/myoung/xentest/fedora-21-x86_64/xen-4.5.1-0.rc1.fc21/xen-hypervisor-4.5.1-0.rc1.fc21.x86_64.rpm
It is roughly the same version of xen but built against Fedora 21 and gcc 4.9.2. If that works then it probably is gcc 5.
Michael Young