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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It has been a long time the blogspot can not get accessed in Mainland China . I almost gave up this blog. But today a workmate of mine said he had found my blog during his search in google, so it makes sense that this blog still be somewhat useful.
Got any news?
Yeah, I am now working for Wind River Systems. I am proud to be working with WRS, even now I am just still an engineer. I like the way it goes.
And more?
Hmm, the Zigbee stack which i was speaking in my last posts has been working for sometime. It was somewhat a port from the Microchip stack, but I'd like to produce my own when the current
parttime job is done, and may want to post it on the Sourceforge.
Still more?
OK, I just past my 27th birthday two weeks ago, if you may ask.
Gmail - TX_OK.JPG
This is the first time the basic TX is OK.
Next step is to write RX code,and then the Linux Z-stack.
What an exciting achievement!
1.Core dump
多线程如果dump,多为段错误,一般都涉及内存非法读写。可以这样处理,使用下面的命令打开系统开关,让其可以在死掉的时候生成core文件。
ulimit -c unlimited
这样的话死掉的时候就可以在当前目录看到core.pid(pid为进程号)的文件。接着使用gdb:
gdb ./JM ./core.pid
进去后,使用bt查看死掉时栈的情况,在使用frame命令。
===========================================
#include
int main()
{
char *temp = "Paras";
int i;
i=0;
temp[3]='F';
for (i =0 ; i < 5 ; i++ )
printf("%c\n", temp[i]);
return 0;
}
/*
[root@localhost core-dump]# ulimit -c unlimited
[root@localhost core-dump]# g++ -g -o testit testit.c
[root@localhost core-dump]# ./testit
段错误 (core dumped)
[root@localhost core-dump]# ./testit
段错误 (core dumped)
[root@localhost core-dump]# gdb testit core.3051
GNU gdb Red Hat Linux (6.5-15.fc6rh)
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 "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
warning: Can't read pathname for load map: 输入/输出错误.
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Failed to read a valid object file image from memory.
Core was generated by `./testit'.
Program terminated with signal 11, Segmentation fault.
#0 0x08048489 in main () at testit.c:10
10 temp[3]='F';
(gdb) q
[root@localhost core-dump]#
*/
2."Program received signal SIG32, Real-time event 32."
Problem ===============================================
gdb) target remote 10.136.7.252:2345
Remote debugging using 10.136.7.252:2345
_start () at ../sysdeps/arm/elf/start.S:71
71 ../sysdeps/arm/elf/start.S: No such file or directory.
in ../sysdeps/arm/elf/start.S
Current language: auto; currently asm
(gdb) c
Continuing.
Program received signal SIG32, Real-time event 32.
0x0023ca84 in __pthread_sigsuspend (set=0xfffffffc) at ../linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c:54
54 ../linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c: No such file or directory.
in ../linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c
Current language: auto; currently c
(gdb) c
Continuing.
Program received signal SIG32, Real-time event 32.
0x0023ca84 in __pthread_sigsuspend (set=0xfffffffc) at ../linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c:54
54 in ../linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c
(gdb) c
Continuing.
On Sun, 19 Sep 2004 11:08:42 -0700, Chris Germano <netslayer at hotmail.com> wrote:
> Does this GDB output look normal? I hear I need to recompile gcc and glibc
> with multithread support or something?
>
...
> warning: Unable to find dynamic linker breakpoint function.
> GDB will be unable to debug shared library initializers << ?
> and track explicitly loaded dynamic code. << ?
Perhaps the executable was statically compiled?
> Program received signal SIG32, Real-time event 32. << ?
I reckon SIG32 is the signal used by the threadslib to jump into the
scheduler every timeslice.
You can try the following in GDB, before starting the program:
handle SIG32 nostop noprint pass
That will prevent GDB from stopping when it receives the signal, it
won't print any occurrances
either, and the signal will be passed to program which is being debugged.
Robert
3.ulimit
ulimit is a shell builtin command used to show and set various restrictions on resource usage for a shell. Among the limitations that can be set you find, maximum file size, maximum core file size, maximum size of resident memory. Though the restrictions are shell-independent, the exact syntax depends on what shell you are running.
It's a good practice to set some of these limitations to prevent for instance a faulty shell script to start unlimited copies of it self or to prevent users on the system to start processes that run forever.
Warning:Typing ulimit may result in the output "unlimited". That is misleading, you may have limits in place as you can find out with ulimit -a
ls3523:~ # ulimit unlimited ls3523:~ # ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 4091 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 4091 virtual memory (kbytes, -v) unlimited file locks (-x) unlimitedIn general, the command ulimit -$ (where $ is some letter) will return the current value of the variable linked with $, while ulimit -$ NUMBER (again, where $ is some letter, and NUMBER is generally an integer, or "unlimited") will set that variable. Of special note is the -a option, which will display all limits for the system.
The -H and -S options are also special. -H will affect the "hard" limit, which is an absolute limit on a resource. -S will affect the "soft" limit. The major difference between the two is that hard limits can only be increased by root. Since the default for options is to affect both hard and soft limits, adding -S to a command will allow returning the variable to the previous value without root access.
Finally, all limits only apply to the thread in which they are set. For systemwide setting of limits, try /etc/security/limits.conf
Use the x command to examine memory. The syntax for the x command is x/FMT ADDRESS. The FMT field is a count followed by a format letter and a size letter. There are many options here, use the help command 'help x' to see them all. The ADDRESS argument can either be a symbol name, such as a variable, or a memory address.
If we have char *s = "Hello World\n", some uses of the x command could be:
Examine the variable as a string:
(gdb) x/s s
0x8048434 <_io_stdin_used+4>: "Hello World\n"
Examine the variable as a character:
(gdb) x/c s
0x8048434 <_io_stdin_used+4>: 72 'H'
Examine the variable as 4 characters:
(gdb) x/4c s
0x8048434 <_io_stdin_used+4>: 72 'H' 101 'e' 108 'l' 108 'l'
Examine the first 32 bits of the variable:
(gdb) x/t s
0x8048434 <_io_stdin_used+4>: 01101100011011000110010101001000
Examine the first 24 bytes of the variable in hex:
(gdb) x/3x s
0x8048434 <_io_stdin_used+4>: 0x6c6c6548 0x6f57206f 0x0a646c72
Use the info registers command. The output of this command depends on the hardware architecture. The following is part of the output on an intel machine:
(gdb) info registers
eax 0x40123460 1074934880
ecx 0x1 1
edx 0x80483c0 134513600
ebx 0x40124bf4 1074940916
esp 0xbffffa74 0xbffffa74
ebp 0xbffffa8c 0xbffffa8c
esi 0x400165e4 1073833444
...
When your program segfaults and leaves a core dump file, you can use gdb to look at the program state when it crashed. Use the core command to load a core file. The argument to the core command is the filename of the core dump file, which is usually "core", making the full command core core.
prompt > myprogram
Segmentation fault (core dumped)
prompt > gdb myprogram
...
(gdb) core core
...
There are two commands, nexti and stepi, that work similar to next and step. See the usage of those commands for an idea of how to use these two.
Use the disassemble command. The argument to this command is a memory address. Here is an example of the disassembly for the main function of a simple program on an intel machine:
(gdb) disassemble main
Dump of assembler code for function main:
0x80483c0: push %ebp
0x80483c1: mov %esp,%ebp
0x80483c3: sub $0x18,%esp
0x80483c6: movl $0x0,0xfffffffc(%ebp)
0x80483cd: mov 0xfffffffc(%ebp),%eax
0x80483d0: movb $0x7,(%eax)
0x80483d3: xor %eax,%eax
0x80483d5: jmp 0x80483d7
0x80483d7: leave
0x80483d8: ret
End of assembler dump.
This document describes the simple steps needed to setup tftp and nfs
environment for cross developemnt.
1.yum install tftp
2.yum install tftp-server
3.vi /etc/xinetd.d/tftp and change "disable = yes" to "disable = no"
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -c -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
4./etc/rc.d/init.d/xinetd restart
5.vi /etx/exports
/opt/montavista/pro/devkit/arm/v5t_le/target *(rw,no_root_squash)
6./etc/rc.d/init.d/nfs restart
7.test tftp server,create a file in /tftpboot,then use
tftp to login to the server and get that file.
#tftp 10.136.4.40
#>get hello.txt
8.test NFS server,must use
#iptables -F
#mount -t nfs 10.136.4.40:/opt/montavista/pro/devkit/arm/v5t_le/target /mnt/cdrom
#cd /mnt/cdrom
#ls
<#/DocByCoryXie#>
This document shows the steps need to install Montavista Linux Pro 4.0 Tools
on FC6,and possible other host which was not nativly compiled for by MontaVista.
1.Generate correct host file
At first ,the installer wants to use the supported_hosts file for
a configuration for waht it has been compiled,we need to change it for our new
host.
##### Identify host based on default if the user has not overridden.
if [ -z "$HOST_FILE" ]; then
mv_host=`identify_host "$media_install/install-components/cross-control/data/supported_hosts"`
else
mv_host=`identify_host "$HOST_FILE"`
fi
Thus we should write a file,such as '/mnt/hosts',
and instert what it need for our new host.
The host file format comes from:
# This table lists the criteria to identify a host and map it to our
# directory stucture:
#
#
#
Linux:i.*86:cat /etc/redhat-release:Red Hat Linux release 9 (Shrike):redhat90
so we need to use these commands to generate what we need,for my system FC6,it gives
Linux:i.*86:cat /etc/fedora-release:Fedora Core release 6 (Zod):redhat90
fill the line above into /mnt/hosts
and
#export HOST_FILE=/mnt/hosts
#/mnt/cdrom/install
2.Update host system with old libstdc++-33
Then you will be prompted this error:
mvl-inst-eng: error while loading shared libraries: libstdc++.so.5:
cannot open shared object file: No such file or directory
now you need to install compat-libstdc++-33.
yum install compat-libstdc++-33
please also :
#yum install libXp
because the last step will need this libXp.so.6.
3.mount ISO images
#mount -t iso9660 /mnt/hgfs/Tools/mvl_host_binaries.iso /mnt/cdrom -o loop
#/mnt/cdrom/install
http://127.0.0.1:9999
follow instructions to do "Next"
#mount -t iso9660 /mnt/hgfs/Tools/mvl_target_binaries.iso /mnt/cdrom -o loop
depends on what way you want to install,you may need to use:
#mount -t iso9660 /mnt/hgfs/Tools/mvl_lsp_binaries_arm_v5t_le.iso /mnt/cdrom -o loop
or
#mount -t iso9660 /mnt/hgfs/Tools/mvl_cross_binaries_v5t_le.iso /mnt/cdrom -o loop
#mount -t iso9660 /mnt/hgfs/Tools/mvl_devrocket_binaries.iso /mnt/cdrom -o loop
#mount -t iso9660 /mnt/hgfs/Tools/mvl_docs_binaries.iso /mnt/cdrom -o loop