当前位置:  开发笔记 > 编程语言 > 正文

查找有关linux app file的信息

如何解决《查找有关linuxappfile的信息》经验,为你挑选了1个好方法。

我有一个程序,我想在debian中运行,但是当我启动它时,我得到一个分段错误错误.它曾在debian中运作过.我可以运行任何命令来查看问题是什么吗?它需要什么库以及它是否是有效的可执行文件?



1> Diomidis Spi..:

对于开始类型

whereis programname

获取可执行文件,其文档和(可能)在您的系统上的源代码的位置.然后输入

file `which programname`

查看它是否是有效的可执行文件.然后输入

/lib/ld-linux.so.* --list `which programname`

查看程序运行所需的共享库.

最后,输入

ulimit -c unlimited
programname
gdb `which programname` core
where
q

获得坠机的准确位置.

例:

$ whereis perl
perl: /usr/bin/perl /usr/bin/X11/perl /usr/share/man/man1/perl.1.gz

$ file `which perl`
/usr/bin/perl: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), stripped

$ /lib/ld-linux.so.* --list `which perl`
        linux-gate.so.1 =>  (0xffffe000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb7f56000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7f51000)
        libm.so.6 => /lib/libm.so.6 (0xb7f28000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7ef1000)
        libutil.so.1 => /lib/libutil.so.1 (0xb7eec000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7ed2000)
        libc.so.6 => /lib/libc.so.6 (0xb7d76000)
        /lib/ld-linux.so.2 (0xb7f92000)

$ ulimit -c unlimited
$ perl
^\Quit (core dumped)
$ gdb `which perl` core
GNU gdb (GDB; openSUSE 11.1) 6.8.50.20081120-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-suse-linux".
For bug reporting instructions, please see:
...
(no debugging symbols found)
Core was generated by `perl'.
Program terminated with signal 3, Quit.
#0  0xffffe430 in __kernel_vsyscall ()
(gdb) where
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7fd2b93 in __read_nocancel () from /lib/libpthread.so.0
#2  0x081bcb9b in PerlIOUnix_read ()
#3  0x081be025 in PerlIOBuf_fill ()
#4  0x081bc402 in PerlIOBase_read ()
#5  0x081bc571 in PerlIO_getc ()
#6  0x0812121e in Perl_sv_gets ()
#7  0x081f11e1 in Perl_filter_read ()
#8  0x081f15e3 in ?? ()
#9  0x081facc9 in Perl_yylex ()
#10 0x08210674 in Perl_yyparse ()
#11 0x080d844f in ?? ()
#12 0x080dc372 in perl_parse ()
#13 0x08063ff8 in main ()
(gdb) quit

例:

推荐阅读
小色米虫_524
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有