I'm developing an application with C++14/clang/cmake/lldb toolchain in Manjaro Linux. And it produces some coredumps while testing. For example:
$ ls -la /var/lib/systemd/coredump/
core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000.lz4
How could I debug this ? I tried with 2 options:
- decompress lz4 file and use
lldb -c. - use
coredumpctl debug.
For option-1:
$ sudo unlz4 core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000.lz4
It gives me: core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000.
Then lldb -c core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000.
Then bt all, which gives me:
(lldb) target create --core "core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000"
error: Unable to find process plug-in for core file '/var/lib/systemd/coredump/core.myapp-test.1000.1faf20db6d6048a18c4b6d28ea2776ee.1973.1590231863000000000000'
(lldb) bt all
error: invalid process
Option-1 failed.
For option-2:
$ coredumpctl list
It gives me:
TIME PID UID GID SIG COREFILE EXE
Sat 2020-05-23 19:04:24 CST 1973 1000 1000 6 present /home/linrongbin/workspace/myapp/debug/test/myapp-test
Then: $coredumpctl debug 1973
It gives me:
...
Failed to invoke gdb: No such file or directory
Option-2 failed as well.
So, for option-1, how could I decompressed lz4 coredump successfully and debug it? For option-2, how could I invoke lldb in coredumpctl ?