Re: Panic when starting X with Intel KMS

From: Michael Butler <imb_at_protected-networks.net>
Date: Mon, 22 Jul 2013 16:03:13 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/21/13 03:18, Konstantin Belousov wrote:
> On Sat, Jul 20, 2013 at 01:20:56PM +0200, Oliver Pinter wrote:
>> On 7/20/13, Gustau P?rez i Querol <gperez_at_entel.upc.edu> wrote:
>>>     Reading the backtrace I see this:
>>>
>>>           panic: pmap_release: pmap resident count -398580 != 0
>>>
>>>     which comes from amd64/amd64/pmap.c:1936. I suspect that
>>> pmap->pm_stats.resident_count being negative is a bug.
> 
> The issue happened somewhere before the process exit.  Try the patch
> below, the idea is that your overflow count is really big, so the
> wrong-doer could cause underflow when acting.
> 
> diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
> index 19be4e0..fcdc6af 100644
> --- a/sys/amd64/amd64/pmap.c
> +++ b/sys/amd64/amd64/pmap.c
> _at__at_ -465,6 +465,9 _at__at_ pmap_resident_count_dec(pmap_t pmap, int count)
>  {
>  
>  	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
> +	KASSERT(pmap->pm_stats.resident_count >= count,
> +	    ("pmap %p resident count underflow %ld %d", pmap,
> +	    pmap->pm_stats.resident_count, count));
>  	pmap->pm_stats.resident_count -= count;
>  }
>  
> 

Post SVN r252653, I have experienced a similar problem but I'm not sure
it's related ..

root_at_toshi:/var/crash # less info.1
Dump header from device /dev/ada0s3b
  Architecture: i386
  Architecture Version: 2
  Dump Length: 205541376B (196 MB)
  Blocksize: 512
  Dumptime: Sat Jul 20 15:21:39 2013
  Hostname: toshi.auburn.protected-networks.net
  Magic: FreeBSD Kernel Dump
  Version String: FreeBSD 10.0-CURRENT #5 r253505M: Sat Jul 20 14:48:32
EDT 2013
    imb_at_toshi.auburn.protected-networks.net:/usr/obj/usr/src/sys/TOSHI
  Panic String: bad pte
  Dump Parity: 854235148
  Bounds: 1
  Dump Status: good

root_at_toshi:/var/crash # kgdb /boot/kernel.old/kernel vmcore.1

 [ snip ]

#0  0xc07b814c in doadump ()
(kgdb) bt
#0  0xc07b814c in doadump ()
#1  0xc07b86ec in kern_reboot ()
#2  0xc07b8b68 in panic ()
#3  0xc0b20b1d in pmap_remove_pages ()
#4  0xc0aa43dd in vmspace_exit ()
#5  0xc07814bf in exit1 ()
#6  0xc07ba5d5 in sigexit ()
#7  0xc07bd35f in postsig ()
#8  0xc0804e1b in ast ()
#9  0xc0b132b7 in doreti_ast ()
#10 0xf1633d08 in ?? ()
#11 0x2c00003b in ?? ()
#
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (FreeBSD)

iEYEARECAAYFAlHtkAAACgkQQv9rrgRC1JIILgCfRP+I8n2Jq2+RFxO1HJLJQv3s
t0IAn0TRPBvQYrNvRcihBKi5BuASxtkT
=FpMp
-----END PGP SIGNATURE-----
Received on Mon Jul 22 2013 - 18:03:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:39 UTC