Debian 查找有关linux应用程序文件的信息

Debian 查找有关linux应用程序文件的信息,debian,Debian,我有一个程序,我想在debian中运行,但当我启动它时,我得到了一个分段错误。它以前在debian中工作过。 我是否可以运行任何命令来查看问题所在?它需要什么libs,以及它是否是一个有效的可执行文件?strace或gdb。Strace将打印系统调用跟踪,gdb程序允许在崩溃后键入bt,并查看堆栈跟踪 strace或gdb。Strace将打印系统调用跟踪,gdb程序允许在崩溃后键入bt,并查看堆栈跟踪 用于启动类型 whereis programname 获取可执行文件、其文档和(可能)其源代

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

strace
gdb
。Strace将打印系统调用跟踪,
gdb程序
允许在崩溃后键入
bt
,并查看堆栈跟踪

strace
gdb
。Strace将打印系统调用跟踪,
gdb程序
允许在崩溃后键入
bt
,并查看堆栈跟踪

用于启动类型

whereis programname
获取可执行文件、其文档和(可能)其源代码在系统上的位置。 然后键入

file `which programname`
/lib/ld-linux.so.* --list `which 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 <http://gnu.org/licenses/gpl.html>
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:
<http://bugs.opensuse.org/>...
(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
$perl在哪里
perl:/usr/bin/perl/usr/bin/X11/perl/usr/share/man/man1/perl.1.gz
$file`哪个perl`
/usr/bin/perl:ELF 32位LSB可执行文件,英特尔80386,版本1(SYSV),适用于GNU/Linux 2.6.4,动态链接(使用共享库),剥离
$/lib/ld linux.so.*--list`which perl`
LinuxGate.so.1=>(0xFFFFFF000)
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无限制
$perl
^\退出(内核转储)
$gdb`哪个perl`核心
GNU gdb(gdb;openSUSE 11.1)6.8.50.20081120-cvs
版权所有(C)2008免费软件基金会。
许可证GPLv3+:GNU GPL版本3或更高版本
这是自由软件:您可以自由更改和重新发布它。
在法律允许的范围内,不存在任何担保。键入“显示复制”
和“显示保修”了解详细信息。
此GDB配置为“i586 suse linux”。
有关错误报告说明,请参阅:
...
(未找到调试符号)
核心是由“perl”生成的。
程序终止,信号3,退出。
#内核vsyscall()中的0 0xFFFFFFE430
(gdb)在哪里
#内核vsyscall()中的0 0xFFFFFFE430
#1 0xb7fd2b93位于/lib/libpthread.so.0的uu read_nocancel()中
#Perliou读取中的2 0x081bcb9b()
#3 0x081be025英寸PerlIOBuf_填充()
#PerlIOBase_读取中的4 0x081bc402()
#PerlIO_getc()中的5 0x081bc571
#Perl_sv_gets()中的6 0x0812121e
#Perl中的7 0x081f11e1过滤器读取()
#8 0x081f15e3英寸??()
#Perl_yylex()中的9 0x081FAC9
#Perl_yyparse()中的10 0x08210674
#11 0x080d844f英寸??()
#perl_解析()中的12 0x080dc372
#主管道中的13 0x08063ff8()
(gdb)退出
示例:

用于启动类型

whereis programname
$ 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 <http://gnu.org/licenses/gpl.html>
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:
<http://bugs.opensuse.org/>...
(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
获取可执行文件、其文档和(可能)其源代码在系统上的位置。 然后键入

file `which programname`
/lib/ld-linux.so.* --list `which 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 <http://gnu.org/licenses/gpl.html>
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:
<http://bugs.opensuse.org/>...
(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
$perl在哪里
perl:/usr/bin/perl/usr/bin/X11/perl/usr/share/man/man1/perl.1.gz
$file`哪个perl`
/usr/bin/perl:ELF 32位LSB可执行文件,英特尔80386,版本1(SYSV),适用于GNU/Linux 2.6.4,动态链接(使用共享库),剥离
$/lib/ld linux.so.*--list`which perl`
LinuxGate.so.1=>(0xFFFFFF000)
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无限制
$perl
^\退出(内核转储)
$gdb`哪个perl`核心
GNU gdb(gdb;openSUSE 11.1)6.8.50.20081120-cvs
版权所有(C)2008免费软件基金会。
许可证GPLv3+:GNU GPL版本3或更高版本
这是自由软件:您可以自由更改和重新发布它。
在法律允许的范围内,不存在任何担保。键入“显示复制”
和“显示保修”了解详细信息。
此GDB配置为“i586 suse linux”。
有关错误报告说明,请参阅:
...
(未找到调试符号)
核心是由“perl”生成的。
程序终止,信号3,退出。
#内核vsyscall()中的0 0xFFFFFFE430
(gdb)在哪里
#内核vsyscall()中的0 0xFFFFFFE430
#1 0xb7fd2b93位于/lib/libpthread.so.0的uu read_nocancel()中
#Perliou读取中的2 0x081bcb9b()
#3 0x081be025英寸PerlIOBuf_填充()
#PerlIOBase_读取中的4 0x081bc402()
#PerlIO_getc()中的5 0x081bc571
#Perl_sv_gets()中的6 0x0812121e
#Perl中的7 0x081f11e1过滤器读取()
#8 0x081f15e3英寸??()
#Perl_yylex()中的9 0x081FAC9
#Perl_yyparse()中的10 0x08210674
#11 0x080d844f英寸??()
#perl_解析()中的12 0x080dc372
#主管道中的13 0x08063ff8()
(gdb)退出
例如:

$ 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 <http://gnu.org/licenses/gpl.html>
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:
<http://bugs.opensuse.org/>...
(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