Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 May 2017 06:06:49 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-toolchain@FreeBSD.org
Subject:   [Bug 219153] head, stable/11, release/11.0.1: libkvm (& more?) not updated to handle powerpc/powerpc64 ET_DYN based vmcore.* 's and such
Message-ID:  <bug-219153-29464-RknVIF6wte@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-219153-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-219153-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219153

--- Comment #12 from Mark Millard <markmi@dsl-only.net> ---
(In reply to Mark Millard from comment #11)

So trying:

ps -M /var/crash/vmcore.2 -N /usr/lib/debug/boot/kernel/kernel.debug

for a vmcore.2 based on: debug.minidump=3D0

things do not work well either. A hint is that
core.txt.2 says all over the place:

Raw corefile not supported

(for both /usr/local/bin/ based and
/usr/libexec/ based generation of
core.txt.2 from vmcore.2 ).

The result for ps is that:

        struct kinfo_proc *
        kvm_getprocs(kvm_t *kd, int op, int arg, int *cnt)

gets to:

                        if (KREAD(kd, nl[0].n_value, &nprocs)) {
                                _kvm_err(kd, kd->program, "can't read nproc=
s");
                                return (0);
                        }

and calls the _kvm_err shown and
does not try to do any more.

(gdb) print *nl
$3 =3D {n_name =3D 0x41887179 "_nprocs", n_type =3D 9 '\t', n_other =3D 0 '=
\0', n_desc
=3D 0, n_value =3D 13942140}

13942140 =3D 0xD4BD7C

which is the right address (matching what
a live ddb reports for that kernel build
for nprocs [an address]).

But the vmcore.2 has 0xffffffff for
its VirtAddr and 0x0 for PhysAddr
(and Entry point):

# readelf -a /var/crash/vmcore.2
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 ff 00 00 00 00 00 00 00 00=20
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            StandAlone
  ABI Version:                       0
  Type:                              CORE (Core file)
  Machine:                           PowerPC 32-bit
  Version:                           0
  Entry point address:               0
  Start of program headers:          52 (bytes into file)
  Start of section headers:          0 (bytes into file)
  Flags:                             0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         1
  Size of section headers:           40 (bytes)
  Number of section headers:         0 (0)
  Section header string table index: 0

Elf file type is CORE (Core file)
Entry point 0x0
There are 1 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x001000 0xffffffff 0x00000000 0x80000000 0x80000000 R=20=
=20
0x1000

There are no sections in this file.

There is no dynamic section in this file.


It appears that 0xD4BD7C+0x1000 =3D=3D 0xD4CD7C
is the offset in the vmcore.2 file for
extracting nprocs and using:

cat /var/crash/vmcore.2 | hd | more

it looks correct (the 00 00 00 36):

00d4cd70  00 00 00 01 00 00 00 01  00 00 01 00 00 00 00 36  |..............=
.6|

(The surrounding area looks like in the
prior minidumps for what was around nprocs
and the 36 (hex) matches what ddb reported.)

So apparently libkvm does not deal with
this context.

/usr/local/bin/kgdb segmentation faulted
when attempted on vmcore.2 .

/usr/libexec/kgdb got:

Cannot access memory at address 0x0

instead.

[Both using /var/lib/debug/boot/kernel/kernel.debug .]

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-219153-29464-RknVIF6wte>