3

我正在使用 ubuntu 12.04,并且我有一个应用程序,当我运行时,退出:

./ardrone_navigation 
Setting locale to en_GB.UTF-8
Errore di segmentazione (core dump creato)

如果我像普通用户或 root 一样运行它,问题是一样的

,但我找不到核心转储.....,我已经检查过了

cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport %p %s %c

apport-cli 
Nessuna segnalazione di crash pendente. Provare --help per maggiori informazioni.
(no crash pending) 

然后我尝试

strace ./ardrone_navigation

现在,我有很多输出到控制台,如果我再次运行 apport-cli ,它有一个报告,但对于 strace 程序......

为什么?我需要知道什么?(我是这个问题的新手)

strace 最后一行是

open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=4455872, ...}) = 0
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 5, 0x432) = 0xb5c5a000
close(5)                                = 0
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 6), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb5c59000
write(1, "Setting locale to en_GB.UTF-8\n", 30Setting locale to en_GB.UTF-8) = 30
socket(PF_NETLINK, SOCK_RAW, 0)         = 5
bind(5, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(5, {sa_family=AF_NETLINK, pid=4221, groups=00000000}, [12]) = 0
time(NULL)                              = 1351515893
sendto(5, "\24\0\0\0\22\0\1\3\365~\216P\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK,pid=0, groups=00000000}, 12) = 20
recvmsg(5, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\340\3\0\0\20\0\2\0\365~\216P}\20\0\0\0\0\4\3\1\0\0\0I\0\1\0\0\0\0\0"..., 4096}],msg_controllen=0, msg_flags=0}, 0) = 3008
recvmsg(5, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\350\3\0\0\20\0\2\0\365~\216P}\20\0\0\0\0\1\0\4\0\0\0C\20\1\0\0\0\0\0"..., 4096}],msg_controllen=0, msg_flags=0}, 0) = 2988
recvmsg(5, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\365~\216P}\20\0\0\0\0\0\0\4\0\0\0C\20\1\0\0\0\0\0"..., 4096}],msg_controllen=0, msg_flags=0}, 0) = 20
sendto(5, "\24\0\0\0\26\0\1\3\366~\216P\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(5, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"0\0\0\0\24\0\2\0\366~\216P}\20\0\0\2\10\200\376\1\0\0\0\10\0\1\0\177\0\0\1"..., 4096}],     msg_controllen=0, msg_flags=0}, 0) = 228
recvmsg(5, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"@\0\0\0\24\0\2\0\366~\216P}\20\0\0\n\200\200\376\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}],     msg_controllen=0, msg_flags=0}, 0) = 448
recvmsg(5, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\366~\216P}\20\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}],     msg_controllen=0, msg_flags=0}, 0) = 20
>close(5)                                = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Errore di segmentazione (core dump creato)

dmsg 是:

[ 2650.115445] ardrone_navigat[4026]: segfault at 0 ip 080a99c3 sp bf91c1d0 error 4 in ardrone_navigation[8048000+29b000]
[ 2960.022708] ardrone_navigat[4206]: segfault at 0 ip 080a99c3 sp bfcdeec0 error 4 in ardrone_navigation[8048000+29b000]
[ 3588.294821] ardrone_navigat[4236]: segfault at 0 ip 080a99c3 sp bfedf3b0 error 4 in ardrone_navigation[8048000+29b000]

仅当我不称它为 trought strace 时才填充

谢谢大卫

4

1 回答 1

8

如果您想要一个核心转储文件,即使将核心转储发送到 apport,请确保您的 RLIMIT_CORE 设置(通常使用 ulimit -c 设置)大于 0(并且您可能希望它足够大以至于它不会截断您的核心转储)。如果它大于 0,apport 似乎尊重此设置并在当前工作目录中生成一个核心文件。

(我仅在 Ubuntu 12.04 下对此进行了测试。)

于 2012-12-19T05:11:29.887 回答