Detect kernel crashdump

Bug #241322 reported by Ben Collins on 2008-06-19
4
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Undecided
Martin Pitt

Bug Description

Binary package hint: apport

As per our IRC conversation. In order to detect that there was a kernel crash which was handled by kdump, there will be a /var/crash/vmcore.log that exists on boot. Accompanying this should be a /var/crash/vmcore (which is the actual kernel core file), but it can some times be missing if there was an error writing it to the harddrive, or reading from /proc/vmcore.

Apport should tell the user that a kernel crash occurred. If there is a vmcore file, the user should file a bug and include that file. No bug report should be filed without the vmcore file (either because the user didn't want to, or because it didn't exist).

Note that this functionality will only exist when the user has manually installed kdump related packages and a debug kernel. It is hoped that this will be facilitated with a linux-kdump-generic meta package (and similar for other flavors).

Changed in apport:
assignee: nobody → pitti
Martin Pitt (pitti) on 2008-06-19
Changed in apport:
status: New → In Progress
Matt Zimmerman (mdz) wrote :

instead of teaching apport about vmcore files, it seems to me that the kernel crash dump scripts should handle detecting the vmcore and munging it into an apport crash file in /var/crash (which would then be detected and reported by the existing tools).

Martin Pitt (pitti) wrote :

I just think it makes sense to pick up the kernel crash dump in apport's init script. Would the kernel have an equivalent init.d-like script which is run at boot which could do that?

Note to self: Matt has a helpful addition to the package hook:

> hal = Popen(['lshal', '-u',
> '/org/freedesktop/Hal/devices/computer'],
> stdout=PIPE).stdout.read()
> report['HalComputerInfo'] = hal

On Thu, Jul 24, 2008 at 08:45:47AM -0000, Martin Pitt wrote:
> I just think it makes sense to pick up the kernel crash dump in apport's
> init script. Would the kernel have an equivalent init.d-like script
> which is run at boot which could do that?

It looks like makedumpfile is responsible for out the core from initramfs;
perhaps it could have an init script as well.

> Note to self: Matt has a helpful addition to the package hook:
>
> > hal = Popen(['lshal', '-u',
> > '/org/freedesktop/Hal/devices/computer'],
> > stdout=PIPE).stdout.read()
> > report['HalComputerInfo'] = hal

I'll attach the complete package hook here, though it should probably ship
with the kernel, don't you think?

--
 - mdz

Matt Zimmerman (mdz) wrote :
Matt Zimmerman (mdz) wrote :

I've filed the kernel package hook as bug 251441 on the kernel

Matt Zimmerman (mdz) wrote :

FYI, I asked about testing this, and Ben responded:

> Is there a way to trigger a dump for test purposes? How did you do your
> testing?

# echo c > /proc/sysrq-trigger

Martin Pitt (pitti) wrote :

Fixed in bzr head.

Changed in apport:
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :
Download full text (3.8 KiB)

This bug was fixed in the package apport - 0.111

---------------
apport (0.111) intrepid; urgency=low

  The "(Kernel) OOPS, I dumped it again!" release.

  * apport/ui.py: Fix test_run_report_bug_unpackaged_pid() to work with the
    installed run-tests from the package as well.
  * apport/crashdb_impl/launchpad.py: Ignore broken LP bug tasks instead of
    crashing on them.
  * apport/report.py, add_proc_info(): Report the AppArmor or SELinux context
    in a new ProcAttrCurrent field, read from /proc/pid/attr/current.
    Document it in doc/data-format.tex. The field will not be added if the
    proc attribute cannot be read or isn't present. Thanks to Steve Beattie
    for the patch and the suggestion!
  * debian/local/setup-apport-retracer: Switch to intrepid.
  * debian/local/setup-apport-retracer: Fix installation of python-apt. Also
    install apt, to avoid library version mismatches to python-apt.
  * debian/apport.default: Enable apport by default again, now that we have
    working retracers.
  * apport/report.py, test_add_gdb_info_script(): Use bash, not dash as test
    program for core dumping; stack trace is awkwardly bad with dash, so that
    the test case cannot really work any more.
  * Add package-hooks/source_linux.py: Package hook for collecting kernel
    related information. By Matt Zimmerman, thank you! (LP: #251441)
  * debian/local/ubuntu-bug.1: Fix documentation of -p, it specifies the
    binary package name, not the source.
  * apport/packaging.py: Add get_kernel_package() to return the actual Linux
    kernel package name; useful if the user reports a bug against just
    "linux". Implement it in backends/packaging-apt-dpkg.py.
  * apport/ui.py: "Do what I mean" when filing a bug against "linux" and
    report it against the actual kernel package.
  * debian/local/ubuntu-bug: If just one argument is given, infer -p/-P from
    the type of the argument.
  * apport/ui.py: Drop the PackageArchitecture field for the uploaded report
    if it is equal to Architecture. Adapt apport/crashdb_impl/launchpad.py to
    fall back to Architecture, and mention the change in doc/data-format.tex.
  * problem_report.py, write_mime(): Add new "skip_keys" argument to filter
    out keys. Add test cases.
  * apport/crashdb_impl/launchpad.py: Do not write the "Date:" field on
    upload(), and fetch it from the bug metadata in download().
  * apport/crashdb_impl/launchpad.py, download(): Support reading bugs with
    the "--- " separator instead of "ProblemType: ". Launchpad doesn't create
    bugs that way ATM, but at least we have the reading part implemented now.
  * package-hooks/source_linux.py: Drop Uname, ProcVersion, and
    RunningKernelVersion fields, since they are all subsumed in the
    ProcVersionSignature field.
  * apport/ui.py, run_report_bug(): Strip spaces from package argument.
  * apport/ui.py, add_hooks_info(): Collect OS info first, then call the
    package hooks, so that the linux hook actually has a chance to delete the
    Uname field.
  * bin/kernel_hook, test-hooks: Throw away the original kernel hook which
    we never used (and got superseded by the proper source_linux.py package
    hook now). Repl...

Read more...

Changed in apport:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers