Re: kgdb assert while loading a kernel core

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 8 Aug 2019 10:33:28 -0700
On 7/30/19 2:53 AM, Weike.Chen_at_Dell.com wrote:
> 
>> -----Original Message-----
>> From: Cy Schubert <Cy.Schubert_at_cschubert.com>
>> Sent: Tuesday, July 30, 2019 3:49 AM
>> To: Chen, Alvin W <Weike_Chen_at_Dell.com>
>> Cc: freebsd-current_at_freebsd.org
>> Subject: Re: kgdb assert while loading a kernel core
>>
>>
>> [EXTERNAL EMAIL]
>>
>> In message
>> <e07d7daaa7d2442b87f794b8629bc578_at_KULX13MDC127.APAC.DELL.COM>
>> , Weike
>> .Chen_at_Dell.com writes:
>>>  Hi all,
>>>
>>>  I try to do some debugging for the FreeBSD kernel crash.
>>>  My system is FreeBSD 12. And I have a kernel core file, and while I
>>> load it by kgdb. It reports the following error:
>>>
>>>  Inferior.c: 287: internal-error: struct inferior
>>> *find_inferior_pid(int): As sertion 'pid != 0' failed.
>>>
>>>  And I also try the gdb in ports/devel, and got the same error.
>>>
>>>  Any workaround for the error?
>>
>> Which kgdb are you using? The /usr/libexec one or the port?
>>
> I use the kgdb in port, and I also try the kgdb in /usr/libexec, but it reports error "Cannot access memory at address 0x0" while loading my core file.

Usually this means that your vmcore file is not from the same kernel you are
passing to kgdb.  In the case of ports gdb the reason it crashes is that gdb
is finding that the value of 'dumptid' from the vmcore is 0 and normally
dumptid is the thread id of the thread that called panic.  The reason it
would be zero is if the vmcore doesn't match the kernel so the dumptid symbol
is mapped to some other random place in the vmcore that happens to be zero.

-- 
John Baldwin
Received on Thu Aug 08 2019 - 15:33:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:21 UTC