应用程序崩溃时如何在共享库libev中找到调用者函数
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用
bt -
检查更多帧,例如
bt -100
将为您提供 100 帧,或者您可以使用up 100
try to use
bt -
to check more frameslike
bt -100
will give you 100 frames or you can useup 100