Web Analytics

Technically Impossible

Lets look at the weak link in your statement. Anything "Technically Impossible" basically means we haven't figured out how yet.

Step-by-step of coredumpctl and gdb

Abstract

I found that a cetain Flatpak application doesn't run. Starting it from command, it crashed and dumped core file due to segmentation fault.

In case of Windows, we can check details inside core file with WinDbg*1. In Linux, the same thing can be done with "coredumpctl"*2, and especially in the case of gdb*3, it is necessary to specify the following information.

  • core file
  • execution file
  • shared libraries

And encountered failure should be reported with these infomration together. This post introduces series of operation to specify them.

Although Clear Linux*4 is used in this post, introduced steps should work commonly among other Linux distributions.

Preparation

Run next commands in advance of "coredumpctl" or "gdb".

ulimit -a

cat /proc/sys/kernel/core_pattern
ls -la /usr/lib/systemd/coredump-wrapper
cat /usr/lib/systemd/coredump-wrapper

They checkes followings.

  1. whether the local environment dumps core file
  2. where core core file is dumped
  3. what "/usr/lib/systemd/coredump-wrapper" is
  4. inside of "/usr/lib/systemd/coredump-wrapper"

Output from "ultimate -a", especially information below shows the local environment dumps core file.

core file size unlimited
file size unlimited

And description of "core_pattern" indicates dumped core is piped to "/usr/lib/systemd/coredump-wrapper".
"coredump-wrapper" is shell script, and it shows either "crashprobe" or "systemd-coredump" manages core dump. Since the local envinronment in this post doesn't have "crashprobe", "systemd-coredump" is used in this case. To check its output, use "coredumpctl"

coredumpctl

Trouble this time is caused by Flatpak application. Run "coredumpctl" and focus "flatpak".

coredumpctl
coredumpctl list flatpak --since=2023-04-01

"coredumpctl" supports to run "gdb" without specifying execution file. It shows matter that seems to be cause of failure.

coredumpctl debug flatpak

🔎output from "coredumpctl debug flatpak"

From here on, operate as "gdb". Check back trace and shared libraries.

bt
info share

The report of trouble should include these information. If requested to provide actual files not only information, share files as

  • core dump
  • execution file
  • shared libraries

Paths of all these files are also already specified.

gdb

In case to use "gdb" directly, not "coredumpctl", the objectvie dump file and its stored folder should be specified in advance.

In case of Clear Linux, it is stored at "/var/lib/systemd/coredump/". And files are compressed with zst there. Extracting the objective one as "~/work/debug/core", its command is

ls -la /var/lib/systemd/coredump/
zstd -d /var/lib/systemd/coredump/<THE OBJECTIVE ONE>.zst -o ~/work/debug/core

gdb flatpak ~/work/debug/core