Ubuntu – How to read or open .crash file from /var/crash

apportcrash

I am using Ubuntu 18.04 LTS and I am new in Ubuntu.

Crash file with name _usr_bin_gnome-shell.121.crash is getting generated inside /var/crash.

I read many posts that how to read/open .crash file for debugging but I am unable to open or read using apport-retrace and couldn't figure out what -dgb packages need to be installed and how to use them after installing them.

Also I tried apport-unpack but could't read the file.

Can anyone please describe all steps that how to read .crash file or what another tool can be used which is easy for new user to read .crash file from /var/crash.

Please answer this question if anyone know anything, I am really unable to read with all available solutions so far.

Thank you.

Best Answer

It depends on what you are trying to read. If you will be satisfied with text-only contents - use Parto's answer.

If you need to dig deeper - you have to use special applications apport-unpack (see its help via man apport-unpack or online). You can use it as follows:

# copy crash report somewhere
cp /var/crash/_usr_bin_gnome-shell.121.crash /tmp

# extract it
cd /tmp
apport-unpack _usr_bin_gnome-shell.121.crash _usr_bin_gnome-shell.121.crash-dir/

and you will get text user-friendly text-files with coredump separated from them:

$ ls -l _usr_bin_gnome-shell.121.crash-dir/ 
ApportVersion        _MarkForUpload        SourcePackage Architecture 
Package               Stacktrace CoreDump            
PackageArchitecture   StacktraceTop Date                 ProblemType  
Tags Dependencies         ProcCmdline           ThreadStacktrace
Disassembly          ProcCpuinfoMinimal    Title DistroRelease       
ProcCwd               Uname ExecutablePath       ProcMaps             
UnreportableReason ExecutableTimestamp  ProcStatus           
UpgradeStatus InstallationDate     ProcVersionSignature  UserGroups
InstallationMedia    Registers             XsessionErrors
JournalErrors        Signal 

Pages to read:

  1. https://wiki.ubuntu.com/Apport
  2. https://wiki.ubuntu.com/DebuggingProgramCrash