File: README.rst

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (45 lines) | stat: -rw-r--r-- 1,777 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
How to create vmcores for tests
===============================

1. Boot a FreeBSD VM with as little memory as possible and create a core dump
   per `FreeBSD Handbook Kernel Debugging Chapter`_.  Note that you may need to
   reboot with more memory after the kernel panic as otherwise savecore(8) may
   fail.

   For instance, I was able to boot FreeBSD and qemu-system-x86_64 with 128 MiB
   RAM but had to increase it to 256 MiB for the boot after kernel panic.

2. Transfer the kernel image (``/boot/kernel/kernel``) and vmcore
   (``/var/crash/vmcore.latest``) from the VM.

3. Patch libfbsdvmcore using ``libfbsdvmcore-hacks.patch`` and build LLDB
   against the patched library.

4. Patch LLDB using ``lldb-minimize-processes.patch`` and build it.

   WARNING: LLDB will now modify core files in order to make the resulting
   test vmcores smaller.  Make a backup if necessary.

5. Do a test run of ``test.script`` in LLDB against the kernel + vmcore::

    lldb -b -s test.script --core /path/to/core /path/to/kernel

   If everything works fine, the LLDB output should be interspersed with
   ``%RD`` lines.  The vmcore will also be modified to shorten the process
   list in ``allproc``.

6. Open the vmcore in the patched LLDB again and choose interesting threads
   for testing.  Update thread numbers in ``test.script`` if necessary.

7. Use the ``copy-sparse.py`` tool to create a sparse version of the vmcore::

       lldb -b -s test.script --core /path/to/core /path/to/kernel |
           grep '^% RD' | python copy-sparse.py /path/to/core vmcore.sparse

8. Compress the sparse vmcore file using ``bzip2``::

       bzip2 -9 vmcore.sparse


.. _FreeBSD Handbook Kernel Debugging Chapter:
   https://docs.freebsd.org/en/books/developers-handbook/kerneldebug/