Re: Panic on reloading a driver with same DEVICE_PROBE() return value

2016-02-11 Thread Andriy Gapon
On 10/02/2016 01:02, John Baldwin wrote:
> I'm actually not certain of what triggered the fault.  The check that emits
> the printf should also be failing the kldload with EEXIST (but that doesn't
> work for the case where both are compiled into the kernel).  The new driver
> should have just never been registered, but then I'm not sure how its method
> could be called at all.  The only reference to the driver's methods are in the
> struct driver which also has the associated softc size (so you shouldn't get
> a mismatch between softc size and the driver methods used).

I haven't really followed this thread and my memory about my own problem has
significantly faded, but could the issue #2 in the following post be related?
http://thread.gmane.org/gmane.os.freebsd.current/147256
Sorry for the noise if it's totally unrelated.

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


Re: Open Sound System - OSS "soundon" command causes KERNEL PANIC FreeBSD-11

2016-02-11 Thread Konstantin Belousov
On Thu, Feb 11, 2016 at 07:54:57AM +0100, Hans Petter Selasky wrote:
> On 02/11/16 03:02, Greg Quinlan wrote:
> > Hi HPS,
> > Note: Does not happen on FreeBSD 10.1-Stable!
> >
> 
> Yes, that's because WITNESS is off in 10.x by default.
> 
> Does the attached patch solve your problem?
No, the patch below does not solve the issue, it only papers over it.
I object against committing this change.

Issue is that, if called unlocked, the result from module_lookupbyname()
could become invalid right after receiving.  It is the duty of the caller
of the function to ensure that the result is still valid, and the only
way to achieve it is to own the lock around the whole code region which
calls the function and utilizes its result.

A bug is in the OSS code.
> 
> --HPS
> 

> Index: sys/kern/kern_module.c
> ===
> --- sys/kern/kern_module.c(revision 295464)
> +++ sys/kern/kern_module.c(working copy)
> @@ -214,16 +214,24 @@
>  module_lookupbyname(const char *name)
>  {
>   module_t mod;
> + int xlocked;
>   int err;
>  
> - MOD_LOCK_ASSERT;
> -
> + /*
> +  * If the context is not properly locked, apply the proper
> +  * locks here:
> +  */
> + xlocked = sx_xlocked(&modules_sx);
> + if (!xlocked)
> + MOD_SLOCK;
>   TAILQ_FOREACH(mod, &modules, link) {
>   err = strcmp(mod->name, name);
>   if (err == 0)
> - return (mod);
> + break;
>   }
> - return (NULL);
> + if (!xlocked)
> + MOD_SUNLOCK;
> + return (mod);
>  }
>  
>  module_t

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

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


Re: IPV6 TCP6 Slow Connect

2016-02-11 Thread Kristof Provost
On 2016-02-10 20:38:02 (-0600), Larry Rosenman  wrote:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206904
> 
> I've also posted lots of info to freebsd-net, and not gotten any 
> response.
> 
> Summary:
> 
> Cable Modem-> EM0 on a pfSense Firewall (FreeBSD 10.1, pfSense 2.2.6)
>set to dhcp6, and ask for a /56 prefix
> 
> EM1->LAN, set to track interface, prefix id 0, radvd running advertising 
> the 00 /64
> LAN-> borg.lerctr.org using lagg0, SLAAC (rtsold).  Gets an address, 
> icmp6 works, tcp6 times out.
>  -> win10 SLAAC, tcp6 works fine, as does icmp6.
> 
For this I'd start by taking packet captures of both the FreeBSD tcp6
connection and the win10 tcp6 connection. Finding the difference between
the two will likely go a long way in finding the cause.

Regards,
Kristof

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


Re: Open Sound System - OSS "soundon" command causes KERNEL PANIC FreeBSD-11

2016-02-11 Thread Hans Petter Selasky

On 02/11/16 11:14, Konstantin Belousov wrote:

On Thu, Feb 11, 2016 at 07:54:57AM +0100, Hans Petter Selasky wrote:

On 02/11/16 03:02, Greg Quinlan wrote:

Hi HPS,
Note: Does not happen on FreeBSD 10.1-Stable!



Yes, that's because WITNESS is off in 10.x by default.

Does the attached patch solve your problem?

>

No, the patch below does not solve the issue, it only papers over it.
I object against committing this change.


For cases where the returned pointer is not deferred, but only checked 
for a module's presence in the kernel you don't need a lock to protect 
anything. Maybe make a separate API for this?




Issue is that, if called unlocked, the result from module_lookupbyname()
could become invalid right after receiving.  It is the duty of the caller
of the function to ensure that the result is still valid, and the only
way to achieve it is to own the lock around the whole code region which
calls the function and utilizes its result.

A bug is in the OSS code.


Yes, so why not factor out the solution? Maybe more port KLD's will trip 
over this?


--HPS

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


Re: Open Sound System - OSS "soundon" command causes KERNEL PANIC FreeBSD-11

2016-02-11 Thread Konstantin Belousov
On Thu, Feb 11, 2016 at 11:19:56AM +0100, Hans Petter Selasky wrote:
> On 02/11/16 11:14, Konstantin Belousov wrote:
> > On Thu, Feb 11, 2016 at 07:54:57AM +0100, Hans Petter Selasky wrote:
> >> On 02/11/16 03:02, Greg Quinlan wrote:
> >>> Hi HPS,
> >>> Note: Does not happen on FreeBSD 10.1-Stable!
> >>>
> >>
> >> Yes, that's because WITNESS is off in 10.x by default.
> >>
> >> Does the attached patch solve your problem?
>  >
> > No, the patch below does not solve the issue, it only papers over it.
> > I object against committing this change.
> 
> For cases where the returned pointer is not deferred, but only checked 
> for a module's presence in the kernel you don't need a lock to protect 
> anything. Maybe make a separate API for this?
How checking for bool (i.e. == NULL) would fix anything ?  The fact that
the module is loaded could be invalidated in parallel, so the answer you
get is already wrong.  The bool value you obtained is equally wrong.

> 
> >
> > Issue is that, if called unlocked, the result from module_lookupbyname()
> > could become invalid right after receiving.  It is the duty of the caller
> > of the function to ensure that the result is still valid, and the only
> > way to achieve it is to own the lock around the whole code region which
> > calls the function and utilizes its result.
> >
> > A bug is in the OSS code.
> 
> Yes, so why not factor out the solution? Maybe more port KLD's will trip 
> over this?
Solution is for OSS code to take a lock around the whole region where the
answer is needed.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Open Sound System - OSS "soundon" command causes KERNEL PANIC FreeBSD-11

2016-02-11 Thread Greg Quinlan
Well done!!
Fixed. Thanks!



  From: Hans Petter Selasky 
 To: Greg Quinlan ; "freebsd-current@freebsd.org" 
 
 Sent: Thursday, 11 February 2016, 17:54
 Subject: Re: Open Sound System - OSS "soundon" command causes KERNEL PANIC 
FreeBSD-11
   
On 02/11/16 03:02, Greg Quinlan wrote:
> Hi HPS,
> Note: Does not happen on FreeBSD 10.1-Stable!
>

Yes, that's because WITNESS is off in 10.x by default.

Does the attached patch solve your problem?

--HPS


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

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


Re: r294195: Kernel panic during installworld

2016-02-11 Thread Hans Petter Selasky

On 02/11/16 15:00, Daniel Nebdal wrote:

plugging in a
USB keyboard post-panic didn't do much


Hi,

USB enumeration is disabled in the debugger. You need to plug it in 
pre-crash :-) Same with any USB crash dump device(s).


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


Re: r294195: Kernel panic during installworld

2016-02-11 Thread Daniel Nebdal
On Sat, Jan 30, 2016 at 6:16 AM, Ultima  wrote:
>  Just upgraded from 10-STABLE to head r295051 and I still have kernel
> panics. I then tested with bsdinstall and found that the panics no longer
> occur. I believe the issue is that some of my datasets are set to
> recordsize=1M, this is most likely the root cause of these panics.
>
> On Sun, Jan 17, 2016 at 2:59 PM, Ultima  wrote:
>
>> https://puu.sh/mzmpL/b209da9263.jpgn  I hope this is better, sorry I
>> didn't know it would get stripped.
>>
>> Ultima
>>
>> On Sun, Jan 17, 2016 at 2:58 PM, Ultima  wrote:
>>
>>> https://puu.sh/mzmpL/b209da9263.jpgn  I hope this is better, sorry I
>>> didn't know it would get stripped.
>>>
>>> Ultima
>>>
>>> On Sun, Jan 17, 2016 at 12:59 PM, Allan Jude 
>>> wrote:
>>>
 On 2016-01-17 09:14, Ultima wrote:
 > make installkernel KERNCONF=MYKERNEL
 > reboot
 > mergemaster -p
 > make installworld -> attached
 >
 > MYKERNEL=GENERIC+
 > options VIMAGE
 > options ROUTETABLES=2
 >
 >  Anything else that maybe helpful?
 >
 > Ultima
 > ___
 > freebsd-current@freebsd.org mailing list
 > https://lists.freebsd.org/mailman/listinfo/freebsd-current
 > To unsubscribe, send any mail to "
 freebsd-current-unsubscr...@freebsd.org"
 >

 Your attachment was stripped. Can you post it somewhere and include the
 url?

 --
 Allan Jude



That looks kind of similar to one I just got (on r295122 , during a
lot of ZFS traffic) : https://goo.gl/photos/UkPV2BVi27Yucdgn7

Buildworld and installworld doesn't seem to be enough to trigger it
for me - I'm upgrading it to whatever CURRENT was at an hour ago now.
I couldn't get any further contact with the debugger (plugging in a
USB keyboard post-panic didn't do much), but I left it connected now,
and I should be able to set up a dump device and/or serial debugging.

(The GSS kernel config I'm using is just amd64 GENERIC + options KGSSAPI .)

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


Re: r294195: Kernel panic during installworld

2016-02-11 Thread Daniel Nebdal
On Thu, Feb 11, 2016 at 3:04 PM, Hans Petter Selasky  wrote:
> On 02/11/16 15:00, Daniel Nebdal wrote:
>>
>> plugging in a
>> USB keyboard post-panic didn't do much
>
>
> Hi,
>
> USB enumeration is disabled in the debugger. You need to plug it in
> pre-crash :-) Same with any USB crash dump device(s).
>
> --HPS

Myeah, I didn't really expect it to work - at least I left it plugged in now. :)

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


Re: r294195: Kernel panic during installworld

2016-02-11 Thread Ultima
This is actually triggered when using large blocks.

"recordsize=1M"

going back to 128k and I no longer panic.

On Thu, Feb 11, 2016 at 9:10 AM, Daniel Nebdal  wrote:

> On Thu, Feb 11, 2016 at 3:04 PM, Hans Petter Selasky 
> wrote:
> > On 02/11/16 15:00, Daniel Nebdal wrote:
> >>
> >> plugging in a
> >> USB keyboard post-panic didn't do much
> >
> >
> > Hi,
> >
> > USB enumeration is disabled in the debugger. You need to plug it in
> > pre-crash :-) Same with any USB crash dump device(s).
> >
> > --HPS
>
> Myeah, I didn't really expect it to work - at least I left it plugged in
> now. :)
>
> --
> Daniel Nebdal
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: IPV6 TCP6 Slow Connect

2016-02-11 Thread Larry Rosenman

On 2016-02-11 04:14, Kristof Provost wrote:

On 2016-02-10 20:38:02 (-0600), Larry Rosenman  wrote:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206904

I've also posted lots of info to freebsd-net, and not gotten any
response.

Summary:

Cable Modem-> EM0 on a pfSense Firewall (FreeBSD 10.1, pfSense 2.2.6)
   set to dhcp6, and ask for a /56 prefix

EM1->LAN, set to track interface, prefix id 0, radvd running 
advertising

the 00 /64
LAN-> borg.lerctr.org using lagg0, SLAAC (rtsold).  Gets an address,
icmp6 works, tcp6 times out.
 -> win10 SLAAC, tcp6 works fine, as does icmp6.


For this I'd start by taking packet captures of both the FreeBSD tcp6
connection and the win10 tcp6 connection. Finding the difference 
between

the two will likely go a long way in finding the cause.

Regards,
Kristof

From which system(s) perspective do you want the packet captures?
(Firewall, FreeBSD, Windows)?


--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: l...@lerctr.org
US Mail: 7011 W Parmer Ln, Apt 1115, Austin, TX 78729-6961
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: IPV6 TCP6 Slow Connect

2016-02-11 Thread Kristof Provost

> On 11 Feb 2016, at 21:23, Larry Rosenman  wrote:
> 
> From which system(s) perspective do you want the packet captures?
> (Firewall, FreeBSD, Windows)?

I wouldn’t expect it to make much of a difference in this case.
Let’s start with whatever is easiest.

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

Re: IPV6 TCP6 Slow Connect

2016-02-11 Thread Larry Rosenman
On 2016-02-11 14:25, Kristof Provost wrote:

>> On 11 Feb 2016, at 21:23, Larry Rosenman  wrote: 
>> From which system(s) perspective do you want the packet captures?
>> (Firewall, FreeBSD, Windows)?
> I wouldn't expect it to make much of a difference in this case. 
> Let's start with whatever is easiest. 
> 
> Regards, 
> Kristof

I'll try and get these tonight when I am home, after a meetup. 

(will be late US/CST). 

-- 
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: l...@lerctr.org
US Mail: 7011 W Parmer Ln, Apt 1115, Austin, TX 78729-6961
 
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Open Sound System - OSS "soundon" command causes KERNEL PANIC FreeBSD-11

2016-02-11 Thread Greg Quinlan
Spoke too soon... 

I applied the patch (kern_module.diff - which was successful)

# cd /usr/src# patch 
To: Hans Petter Selasky ; "freebsd-current@freebsd.org" 
 
 Sent: Thursday, 11 February 2016, 22:19
 Subject: Re: Open Sound System - OSS "soundon" command causes KERNEL PANIC 
FreeBSD-11
   
Well done!!
Fixed. Thanks!



  From: Hans Petter Selasky 
 To: Greg Quinlan ; "freebsd-current@freebsd.org" 
 
 Sent: Thursday, 11 February 2016, 17:54
 Subject: Re: Open Sound System - OSS "soundon" command causes KERNEL PANIC 
FreeBSD-11
  
On 02/11/16 03:02, Greg Quinlan wrote:
> Hi HPS,
> Note: Does not happen on FreeBSD 10.1-Stable!
>

Yes, that's because WITNESS is off in 10.x by default.

Does the attached patch solve your problem?

--HPS


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

   

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

Re: IPV6 TCP6 Slow Connect

2016-02-11 Thread Larry Rosenman
On 2016-02-11 14:40, Larry Rosenman wrote:

> On 2016-02-11 14:25, Kristof Provost wrote: 
> 
> On 11 Feb 2016, at 21:23, Larry Rosenman  wrote: 
> From which system(s) perspective do you want the packet captures?
> (Firewall, FreeBSD, Windows)? I wouldn't expect it to make much of a 
> difference in this case. 
> Let's start with whatever is easiest. 
> 
> Regards, 
> Kristof

I'll try and get these tonight when I am home, after a meetup. 

(will be late US/CST). 

-- 
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: l...@lerctr.org
US Mail: 7011 W Parmer Ln, Apt 1115, Austin, TX 78729-6961

at http://www.lerctr.org/~ler/FreeBSD/win10.pcap 

http://www.lerctr.org/~ler/.FreeBSD/fbsd11.pcap 

Please let me know what else you need.  

I **CAN** supply accesss to a @FreeBSD.org developer to: 

1) the FreeBSD 11 host 

2) the FreeBSD(pfSense) Firewall 

3) the IPv6 host (FreeBSD 10) that I ssh'd to.  

4) the FireWall in front of the FreeBSD 10 box (also pfSense) 

-- 
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: l...@lerctr.org
US Mail: 7011 W Parmer Ln, Apt 1115, Austin, TX 78729-6961
 
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"