[1] Building Embedded Linux Systems, pp. 297-298 (how to build strace)
[2] Blackfin uClinux (important tips)
[3] Assabet (compiling strace)
[4] Unable to build strace - busybox forum (same build error and reason of the error)
Steps:
1. Download strace package (strace-4.5.19.tar.bz2, 499,6KB) from sourceforge (http://sourceforge.net/projects/strace/) and save it under "~/debug" folder on a host [1].
2. Jump to the folder and unpack the package
cd ~/debug
tar -xjf strace-4.5.19.tar.bz2
(it will be a folder named "strace-4.5.19" created)
3. Jump to the recently created folder
cd strace-4.5.19
4. Configure and build it against uClibc [1]
CC=mips-linux-gcc ./configure --host=mips-linux
make LDFLAGS="-static"
5. First time it will return error messages as shown below:
file.c: In function `printstatfs64':
file.c:1695: error: storage size of `statbuf' isn't known
file.c:1695: warning: unused variable `statbuf'
file.c: In function `sys_statfs64':
file.c:1729: error: invalid application of `sizeof' to an incomplete type
file.c: In function `sys_fstatfs64':
file.c:1743: error: invalid application of `sizeof' to an incomplete type
make[1]: *** [file.o] Error 1
make[1]: Leaving directory `/home/boldoo/debug/strace-4.5.19'
make: *** [all] Error 2
6. By searching on the Internet [4], the build failure reason results from not supporting large file (Large File Support, LFS) in uClibc. So decided to modify sources that references following functions:
sys_truncate64()
sys_ftruncate64()
sys_getdents64()
sys_statfs64()
sys_fstatfs64()
Two files found that contain the functions:
file.c
linux/mips/syscallent.h
7. All lines that include 64-bit functions were commented in both source files.
8. Clean and build again.
make clean
make LDFLAGS="-static"
Build passed without any error.
9. Copy strace executable to root filesystem [1]
cp strace /opt/rootfs.incaip2/sbin/
10. Run minicom, connect a target board (INCAIP2) serially to the host and turn on the target board.
11. After booting Linux on the target, check if strace works:
# strace ls
execve("/bin/ls", ["ls"], [/* 11 vars */]) = 0
ioctl(0, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0
ioctl(1, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0
getuid() = 0
getgid() = 0
setgid(0) = 0
setuid(0) = 0
ioctl(1, 0x40087468, 0x7fff7cc0) = 0
ioctl(1, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0
lstat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
brk(0) = 0x1000a120
brk(0x1000b120) = 0x1000b120
brk(0x1000c000) = 0x1000c000
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open(".", O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getdents(3, /* 7 entries */, 3933) = 128
lstat("./drv_vmmc", {st_mode=S_IFREG|0755, st_size=345000, ...}) = 0
lstat("./hapi.o", {st_mode=S_IFREG|0664, st_size=10996, ...}) = 0
lstat("./tmp", {st_mode=S_IFLNK|0777, st_size=22, ...}) = 0
lstat("./drv_tapi", {st_mode=S_IFREG|0755, st_size=171132, ...}) = 0
lstat("./startpa.sh", {st_mode=S_IFREG|0755, st_size=246, ...}) = 0
getdents(3, /* 0 entries */, 3933) = 0
close(3) = 0
open("/etc/TZ", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/TZ", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/TZ", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/TZ", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/TZ", O_RDONLY) = -1 ENOENT (No such file or directory)
write(1, "drv_tapi drv_vmmc hapi.o "..., 52drv_tapi drv_vmmc hapi.p
) = 52
exit(0) = ?
12. Strace the "voip" application
# strace voip
execve("/usr/local/bin/voip", ["voip"], [/* 11 vars */]) = 0
old_mmap(NULL, 20, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x0
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=64, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
old_mmap(NULL, 64, PROT_READ, MAP_SHARED, 3, 0) = 0x2aaaf000
close(3) = 0
open("/lib/libc.so.0", O_RDONLY) = 3
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\10\0\0\0\1\0\0\265\0\0\0\0004"..6
old_mmap(NULL, 684032, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaee000
old_mmap(0x2aaee000, 397556, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) 0
old_mmap(0x2ab8f000, 4748, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x610
old_mmap(0x2ab91000, 15800, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANO0
close(3) = 0
munmap(0x2aab0000, 4096) = 0
munmap(0x2aaaf000, 64) = 0
ioctl(0, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0
ioctl(1, TIOCNXCL, {B115200 opost isig icanon echo ...}) = 0
write(1, "voip application (Mar 12 2010, 1"..., 42voip application (Mar 12 2010)
) = 42
rt_sigaction(SIGINT, {0x14000000, [RT_68], 0x400b80 /* SA_??? */}, {SIG_DFL, [R0
open("/dev/vmmc10", O_RDWR) = 3
open("/dev/vmmc11", O_RDWUnable to handle kernel paging request at virtual addr4
Oops in fault.c::do_page_fault, line 226:
$0 : 00000000 802e0000 fffffffc fffffffc 00000000 83791d4c 20004f11 83791d4c
$8 : 00000000 8027fb38 00000000 00000000 00000007 00000020 836c66b0 00000013
$16: 00000000 ffffffea 83791d4c 806e4f00 00000001 c0080fb0 83707000 836c4000
$24: 00000000 00432050 83790000 83791c80 00000000 802aa1b4
Hi : 00000000
Lo : 00000002
epc : 802ac5c8 Not tainted
Status: 1000fd03
Cause : 00800008
PrId : 00019640
Process voip (pid: 66, stackpage=83790000)
Stack: 806a4a3c 801cf2c4 83a09000 80309178 00000000 802aa1b4 2ab420d0
00000fff 801cf474 839a7550 83e25e80 00000001 83e25e80 00000001 00000000
80118e78 00000000 00001000 00000000 80118ad0 00000000 80118ad0 80103550
810e6c00 c00869cc 83e25e80 80307c00 83e25e80 00000060 83791d40 00000000
00000000 00000000 c00d9cb0 83791dd0 00000000 00000000 c0080fb0 c00b8b90
00000102 ...
Call Trace: [< 801cf2c4 >] [< 802aa1b4 >] [< 801cf474 >] [< 80118e78 >] [< 80118ad0 >]
[< 80118ad0 >] [< 80103550 >] [< c00869cc >] [< c00d9cb0 >] [< c0080fb0 >] [< c00b8b90 >]
[< c0080fb0 >] [< 80134094 >] [< c00d9cb0 >] [< c00d9d20 >] [< c009d610 >] [< c0080f14 >]
[< 80126a98 >] [< 80131438 >] [< 80131438 >] [< c0077540 >] [< 8011e964 >] [< 80126b14 >]
[< 8011ea3c >] [< 8011ea34 >] [< 8010c180 >] [< 8010c004 >] [< c0080710 >] [< c0076e2c >]
[< 8014e0d8 >] [< 80108b4c >] [< 8014de38 >] [< 80109a60 >] [< 80161e4c >]
Code: 00021080 00441021 aca30004 < 8c460000 > 00061a02 00061402 00431021 004
R) = 4
brk(0) = 0x1000013c
brk(0x1000113c) = 0x1000113c
brk(0x10002000) = 0x10002000
ioctl(4, 0x2000710f
+++ killed by SIGSEGV +++
Segmentation fault
2 comments:
Heгbal pills are more difficult tο fight with гadiаtіon treatment.
Funсtion cоffee diеt are mаrketеd anԁ designеd to help indiѵіduals
achieve quiсk гesults. When ѕomeone aѕsіѕts you to if уou can
finԁ in the markеt. So ωhаt аre
the pros and conѕ when consіdering сoffee dіet.
Thіs increаses rate οf metabοlism whiсh thus helps in гeductіon of
appetite. As уou can see the reviеws Deca Trim is chеаp and shipping аs
well.
Also visit mу page: thepolkadotgiraffe.blogspot.com
Green tеа Pure Greеn Ϲoffee Bean Extraсt are
not mаgiс pills, dіets or ѕupρlements can eѵer replаce gooԁ olԁ еxеrcise and sound nutrition.
You cοulԁ also trу burning these calοгіeѕ by using fat of the bоdy.
But the simіlaritу stopѕ thеге.
The best ρart of it iѕ goіng to
become fаt. At leаѕt the FDA does have ovеrsight οvег pгint аnԁ televiѕion
аdѕ by the ρharmасеuticаl inԁustгy, obeѕity іs nοw seen as
the" trillion dollar disease". Bу controlling уour meаl сhoices aѕ well as keeρ hуpегtenѕion unԁer contrоl.
my web ρage http://217.160.138.71/michael/wiki/index.php?title=User:Mash407701
Post a Comment