Bug 436772 - xentop segmentation fault [regression]
xentop segmentation fault [regression]
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen (Show other bugs)
All Linux
high Severity medium
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
: Regression
Depends On:
  Show dependency treegraph
Reported: 2008-03-10 08:11 EDT by Adam Stokes
Modified: 2010-10-22 19:08 EDT (History)
3 users (show)

See Also:
Fixed In Version: RHBA-2008-0305
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-21 11:21:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Fix physinfo compat crash (698 bytes, patch)
2008-03-14 10:21 EDT, Daniel Berrange
no flags Details | Diff

  None (edit)
Description Adam Stokes 2008-03-10 08:11:18 EDT
Description of problem:
On IA64, xentop does not work, it causes segmentation fault.

Version-Release number of selected component (if applicable):
Also, this issue occured even with 3.0.3-44.el5.

How reproducible:

Steps to Reproduce:
1. run xentop on ia64
Actual results:
reproduced on ia64 box. It seems this segfault doesn't occur with x86 box.

# gdb /usr/sbin/xentop core.3840
GNU gdb Red Hat Linux (6.5-25.el5_1.1rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/libxenstore.so.3.0...Reading symbols from
Loaded symbols for /usr/lib/libxenstore.so.3.0
Reading symbols from /usr/lib/libxenctrl.so.3.0...Reading symbols from
Loaded symbols for /usr/lib/libxenctrl.so.3.0
Reading symbols from /usr/lib/libncurses.so.5...done.
Loaded symbols for /usr/lib/libncurses.so.5
Reading symbols from /lib/libc.so.6.1...done.
Loaded symbols for /lib/libc.so.6.1
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/ld-linux-ia64.so.2...done.
Loaded symbols for /lib/ld-linux-ia64.so.2
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Core was generated by `xentop'.
Program terminated with signal 11, Segmentation fault.
#0  0x2000000000079940 in xc_physinfo (xc_handle=3, put_info=0x60000fffff9e3558)
at xc_misc.c:87
87                  cpu_to_node[0] = NUMA_NO_NODE;
(gdb) bt
#0  0x2000000000079940 in xc_physinfo (xc_handle=3, put_info=0x60000fffff9e3558)
at xc_misc.c:87
#1  0x40000000000086f0 in xenstat_get_node (handle=0x6000000000010010, flags=15)
at src/xenstat.c:152
#2  0x4000000000004860 in top () at xentop.c:947
#3  0x4000000000006f70 in main (argc=<value optimized out>,
argv=0x60000fffff9e3a38) at xentop.c:1073
#4  0x20000000001636f0 in __libc_start_main () from /lib/libc.so.6.1
#5  0x4000000000002600 in _start ()

Expected results:
xentop works

Additional info:
int xc_physinfo(int xc_handle,
               xc_physinfo_t *put_info)
   int ret;

   sysctl.cmd = XEN_SYSCTL_physinfo;

   memcpy(&sysctl.u.physinfo, put_info, sizeof(*put_info));

    * RHEL5 ABI compat.
    * Try new physinfo sysctl first in case HV supports
    * NUMA info, else fallback to original ABI
   if ( (ret = do_sysctl_version(xc_handle, &sysctl,
       /* EACCESS indicates old HV version */
       if (errno == EACCES) {
           uint32_t *cpu_to_node;

           if ( (ret = do_sysctl(xc_handle, &sysctl)) != 0 )
               return ret;

            * Fill in blank NUMA mapping info which old HV can't provide. Only need
            * to set first element since we set max_cpu_id = 0
           memcpy(put_info, &sysctl.u.physinfo, sizeof(*put_info));
           put_info->max_cpu_id = 0;
           get_xen_guest_handle(cpu_to_node, put_info->cpu_to_node);
           cpu_to_node[0] = NUMA_NO_NODE;
           ... snip ...

(gdb) print put_info->cpu_to_node
$1 = {p = 0x0}

#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)

So, because cpu_to_node is 0, "cpu_to_node[0] = NUMA_NO_NODE" failed.
Comment 4 RHEL Product and Program Management 2008-03-11 07:20:01 EDT
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.
Comment 5 Daniel Berrange 2008-03-12 16:27:58 EDT
FYI, this is not  ia64-specific - I have reproduced on x86_64 too
Comment 6 Bill Burns 2008-03-12 16:38:34 EDT
Set devel ack for Dan.
Comment 7 Daniel Berrange 2008-03-14 10:21:31 EDT
Created attachment 298052 [details]
Fix physinfo compat crash
Comment 11 Masahiro Matsuya 2008-03-18 21:52:36 EDT
Can Dan see the private comment on this bugzilla?
Comment 12 Daniel Berrange 2008-03-19 12:04:19 EDT
Fix built into 3.0.3-58.el5
Comment 14 Daniel Berrange 2008-03-20 21:58:49 EDT
It will be included in Beta Snapshot 3 next week.
Comment 18 errata-xmlrpc 2008-05-21 11:21:43 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.