在Ubuntu 18.04.1上,我一直在使用lldb
和llnode
来调试node
。我很好奇gdb
是否会更好,所以我安装了它。之后,lldb
无法再加载core
文件。
这有效:
~$ lldb /usr/bin/node -c core
(lldb) target create "/usr/bin/node" --core "/home/ubuntu/core"
Core file '/home/ubuntu/core' (x86_64) was loaded.'
然后我安装了gdb
:
~$ sudo apt install gdb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
gdbserver libbabeltrace1 libc6-dbg libdw1
Suggested packages:
gdb-doc
The following NEW packages will be installed:
gdb gdbserver libbabeltrace1 libc6-dbg libdw1
0 upgraded, 5 newly installed, 0 to remove and 19 not upgraded.
Need to get 8737 kB of archives.
After this operation, 51.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://us-west-2.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libdw1 amd64 0.170-0.4 [203 kB]
Get:2 http://us-west-2.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libbabeltrace1 amd64 1.5.5-1 [154 kB]
Get:3 http://us-west-2.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 gdb amd64 8.1-0ubuntu3 [2937 kB]
Get:4 http://us-west-2.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 gdbserver amd64 8.1-0ubuntu3 [282 kB]
Get:5 http://us-west-2.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libc6-dbg amd64 2.27-3ubuntu1 [5161 kB]
Fetched 8737 kB in 1s (10.8 MB/s)
Selecting previously unselected package libdw1:amd64.
(Reading database ... 125740 files and directories currently installed.)
Preparing to unpack .../libdw1_0.170-0.4_amd64.deb ...
Unpacking libdw1:amd64 (0.170-0.4) ...
Selecting previously unselected package libbabeltrace1:amd64.
Preparing to unpack .../libbabeltrace1_1.5.5-1_amd64.deb ...
Unpacking libbabeltrace1:amd64 (1.5.5-1) ...
Selecting previously unselected package gdb.
Preparing to unpack .../gdb_8.1-0ubuntu3_amd64.deb ...
Unpacking gdb (8.1-0ubuntu3) ...
Selecting previously unselected package gdbserver.
Preparing to unpack .../gdbserver_8.1-0ubuntu3_amd64.deb ...
Unpacking gdbserver (8.1-0ubuntu3) ...
Selecting previously unselected package libc6-dbg:amd64.
Preparing to unpack .../libc6-dbg_2.27-3ubuntu1_amd64.deb ...
Unpacking libc6-dbg:amd64 (2.27-3ubuntu1) ...
Setting up libc6-dbg:amd64 (2.27-3ubuntu1) ...
Setting up libdw1:amd64 (0.170-0.4) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up gdbserver (8.1-0ubuntu3) ...
Setting up libbabeltrace1:amd64 (1.5.5-1) ...
Setting up gdb (8.1-0ubuntu3) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
现在lldb
无法再加载核心文件:
~$ lldb /usr/bin/node -c core
(lldb) target create "/usr/bin/node" --core "core"
error: core failed to load objfile for /home/ubuntu/core
error: Unable to find process plug-in for core file '/home/ubuntu/core'
该如何解决?我现在{@ 1}更喜欢我现在正在做的事情,并希望它回来。我尝试清除lldb
及其附加软件包,然后清除并重新安装gdb
,但这并不能解决任何问题。
答案 0 :(得分:2)
事实证明,lldb
在诊断和报告自身问题方面很糟糕。 Unable to find process plug-in
错误是failed to load objfile
错误的直接结果。
failed to load objfile
可以由任何原因引起。在某些版本中,这可能是由于权限导致核心文件不可读而引起的。在我的 post hoc,ergo propter hoc 案例中,gdb
装置是一个红色鲱鱼。该问题的实际原因是其他进程消耗了足够的内存,因此没有足够的可用内存来加载核心映像。通过停止内存占用进程来释放计算机上的内存,可以解决此问题。