nic*_*000 7 c# linux gdb futex .net-core
我正在以下 Linux 嵌入式系统上运行 dotnet core 2.1 应用程序:
Linux arm 4.14.67-1.0.7+ #52 SMP PREEMPT armv7l GNU/Linux
Run Code Online (Sandbox Code Playgroud)
该应用程序在 futex 上挂起几天了:
root@arm:/# strace -p 525
strace: Process 525 attached
futex(0x4a6f4, FUTEX_WAIT_PRIVATE, 29517, NULL
<detached ...>
Run Code Online (Sandbox Code Playgroud)
我必须找出哪一行 c# 代码产生相应的 futex 调用而不停止进程。如何找到返回生成相应 futex 系统调用的 C# 代码行的方法?
我发现/proc/525/maps地址 0x4a6f4 是堆内存的一部分:
00008000-00019000 r-xp 00000000 00:10 6906 /root/dotnet/dotnet
00021000-00022000 r--p 00011000 00:10 6906 /root/dotnet/dotnet
00022000-00023000 rw-p 00012000 00:10 6906 /root/dotnet/dotnet
00023000-001c6000 rw-p 00000000 00:00 0 [heap]
a545c000-a545d000 ---p 00000000 00:00 0
...
Run Code Online (Sandbox Code Playgroud)
但是我如何才能将该地址与一行代码关联起来呢?我尝试运行gdb -p 525但收到错误
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Run Code Online (Sandbox Code Playgroud)
检查 libpthread 库:
root@arm:~/dotnet# ldd /root/dotnet/dotnet
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6f16000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6ef2000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6de6000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6d6e000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6d45000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6c57000)
/lib/ld-linux-armhf.so.3 (0xb6f29000)
Run Code Online (Sandbox Code Playgroud)
我的 .gdbinit 文件:
root@arm:~/dotnet# cat /root/.gdbinit
set auto-load safe-path /
set libthread-db-search-path /lib/arm-linux-gnueabihf
set env LD_PRELOAD /lib/arm-linux-gnueabihf/libpthread.so.0
Run Code Online (Sandbox Code Playgroud)
因此whereorbt在 gdb 中不起作用:
(gdb) where
#0 0xb6f56344 in pthread_getattr_default_np (out=0xfffffff0) at pthread_getattr_default_np.c:34
#1 0xb2bdf998 in ?? ()
Run Code Online (Sandbox Code Playgroud)
有什么想法如何解决这个问题吗?提前致谢!
| 归档时间: |
|
| 查看次数: |
600 次 |
| 最近记录: |