Segmentation fault (core dumped) - where to find dump?

Hi,
my Watchlist application crashes under certain circumstances on my device (XA2 Plus) - i get the following message in the log when i start the app via the terminal : Segmentation fault (core dumped)
Where can i find the core dump of the application crash or some other helpful information regarding the crash? I guess i need to deploy a version with debug information as well, i guess, right?

Thanks & Cheers,
Andreas

Hi. To get coredumps, you have to enable them first. There is no option in Settings, but it is Linux, so as root edit /etc/security/limits.conf and put to end:

root        hard        core        unlimited
root        soft        core        unlimited
nemo        hard        core        unlimited
nemo        soft        core        unlimited
defaultuser hard        core        unlimited
defaultuser soft        core        unlimited

and then edit /etc/sysctl.d/50-core_pattern.conf and put there:

kernel.core_pattern=core.%p

Then, restart your phone. You can try coredumps by executing:
kill -s ABRT <pid>
it should appear in your home directory…

Be aware that there are some system daemons that are crashing regularly. You need to cleanup core.* files time to time to avoid full disk :slight_smile:

When you execute:
file core.*
you will see what process generates specific coredump…

2 Likes

If you’re debugging using a core file you need the gdb debugger and it will need the debug information files available - they don’t necessarily need to be on the device, just where gdb is running.

But you can install gdb on the device and debug live - in this case you won’t even need the core file. GDB will tell you which debug packages it wants, most system packages have them available.

And yeah the ‘core dumped’ message sais that for historical reasons - cores are not dumped per default though even if it sais that.

1 Like

Btw, today - with sailjail - you have to use some path that is writable from the app (its cgroup namespace). So, I am using SD card for coredumps:

cat /etc/sysctl.d/50-core_pattern.conf
kernel.core_pattern=/media/sdcard/<sd card uuid>/core.%P.%E

And keep in mind that pid (%p) is always the same inside namespace, so it is necessary to use %P to get pid as visible from root namespace…

1 Like