为什么我的C ++ / QT应用程序在Linux x86_64上的nanosleep()崩溃了?

时间:2013-01-04 19:55:32

标签: c++ linux qt crash qtwebkit

我在x86_64上的Ubuntu 12.10下运行用Qt / C ++编写的服务器端webkit渲染器。 Qt是4.8.4自定义构建以及qtwebkit 2.3。

在大约5%的渲染任务中,应用程序崩溃(gdb log):

This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/something...done.
[New LWP 27328]
[New LWP 27825]
[New LWP 27807]
[New LWP 28981]
[New LWP 27808]
[New LWP 28387]
[New LWP 28575]
[New LWP 28837]
[New LWP 28879]
[New LWP 28891]
[New LWP 27326]
[New LWP 28420]
[New LWP 28681]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/something'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f793a58183d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
82  ../sysdeps/unix/syscall-template.S: No such file or directory.
#0  0x00007f793a58183d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f793a5816dc in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:138
#2  0x00007f793db80014 in ?? () from /usr/local/qt-4.8.4-git/lib/libQtWebKit.so.4
#3  0x00007f793db80309 in ?? () from /usr/local/qt-4.8.4-git/lib/libQtWebKit.so.4
#4  0x00007f793b09de9a in start_thread (arg=0x7f7934b41700) at pthread_create.c:308
#5  0x00007f793a5b5cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()
(gdb) quit

这怎么可能?我该怎么做才能缓解这次崩溃?

更新:回溯其他线程:http://pastie.org/5623164

1 个答案:

答案 0 :(得分:3)

事实证明,这是一个虚假的回溯。在使用相同的构建替换libQtWebKit但使用调试符号后,我得到一个完全不同的回溯,这是有意义的。

tl; dr - nanosleep()中没有崩溃,这只是gdb的错误解决方案。