Wind River Support Network

HomeDefectsOVP-1209
Fixed

OVP-1209 : Some tools provided with libvmi fail to run and cause "Segmentation fault"

Created: May 24, 2013    Updated: Mar 11, 2016
Resolved Date: Jan 23, 2014
Found In Version: 5.0.1
Fix Version: 5.0.1
Severity: Severe
Applicable for: Wind River Linux 5
Component/s: Userspace

Description

Problem Description
======================
Some tools provide by libvmi failed dump-memory, map-addr, map-symbol and cause "Segmentation fault"

Expected Behavior
======================
The tool could be used correctly

Observed Behavior
======================
root@MATXM-411-1:/opt/wr-test/testcases/ovp/libvmi# module-list WindRiver-HVM
exportfs
nfsd
findoffsets
root@MATXM-411-1:/opt/wr-test/testcases/ovp/libvmi# dump-memory WindRiver-HVM
Segmentation fault
root@MATXM-411-1:/opt/wr-test/testcases/ovp/libvmi# map-addr WindRiver-HVM
Segmentation fault
root@MATXM-411-1:/opt/wr-test/testcases/ovp/libvmi# map-symbol WindRiver-HVM
Segmentation fault
root@MATXM-411-1:/opt/wr-test/testcases/ovp/libvmi# dmesg |tail
EXT3-fs (loop0): mounted filesystem with ordered data mode
device tap0 entered promiscuous mode
kjournald starting.  Commit interval 5 seconds
EXT3-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended
EXT3-fs (loop0): using internal journal
EXT3-fs (loop0): recovery complete
EXT3-fs (loop0): mounted filesystem with ordered data mode
dump-memory[3654]: segfault at 0 ip 0000003364481d61 sp 00007fff4ee58288 error 4 in libc-2.15.so[3364400000+19c000]
map-addr[3659]: segfault at 0 ip 000000336443a634 sp 00007fff1b2c9d00 error 4 in libc-2.15.so[3364400000+19c000]
map-symbol[3660]: segfault at 0 ip 0000003365c32840 sp 00007fff7c1be8b8 error 4 in libglib-2.0.so.0.3200.3[3365c00000+fc000]
root@MATXM-411-1:/opt/wr-test/testcases/ovp/libvmi# 

Steps to Reproduce

1.
clone/pull userspace test layer
git clone git://git.wrs.com/layers/wr-testing

2.
======correct the configure information========
- build host:
--enable-board=intel-xeon-core --enable-rootfs=ovp-kvm --enable-addons=wr-ovp --with-layer=/folk/swang1/layer/wr-testing-1/ovp-test --with-template=feature/ovp-test --with-package=wrs-kvm-helper --enable-jobs=8 --enable-parallel-pkgbuilds=8 --with-sstate-dir=/buildarea2/swang1/PUBLIC_SSTATES/ovp/intel-xeon-core --enable-internet-download=yes

- build guest:
--enable-board=x86-64-kvm-guest --enable-rootfs=ovp-guest --enable-addons=wr-ovp --with-layer=/folk/swang1/layer/wr-testing-1/ovp-test --with-template=feature/ovp-test --enable-parallel-pkgbuilds=8 --enable-jobs=8 --with-sstate-dir=/buildarea2/swang1/PUBLIC_SSTATES/ovp/x86-64-kvm-guest --enable-internet-download=yes

3. boot target and copy guest filesystem and kernel and System.map to host

4. xml file for libvirt:
root@localhost:~# cat guest.xml
<domain type='kvm'>
<name>WindRiver-HVM</name>
<memory>1024000</memory>
<currentMemory>512000</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd' />
<kernel>/boot/guest.kernel</kernel>
<cmdline>console=ttyS0 root=/dev/sda rw</cmdline>
</os>
<devices>
<disk type='file' device='disk'>
<source file='/boot/guest_raw.img' />
<target dev='hda' bus='ide' />
</disk>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
</devices>
</domain>
root@localhost:~#

5 launch guest:
# virsh
virsh # define guest.xml
virsh # start WindRiver-HVM
virsh # list
Id Name State
----------------------------------------
3 WindRiver-HVM running

virsh # console 3 (or the name)

6 configure /etc/libvmi.conf
example: /etc/libvmi-example.conf. bellow is the file I used.
root@localhost:~# cat /etc/libvmi.conf
# offsets are for 64-bit kernels
#
WindRiver-HVM {
ostype = "Linux";
sysmap = "/boot/guest-System.map";
linux_name = 0x360;
linux_tasks = 0x140;
linux_mm = 0x178;
linux_pid = 0x1b8;
linux_pgd = 0x48;
linux_addr = 0x128;
}
Live chat
Online