Re: sonewconn: pru_attach() failed and kernel panic in PF

2017-03-06 Thread Kristof Provost
So it turns out I shouldn't commit things when jet lagged. 

You want r314810 in head. The other one was mistakenly done in stable/11. It 
needed to go there sooner or later so I'm just going to leave it. 

Regards,
Kristof

> On 5 Mar 2017, at 22:19, Kristof Provost  wrote:
> 
>> On 5 Mar 2017, at 21:42, Kristof Provost wrote:
>> There’s only a couple of calls to uma_zfree() in pf_get_translations().
>> 
>> These are:
>> * uma_zfree(V_pf_state_key_z, skp);
>> * uma_zfree(V_pf_state_key_z, *nkp);
>> * uma_zfree(V_pf_state_key_z, *skp);
>> 
>> Going by the inconsistent pointer use the first one is rather suspect.
>> Looking a bit deeper, pf_get_translation() is only called from one place,
>> and it always passes stack variables for skp and nkp, so the first call
>> ends up trying to free that, which won’t work too well.
>> 
>> That’s a bug (and I’ll fix it), but you’re only running into it because
>> pf_state_key_clone() returned NULL, which will only happen under memory
>> pressure.
>> 
> The fix is done in r314702.
> 
> Regards,
> Kristof

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

Re: sonewconn: pru_attach() failed and kernel panic in PF

2017-03-05 Thread Kristof Provost

On 5 Mar 2017, at 21:42, Kristof Provost wrote:
There’s only a couple of calls to uma_zfree() in 
pf_get_translations().


These are:
 * uma_zfree(V_pf_state_key_z, skp);
 * uma_zfree(V_pf_state_key_z, *nkp);
 * uma_zfree(V_pf_state_key_z, *skp);

Going by the inconsistent pointer use the first one is rather suspect.
Looking a bit deeper, pf_get_translation() is only called from one 
place,
and it always passes stack variables for skp and nkp, so the first 
call

ends up trying to free that, which won’t work too well.

That’s a bug (and I’ll fix it), but you’re only running into it 
because
pf_state_key_clone() returned NULL, which will only happen under 
memory

pressure.


The fix is done in r314702.

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

Re: sonewconn: pru_attach() failed and kernel panic in PF

2017-03-05 Thread Kristof Provost



On 27 Feb 2017, at 21:08, Ross wrote:


Hello

One of my machines panics almost every day. It is always like this: 
first
there is a number of messages about "sonewconn: pcb 
0xf80085478740:
pru_attach() failed" at the same time and then panic. Here's an 
example:


... many lines of sonewconn ...
Feb 27 13:41:43 core kernel: sonewconn: pcb 0xf8008575bcb0:
pru_attach() failed
Feb 27 13:41:43 core kernel:


I wonder if you’re running low on memory by any chance.

I think I know why you’re crashing, but I suspect your root problem is 
that
you’re running low on memory and that’s why you’re seeing the 
pru_attach()

failures, and eventually running into the pf panic.


Feb 27 13:41:43 core kernel: KDB: stack backtrace:
Feb 27 13:41:43 core kernel: #0 0x80b312c7 at 
kdb_backtrace+0x67

Feb 27 13:41:43 core kernel: #1 0x80ae5c92 at vpanic+0x182
Feb 27 13:41:43 core kernel: #2 0x80ae5b03 at panic+0x43
Feb 27 13:41:43 core kernel: #3 0x80fd6d51 at trap_fatal+0x351
Feb 27 13:41:43 core kernel: #4 0x80fd6f43 at 
trap_pfault+0x1e3

Feb 27 13:41:43 core kernel: #5 0x80fd64ec at trap+0x26c
Feb 27 13:41:43 core kernel: #6 0x80fb9d61 at calltrap+0x8
Feb 27 13:41:43 core kernel: #7 0x80e4185e at 
uma_zfree_arg+0x4fe

Feb 27 13:41:43 core kernel: #8 0x82442165 at
pf_get_translation+0x2c5


There’s only a couple of calls to uma_zfree() in 
pf_get_translations().


These are:
 * uma_zfree(V_pf_state_key_z, skp);
 * uma_zfree(V_pf_state_key_z, *nkp);
 * uma_zfree(V_pf_state_key_z, *skp);

Going by the inconsistent pointer use the first one is rather suspect.
Looking a bit deeper, pf_get_translation() is only called from one 
place,

and it always passes stack variables for skp and nkp, so the first call
ends up trying to free that, which won’t work too well.

That’s a bug (and I’ll fix it), but you’re only running into it 
because

pf_state_key_clone() returned NULL, which will only happen under memory
pressure.


What should I do to fix it?

You’ll need to look at your system and figure out who’s running away 
with all

of your memory.

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

sonewconn: pru_attach() failed and kernel panic in PF

2017-02-27 Thread Ross
Hello

One of my machines panics almost every day. It is always like this: first
there is a number of messages about "sonewconn: pcb 0xf80085478740:
pru_attach() failed" at the same time and then panic. Here's an example:

... many lines of sonewconn ...
Feb 27 13:41:43 core kernel: sonewconn: pcb 0xf8008575bcb0:
pru_attach() failed
Feb 27 13:41:43 core kernel:
Feb 27 13:41:43 core kernel:
Feb 27 13:41:43 core kernel: Fatal trap 12: page fault while in kernel mode
Feb 27 13:41:43 core kernel: cpuid = 5; apic id = 0a
Feb 27 13:41:43 core kernel: fault virtual address  = 0x0
Feb 27 13:41:43 core kernel: fault code = supervisor write data,
page not present
Feb 27 13:41:43 core kernel: instruction pointer=
0x20:0x80e45383
Feb 27 13:41:43 core kernel: stack pointer  =
0x28:0xfe00d7dd7f80
Feb 27 13:41:43 core kernel: frame pointer  =
0x28:0xfe00d7dd7fe0
Feb 27 13:41:43 core kernel: code segment   = base 0x0, limit
0xf, type 0x1b
Feb 27 13:41:43 core kernel: = DPL 0, pres 1, long 1, def32 0, gran 1
Feb 27 13:41:43 core kernel: processor eflags   = interrupt enabled,
resume, IOPL = 0
Feb 27 13:41:43 core kernel: current process= 0 (em0 taskq)
Feb 27 13:41:43 core kernel: trap number= 12
Feb 27 13:41:43 core kernel: panic: page fault
Feb 27 13:41:43 core kernel: cpuid = 5
Feb 27 13:41:43 core kernel: KDB: stack backtrace:
Feb 27 13:41:43 core kernel: #0 0x80b312c7 at kdb_backtrace+0x67
Feb 27 13:41:43 core kernel: #1 0x80ae5c92 at vpanic+0x182
Feb 27 13:41:43 core kernel: #2 0x80ae5b03 at panic+0x43
Feb 27 13:41:43 core kernel: #3 0x80fd6d51 at trap_fatal+0x351
Feb 27 13:41:43 core kernel: #4 0x80fd6f43 at trap_pfault+0x1e3
Feb 27 13:41:43 core kernel: #5 0x80fd64ec at trap+0x26c
Feb 27 13:41:43 core kernel: #6 0x80fb9d61 at calltrap+0x8
Feb 27 13:41:43 core kernel: #7 0x80e4185e at uma_zfree_arg+0x4fe
Feb 27 13:41:43 core kernel: #8 0x82442165 at
pf_get_translation+0x2c5
Feb 27 13:41:43 core kernel: #9 0x824369d3 at pf_test_rule+0x2b3
Feb 27 13:41:43 core kernel: #10 0x82433e23 at pf_test+0x1a23
Feb 27 13:41:43 core kernel: #11 0x8244596d at pf_check_in+0x1d
Feb 27 13:41:43 core kernel: #12 0x80c1e983 at pfil_run_hooks+0x83
Feb 27 13:41:43 core kernel: #13 0x80c82d7b at ip_input+0x3bb
Feb 27 13:41:43 core kernel: #14 0x80c1d905 at
netisr_dispatch_src+0xa5
Feb 27 13:41:43 core kernel: #15 0x80c0636a at ether_demux+0x12a
Feb 27 13:41:43 core kernel: #16 0x80c06fc2 at ether_nh_input+0x322
Feb 27 13:41:43 core kernel: #17 0x80c1d905 at
netisr_dispatch_src+0xa5

What should I do to fix it?

PS This is FreeBSD 11.0-RELEASE
___
freebsd-pf@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-pf
To unsubscribe, send any mail to "freebsd-pf-unsubscr...@freebsd.org"