Re: Panic when starting X with Intel KMS

2013-07-29 Thread Neel Natu
Hi Michael,

On Mon, Jul 29, 2013 at 7:05 AM, Michael Butler
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> I wrote:
>
>> Post SVN r252653, I have experienced a similar problem but I'm not sure
>> it's related ..
>
> This is related to SVN r252653 - reverting it solves the instances of
> the panic detailed below.
>
> The recent modification to amd64 addresses the issue but does nothing to
> help this CPU ..
>
> CPU: Genuine Intel(R) CPU   T2300  @ 1.66GHz (1662.53-MHz
> 686-class CPU)
>   Origin = "GenuineIntel"  Id = 0x6e8  Family = 0x6  Model = 0xe
> Stepping = 8
>
> Features=0xbfe9fbff
>   Features2=0xc1a9
>   TSC: P-state invariant, performance statistics
>
>  .. which claims to have ..
>
> imb@toshi:/home/imb> sysctl vm.pmap
> vm.pmap.pv_entry_count: 627756
> vm.pmap.pde.promotions: 20165
> vm.pmap.pde.p_failures: 44416
> vm.pmap.pde.mappings: 0
> vm.pmap.pde.demotions: 19659
> vm.pmap.shpgperproc: 200
> vm.pmap.pv_entry_max: 2000208
> vm.pmap.pg_ps_enabled: 1
> vm.pmap.pat_works: 1
>
> Perhaps an equivalent patch to i386/pmap.c is appropriate here?
>

Let me take a look at the i386/pmap and get back to you.

best
Neel

>> root@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
>> i...@toshi.auburn.protected-networks.net:/usr/obj/usr/src/sys/TOSHI
>>   Panic String: bad pte
>>   Dump Parity: 854235148
>>   Bounds: 1
>>   Dump Status: good
>>
>> root@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 0x2c3b in ?? ()
>> #
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.14 (FreeBSD)
>
> iEYEARECAAYFAlH2dpQACgkQQv9rrgRC1JKpagCfUTQI8XJigFB9OFWxk05oLnnA
> onIAoJkBE0O5JoPx+Mz40JBCquBSfthD
> =w566
> -END PGP SIGNATURE-
> ___
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Panic when starting X with Intel KMS

2013-07-29 Thread Michael Butler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I wrote:

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

This is related to SVN r252653 - reverting it solves the instances of
the panic detailed below.

The recent modification to amd64 addresses the issue but does nothing to
help this CPU ..

CPU: Genuine Intel(R) CPU   T2300  @ 1.66GHz (1662.53-MHz
686-class CPU)
  Origin = "GenuineIntel"  Id = 0x6e8  Family = 0x6  Model = 0xe
Stepping = 8

Features=0xbfe9fbff
  Features2=0xc1a9
  TSC: P-state invariant, performance statistics

 .. which claims to have ..

imb@toshi:/home/imb> sysctl vm.pmap
vm.pmap.pv_entry_count: 627756
vm.pmap.pde.promotions: 20165
vm.pmap.pde.p_failures: 44416
vm.pmap.pde.mappings: 0
vm.pmap.pde.demotions: 19659
vm.pmap.shpgperproc: 200
vm.pmap.pv_entry_max: 2000208
vm.pmap.pg_ps_enabled: 1
vm.pmap.pat_works: 1

Perhaps an equivalent patch to i386/pmap.c is appropriate here?

> root@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
> i...@toshi.auburn.protected-networks.net:/usr/obj/usr/src/sys/TOSHI
>   Panic String: bad pte
>   Dump Parity: 854235148
>   Bounds: 1
>   Dump Status: good
> 
> root@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 0x2c3b in ?? ()
> #
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (FreeBSD)

iEYEARECAAYFAlH2dpQACgkQQv9rrgRC1JKpagCfUTQI8XJigFB9OFWxk05oLnnA
onIAoJkBE0O5JoPx+Mz40JBCquBSfthD
=w566
-END PGP SIGNATURE-
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Panic when starting X with Intel KMS

2013-07-23 Thread Gustau Pérez i Querol

Al 22/07/2013 23:27, En/na Neel Natu ha escrit:


Could you apply the following patch to amd64/amd64/pmap.c and see if
it fixes the problem:

http://people.freebsd.org/~neel/patches/pmap_remove_pages.patch



   Neel came with another patch:

 http://people.freebsd.org/~neel/patches/pmap_remove_pages.patch

   I've playing with it an the system seemed stable.

   Neel will commit that patch soon.

   Gus

--
   Salut i força,

   Gustau

---
Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style  

O O O Gustau Pérez i Querol
O O O Unitat de Gestió dels departaments
O O O Matemàtica Aplicada IV i Enginyeria Telemàtica

  Universitat Politècnica de Catalunya
  Edifici C3 - Despatx S101-B
 UPC  Campus Nord UPC
  C/ Jordi Girona, 1-3
  08034 - Barcelona

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Panic when starting X with Intel KMS

2013-07-22 Thread Neel Natu
Hi Gustau,

On Mon, Jul 22, 2013 at 12:38 PM, Gustau Pérez i Querol
 wrote:
> Al 22/07/2013 13:19, En/na Konstantin Belousov ha escrit:
>
>> On Mon, Jul 22, 2013 at 12:43:56PM +0200, Gustau P??rez i Querol wrote:
>
> As a blind shot, try to
> revert r252653.
>>>
>>>  r252652 works OK. r252653 panics.
>>
>> What if, instead of reverting r252653, apply the following:
>>
>> diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
>> index 66f3b0c..78f07f7 100644
>> --- a/sys/vm/vm_phys.c
>> +++ b/sys/vm/vm_phys.c
>> @@ -547,6 +547,8 @@ vm_phys_fictitious_reg_range(vm_paddr_t start,
>> vm_paddr_t end,
>> pi = atop(start);
>> if (pi >= first_page && atop(end) < vm_page_array_size) {
>> fp = &vm_page_array[pi - first_page];
>> +   for (i = 0; i < page_count; i++)
>> +   fp[i].flags = 0;
>> malloced = FALSE;
>> } else
>>   #endif
>>
>> ?
>
>
>After applying the patch the system panics for the same reason and the
> KASSERT didn't evaluate like before. The count now when the system panics
> seem to have been overflowed again, you can find the core at:
>
>  https://dl.dropboxusercontent.com/u/2094962/core.txt.6
>

Could you apply the following patch to amd64/amd64/pmap.c and see if
it fixes the problem:

http://people.freebsd.org/~neel/patches/pmap_remove_pages.patch

best
Neel

>
>
>
>
>
>
>
> --
>Salut i força,
>
>Gustau
>
> ---
> Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
> Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style
>
> O O O Gustau Pérez i Querol
> O O O Unitat de Gestió dels departaments
> O O O Matemàtica Aplicada IV i Enginyeria Telemàtica
>
>   Universitat Politècnica de Catalunya
>   Edifici C3 - Despatx S101-B
>  UPC  Campus Nord UPC
>   C/ Jordi Girona, 1-3
>   08034 - Barcelona
>
> ___
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Panic when starting X with Intel KMS

2013-07-22 Thread Michael Butler
-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  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
> @@ -465,6 +465,9 @@ 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@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
i...@toshi.auburn.protected-networks.net:/usr/obj/usr/src/sys/TOSHI
  Panic String: bad pte
  Dump Parity: 854235148
  Bounds: 1
  Dump Status: good

root@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 0x2c3b in ?? ()
#
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.13 (FreeBSD)

iEYEARECAAYFAlHtkAAACgkQQv9rrgRC1JIILgCfRP+I8n2Jq2+RFxO1HJLJQv3s
t0IAn0TRPBvQYrNvRcihBKi5BuASxtkT
=FpMp
-END PGP SIGNATURE-
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Panic when starting X with Intel KMS

2013-07-22 Thread Gustau Pérez i Querol

Al 22/07/2013 13:19, En/na Konstantin Belousov ha escrit:

On Mon, Jul 22, 2013 at 12:43:56PM +0200, Gustau P??rez i Querol wrote:

As a blind shot, try to
revert r252653.

 r252652 works OK. r252653 panics.

What if, instead of reverting r252653, apply the following:

diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
index 66f3b0c..78f07f7 100644
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -547,6 +547,8 @@ vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t 
end,
pi = atop(start);
if (pi >= first_page && atop(end) < vm_page_array_size) {
fp = &vm_page_array[pi - first_page];
+   for (i = 0; i < page_count; i++)
+   fp[i].flags = 0;
malloced = FALSE;
} else
  #endif

?


   After applying the patch the system panics for the same reason and 
the KASSERT didn't evaluate like before. The count now when the system 
panics seem to have been overflowed again, you can find the core at:


 https://dl.dropboxusercontent.com/u/2094962/core.txt.6







--
   Salut i força,

   Gustau

---
Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style  

O O O Gustau Pérez i Querol
O O O Unitat de Gestió dels departaments
O O O Matemàtica Aplicada IV i Enginyeria Telemàtica

  Universitat Politècnica de Catalunya
  Edifici C3 - Despatx S101-B
 UPC  Campus Nord UPC
  C/ Jordi Girona, 1-3
  08034 - Barcelona

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Panic when starting X with Intel KMS

2013-07-22 Thread Konstantin Belousov
On Mon, Jul 22, 2013 at 12:43:56PM +0200, Gustau P??rez i Querol wrote:
> >> As a blind shot, try to
> >> revert r252653.
> 
> r252652 works OK. r252653 panics.

What if, instead of reverting r252653, apply the following:

diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
index 66f3b0c..78f07f7 100644
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -547,6 +547,8 @@ vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t 
end,
pi = atop(start);
if (pi >= first_page && atop(end) < vm_page_array_size) {
fp = &vm_page_array[pi - first_page];
+   for (i = 0; i < page_count; i++)
+   fp[i].flags = 0;
malloced = FALSE;
} else
 #endif

?


pgpDg9B5VMeW6.pgp
Description: PGP signature


Re: Panic when starting X with Intel KMS

2013-07-22 Thread Gustau Pérez i Querol



Show me the verbose dmesg, including the i915 driver attach.


   Will do it tomorrow morning (I'm UTC+1).




   Here you have the verbose dmesg and the i915 before the panic:

https://dl.dropboxusercontent.com/u/2094962/panic_r252653.tar.gz


As a blind shot, try to
revert r252653.


   r252652 works OK. r252653 panics.

   Any other info let me you.


--
   Salut i força,

   Gustau

---
Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style  

O O O Gustau Pérez i Querol
O O O Unitat de Gestió dels departaments
O O O Matemàtica Aplicada IV i Enginyeria Telemàtica

  Universitat Politècnica de Catalunya
  Edifici C3 - Despatx S101-B
 UPC  Campus Nord UPC
  C/ Jordi Girona, 1-3
  08034 - Barcelona

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Re: Panic when starting X with Intel KMS

2013-07-21 Thread Andriy Gapon
on 21/07/2013 23:25 Gustau Pérez i Querol said the following:
> github repo hasn't the svn revision

The github repo does have svn revision numbers -- as git notes (google for this
term).

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Re: Panic when starting X with Intel KMS

2013-07-21 Thread Gustau Pérez i Querol

Al 21/07/2013 20:51, En/na Konstantin Belousov ha escrit:


 Hi,

 the assert doesn't happen (that's resident_count is not bigger than
count). You can find the complete core at:

https://dl.dropboxusercontent.com/u/2094962/core.txt.5
I do not understand what do you mean, it seems that core.txt.5 has
exactly the assertion fired which I added.


   I was trying to state what you suspected: the condition in the 
assert did not hold so the kernel paniced.



Show me the verbose dmesg, including the i915 driver attach.


   Will do it tomorrow morning (I'm UTC+1).


Did the issue started at some moment, or it is a new install which
exhibit the problem from the beginning ?
   It was an update of a three months old head machine. A dicotomic 
search would be a long process (I'd say).



As a blind shot, try to
revert r252653.


 I tried 252528 (I picked that randomly, only wanting to try to 
avoid r252695 and r252653 because they state they had to do with pmaps) 
and it works fine. Tomorrow I'm gonna revert to 252653 and 252652 and 
see what happens.


   OFFTOPIC: I used to track src via gitorious but they lag behind and 
the github repo hasn't the svn revisionm does anyone know of any other 
git repo with the svn revision?




I am sure that the serial console would be useful, but I did not decided
yet on where to start looking.


  Well, if you need some testing via serial be sure it will be possible.



--
   Salut i força,

   Gustau

---
Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style  

O O O Gustau Pérez i Querol
O O O Unitat de Gestió dels departaments
O O O Matemàtica Aplicada IV i Enginyeria Telemàtica

  Universitat Politècnica de Catalunya
  Edifici C3 - Despatx S101-B
 UPC  Campus Nord UPC
  C/ Jordi Girona, 1-3
  08034 - Barcelona

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Re: Panic when starting X with Intel KMS

2013-07-21 Thread Konstantin Belousov
On Sun, Jul 21, 2013 at 11:31:34AM +0200, Gustau P?rez i Querol wrote:
> 
> > 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
> > @@ -465,6 +465,9 @@ 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;
> >   }
> >   
> Hi,
> 
> the assert doesn't happen (that's resident_count is not bigger than 
> count). You can find the complete core at:
> 
>https://dl.dropboxusercontent.com/u/2094962/core.txt.5
I do not understand what do you mean, it seems that core.txt.5 has
exactly the assertion fired which I added.

Show me the verbose dmesg, including the i915 driver attach.

Did the issue started at some moment, or it is a new install which
exhibit the problem from the beginning ?  As a blind shot, try to
revert r252653.

I am sure that the serial console would be useful, but I did not decided
yet on where to start looking.


pgplk0TLPExt6.pgp
Description: PGP signature


Re: Panic when starting X with Intel KMS

2013-07-21 Thread Gustau Pérez i Querol



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
@@ -465,6 +465,9 @@ 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;
  }
  

   Hi,

   the assert doesn't happen (that's resident_count is not bigger than 
count). You can find the complete core at:


  https://dl.dropboxusercontent.com/u/2094962/core.txt.5

   I'm no expert on that, but would this mean that the process, while 
freeying mem, causes the kernel to free more maps than the process has?


   Any other info during the panic, let me know (I have a second 
machine and I can connect to it via serial port).


   OTOH, in puzzled because the stack gets corrupted an thus I can't 
check which is the offending process (I don't know if that would be of 
any use in this situation).  It is my understanding that isn't the 
process who should be fixed but the kernel side. In this case the stack 
corruption isn't that very important (at least this is what I think), 
but sometimes it is very handy.



--
   Salut i força,

   Gustau

---
Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style  

O O O Gustau Pérez i Querol
O O O Unitat de Gestió dels departaments
O O O Matemàtica Aplicada IV i Enginyeria Telemàtica

  Universitat Politècnica de Catalunya
  Edifici C3 - Despatx S101-B
 UPC  Campus Nord UPC
  C/ Jordi Girona, 1-3
  08034 - Barcelona

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Panic when starting X with Intel KMS

2013-07-21 Thread Konstantin Belousov
On Sat, Jul 20, 2013 at 01:20:56PM +0200, Oliver Pinter wrote:
> On 7/20/13, Gustau P?rez i Querol  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
@@ -465,6 +465,9 @@ 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;
 }
 


pgpxM5H2dUidH.pgp
Description: PGP signature


Re: Panic when starting X with Intel KMS

2013-07-20 Thread Oliver Pinter
On 7/20/13, Gustau Pérez i Querol  wrote:
> Al 17/07/2013 21:05, En/na Gustau Pérez i Querol ha escrit:
>> Hi,
>>
>>I'm having panics or hard freezes when starting X with an Intel
>> video card. The machine is able to start old X+twm without problems
>> but when I try gnome3 (in normal or fallback mode, doesn't matter) the
>> machine panics or hard freezes.
>>
>>This doesn't happen when running X with vesa. With vesa the gnome
>> is able to start in fallback (no composition) mode. Also, an old i386
>> with an nvidia card is able to run that gnome3 with composition so I'd
>> say it has to do with the intel card.
>>
>>These are the specs of the machine:
>>
>>  FreeBSD 10.0-CURRENT #4 r+3dc57aa: Wed Jul 17 15:13:07 CEST 2013
>>  root@portgus:/usr/obj/usr/src/sys/CUSTOM amd64
>>  FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
>>  RAM: 8GB
>>  Video Card: Intel chipid=0x00468086
>>
>>The debugging knobs in the kernel config are there. I can also
>> confirm that I can break to the debugger with CTRL+ALT+ESC before
>> starting X. The world was build without debug symbols.
>>
>>Because the machine runs with an Intel card, I had to use my $work
>> dockstation to obtain a serial port and do the debug via serial port
>> with another machine.
>>
>>   When starting X, either the machine freezes hard (and so no
>> CTRL+ALT+ESC) or the machine panics. It has never executed X without
>> panics or freezes.
>>
>>I was able to obtain a core dump, the results are at:
>>
>> https://dl.dropboxusercontent.com/u/2094962/core.txt.4
>>
>>I was unable to dive any further because the dump only shows the
>> kernel side of things. The bt only seems to show the kernel side and
>> the user side of things seems to be corrupt.
>>
>>Any other info I can obtain from the machine in the moment of the
>> panic, let me know. I can easy do the debug via serial port.
>>
>>Gus
>>
>
> 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.
>
> Can this be caused by a userspace process? If that's possible, any
> idea why I get a corrupted stack an thus I'm not able to find the root
> of the problem.

Added kib@ to CC.

>
> G.
>
>
> --
> Salut i força,
>
> Gustau
>
> ---
> Prou top-posting :http://ca.wikipedia.org/wiki/Top-posting
> Stop top-posting :http://en.wikipedia.org/wiki/Posting_style  
>
> O O O Gustau Pérez i Querol
> O O O Unitat de Gestió dels departaments
> O O O Matemàtica Aplicada IV i Enginyeria Telemàtica
>
>Universitat Politècnica de Catalunya
>Edifici C3 - Despatx S101-B
>   UPC  Campus Nord UPC
>C/ Jordi Girona, 1-3
>08034 - Barcelona
>
> ___
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Panic when starting X with Intel KMS

2013-07-20 Thread Gustau Pérez i Querol

Al 17/07/2013 21:05, En/na Gustau Pérez i Querol ha escrit:

Hi,

   I'm having panics or hard freezes when starting X with an Intel 
video card. The machine is able to start old X+twm without problems 
but when I try gnome3 (in normal or fallback mode, doesn't matter) the 
machine panics or hard freezes.


   This doesn't happen when running X with vesa. With vesa the gnome 
is able to start in fallback (no composition) mode. Also, an old i386 
with an nvidia card is able to run that gnome3 with composition so I'd 
say it has to do with the intel card.


   These are the specs of the machine:

 FreeBSD 10.0-CURRENT #4 r+3dc57aa: Wed Jul 17 15:13:07 CEST 2013
 root@portgus:/usr/obj/usr/src/sys/CUSTOM amd64
 FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
 RAM: 8GB
 Video Card: Intel chipid=0x00468086

   The debugging knobs in the kernel config are there. I can also 
confirm that I can break to the debugger with CTRL+ALT+ESC before 
starting X. The world was build without debug symbols.


   Because the machine runs with an Intel card, I had to use my $work 
dockstation to obtain a serial port and do the debug via serial port 
with another machine.


  When starting X, either the machine freezes hard (and so no 
CTRL+ALT+ESC) or the machine panics. It has never executed X without 
panics or freezes.


   I was able to obtain a core dump, the results are at:

https://dl.dropboxusercontent.com/u/2094962/core.txt.4

   I was unable to dive any further because the dump only shows the 
kernel side of things. The bt only seems to show the kernel side and 
the user side of things seems to be corrupt.


   Any other info I can obtain from the machine in the moment of the 
panic, let me know. I can easy do the debug via serial port.


   Gus



   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.


   Can this be caused by a userspace process? If that's possible, any 
idea why I get a corrupted stack an thus I'm not able to find the root 
of the problem.


   G.


--
   Salut i força,

   Gustau

---
Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style  

O O O Gustau Pérez i Querol
O O O Unitat de Gestió dels departaments
O O O Matemàtica Aplicada IV i Enginyeria Telemàtica

  Universitat Politècnica de Catalunya
  Edifici C3 - Despatx S101-B
 UPC  Campus Nord UPC
  C/ Jordi Girona, 1-3
  08034 - Barcelona

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Panic when starting X with Intel KMS

2013-07-17 Thread Gustau Pérez i Querol

   Hi,

   I'm having panics or hard freezes when starting X with an Intel 
video card. The machine is able to start old X+twm without problems but 
when I try gnome3 (in normal or fallback mode, doesn't matter) the 
machine panics or hard freezes.


   This doesn't happen when running X with vesa. With vesa the gnome is 
able to start in debug mode. Also, an old i386 with an nvidia card is 
able to run that gnome3 with composition so I'd say it has to do with 
the intel card.


   These are the specs of the machine:

 FreeBSD 10.0-CURRENT #4 r+3dc57aa: Wed Jul 17 15:13:07 CEST 2013
 root@portgus:/usr/obj/usr/src/sys/CUSTOM amd64
 FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
 RAM: 8GB
 Video Card: Intel chipid=0x00468086

   The debugging knobs in the kernel config are there. I can also 
confirm that I can break to the debugger with CTRL+ALT+ESC before 
starting X. The world was build without debug symbols.


   Because the machine runs with an Intel card, I had to use my $work 
dockstation to obtain a serial port and do the debug via serial port.


  When starting X, either the machine freezes hard (and so no 
CTRL+ALT+ESC) or the machine panics. It has never executed X without 
panics or freezes.


   I was able to obtain a core dump, the results are at:

https://dl.dropboxusercontent.com/u/2094962/core.txt.4

   I was unable to dive further because the dump only shows the kernel 
side of things. The bt only seems to show the kernel side an the user 
side of things seems  to be corrupt. Any other info I can provide, let 
me know. I can easy do the debug via serial port.


   Gus

--
   Salut i força,

   Gustau

---
Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style  

O O O Gustau Pérez i Querol
O O O Unitat de Gestió dels departaments
O O O Matemàtica Aplicada IV i Enginyeria Telemàtica

  Universitat Politècnica de Catalunya
  Edifici C3 - Despatx S101-B
 UPC  Campus Nord UPC
  C/ Jordi Girona, 1-3
  08034 - Barcelona

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Panic when starting X with Intel KMS

2013-07-17 Thread Gustau Pérez i Querol

   Hi,

   I'm having panics or hard freezes when starting X with an Intel 
video card. The machine is able to start old X+twm without problems but 
when I try gnome3 (in normal or fallback mode, doesn't matter) the 
machine panics or hard freezes.


   This doesn't happen when running X with vesa. With vesa the gnome is 
able to start in fallback (no composition) mode. Also, an old i386 with 
an nvidia card is able to run that gnome3 with composition so I'd say it 
has to do with the intel card.


   These are the specs of the machine:

 FreeBSD 10.0-CURRENT #4 r+3dc57aa: Wed Jul 17 15:13:07 CEST 2013
 root@portgus:/usr/obj/usr/src/sys/CUSTOM amd64
 FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
 RAM: 8GB
 Video Card: Intel chipid=0x00468086

   The debugging knobs in the kernel config are there. I can also 
confirm that I can break to the debugger with CTRL+ALT+ESC before 
starting X. The world was build without debug symbols.


   Because the machine runs with an Intel card, I had to use my $work 
dockstation to obtain a serial port and do the debug via serial port 
with another machine.


  When starting X, either the machine freezes hard (and so no 
CTRL+ALT+ESC) or the machine panics. It has never executed X without 
panics or freezes.


   I was able to obtain a core dump, the results are at:

https://dl.dropboxusercontent.com/u/2094962/core.txt.4

   I was unable to dive any further because the dump only shows the 
kernel side of things. The bt only seems to show the kernel side and the 
user side of things seems to be corrupt.


   Any other info I can obtain from the machine in the moment of the 
panic, let me know. I can easy do the debug via serial port.


   Gus

--
   Salut i força,

   Gustau

---
Prou top-posting :  http://ca.wikipedia.org/wiki/Top-posting
Stop top-posting :  http://en.wikipedia.org/wiki/Posting_style  

O O O Gustau Pérez i Querol
O O O Unitat de Gestió dels departaments
O O O Matemàtica Aplicada IV i Enginyeria Telemàtica

  Universitat Politècnica de Catalunya
  Edifici C3 - Despatx S101-B
 UPC  Campus Nord UPC
  C/ Jordi Girona, 1-3
  08034 - Barcelona

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"