应用程序崩溃时如何在共享库libev中找到调用者函数

发布于 2024-11-01 16:34:30 字数 1709 浏览 0 评论 0原文

我在 gcc 中使用 -g 标志编译了我的应用程序和共享库 libev。当我运行该应用程序时,它会在几分钟后崩溃。我在 gdb 中运行该应用程序并尝试进行回溯。我得到输出(附加在最后)。正如输出所示,我只知道它在尝试进行系统调用时崩溃了。我不知道其他任何事情,例如哪个函数进行了调用等。

我如何找到它。 堆栈溢出上的这个表示我们需要做的就是编译我已经完成了带有 -g 的共享库(并且没有优化)。 如果我执行 ab ev.c (共享库 libev 中的文件),gdb 找不到它。至少,我应该能够找到我在 libev 之上编写的函数,该函数发起了最终崩溃的调用。知道怎么做吗?谢谢

#0  0xf779b425 in __kernel_vsyscall ()
#1  0xf77036f3 in ?? ()
#2  0xf77baf88 in ?? ()
#3  0xf77b8c36 in ?? ()
#4  0x0000000c in ?? ()
#5  0xffe21894 in ?? ()
#6  0x00000053 in ?? ()
#7  0xf77bc46c in ?? ()
#8  0xffe21894 in ?? ()
#9  0xf7799060 in ?? ()
#10 0xf77bc468 in ?? ()
#11 0xf77bc990 in ?? ()
#12 0x00020631 in ?? ()
#13 0x50545448 in ?? ()
#14 0x302e312f in ?? ()
#15 0x30303220 in ?? ()
#16 0x0d4b4f20 in ?? ()
#17 0x6e6f430a in ?? ()
#18 0x746e6574 in ?? ()
#19 0x6e654c2d in ?? ()
#20 0x3a687467 in ?? ()
#21 0x0a0d3120 in ?? ()
#22 0x6e6e6f43 in ?? ()
#23 0x69746365 in ?? ()
#24 0x203a6e6f in ?? ()
#25 0x736f6c63 in ?? ()
#26 0x430a0d65 in ?? ()
#27 0x65746e6f in ?? ()
---Type <return> to continue, or q <return> to quit---
#28 0x542d746e in ?? ()
#29 0x3a657079 in ?? ()
#30 0x78657420 in ?? ()
#31 0x74682f74 in ?? ()
#32 0x0a0d6c6d in ?? ()
#33 0x00310a0d in ?? ()
#34 0x2f72cf46 in ?? ()
#35 0xf7798e70 in ?? ()
#36 0x00000002 in ?? ()
#37 0xf7799060 in ?? ()
#38 0xffe21928 in ?? ()
#39 0xf778e6fe in ?? ()
#40 0xf7799060 in ?? ()
#41 0xf77bc46c in ?? ()
#42 0x00000002 in ?? ()
#43 0x00000004 in ?? ()
#44 0x0000000c in ?? ()
#45 0xffffffff in ?? ()
#46 0xf770ea87 in ?? ()
#47 0x2f72cf46 in ?? ()
#48 0xf7799060 in ?? ()
#49 0x00000000 in ?? ()

I compiled my application and shared library libev using -g flag in gcc. When I run the application it crashes after a few minutes. I ran the application within gdb and tried to do a backtrace. I get the output (appended at the end). As the output shows, I only know that it crashed while trying to make a syscall. I don't know anything else e.g. which function made the call etc.

How do I find that out. This on stack overflow said that all we need to do is compile the shared library with -g (and without optimizations) which I have already done.
If I do a b ev.c (file in shared library libev), gdb cannot find it. At the very least, I should be able to find the function that I wrote on top of libev that initiated the call which eventually crashed. Any idea how to do this?Thanks

#0  0xf779b425 in __kernel_vsyscall ()
#1  0xf77036f3 in ?? ()
#2  0xf77baf88 in ?? ()
#3  0xf77b8c36 in ?? ()
#4  0x0000000c in ?? ()
#5  0xffe21894 in ?? ()
#6  0x00000053 in ?? ()
#7  0xf77bc46c in ?? ()
#8  0xffe21894 in ?? ()
#9  0xf7799060 in ?? ()
#10 0xf77bc468 in ?? ()
#11 0xf77bc990 in ?? ()
#12 0x00020631 in ?? ()
#13 0x50545448 in ?? ()
#14 0x302e312f in ?? ()
#15 0x30303220 in ?? ()
#16 0x0d4b4f20 in ?? ()
#17 0x6e6f430a in ?? ()
#18 0x746e6574 in ?? ()
#19 0x6e654c2d in ?? ()
#20 0x3a687467 in ?? ()
#21 0x0a0d3120 in ?? ()
#22 0x6e6e6f43 in ?? ()
#23 0x69746365 in ?? ()
#24 0x203a6e6f in ?? ()
#25 0x736f6c63 in ?? ()
#26 0x430a0d65 in ?? ()
#27 0x65746e6f in ?? ()
---Type <return> to continue, or q <return> to quit---
#28 0x542d746e in ?? ()
#29 0x3a657079 in ?? ()
#30 0x78657420 in ?? ()
#31 0x74682f74 in ?? ()
#32 0x0a0d6c6d in ?? ()
#33 0x00310a0d in ?? ()
#34 0x2f72cf46 in ?? ()
#35 0xf7798e70 in ?? ()
#36 0x00000002 in ?? ()
#37 0xf7799060 in ?? ()
#38 0xffe21928 in ?? ()
#39 0xf778e6fe in ?? ()
#40 0xf7799060 in ?? ()
#41 0xf77bc46c in ?? ()
#42 0x00000002 in ?? ()
#43 0x00000004 in ?? ()
#44 0x0000000c in ?? ()
#45 0xffffffff in ?? ()
#46 0xf770ea87 in ?? ()
#47 0x2f72cf46 in ?? ()
#48 0xf7799060 in ?? ()
#49 0x00000000 in ?? ()

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冰之心 2024-11-08 16:34:30

尝试使用 bt - 检查更多帧,

例如
bt -100 将为您提供 100 帧,或者您可以使用 up 100

try to use bt - to check more frames

like
bt -100 will give you 100 frames or you can use up 100

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文