Re: uvm_fault, possibly fstat(1) related

2009-12-27 Thread Philip Guenther
On Sun, Dec 27, 2009 at 10:25 AM, John Cosimano j...@cosmicnetworks.net
wrote:
 i was troubleshooting some work i'm doing with python, and ran fstat(1),
 as root, with no arguments.
...
 uvm_fault(0xd8227010, 0x0, 0, 1) - e
 kernel: page fault trap, code=0
 Stopped at fill_file2+0x346: movl 0x44(%edx),%eax
 ddb{0}

That would seem to say that fstat's sysctl() call caught a process
with an IPv4 or IPv6 socket with a non-NULL so_pcb that pointed
somewhere bogus.  That suggests that more information about what's
uncommon about your setup is in order.  Weird socket tricks?  NAT
combined with redirections in your pf.conf?  Transparent proxies?
Divert sockets?

...
 i saw in the archive that Stuart Henderson posted something similar a
 while back, but didn't see any follow-up. any hints to get me looking in
 the right direction?

You have a reference to his post handy?


 i'm running 4.6-STABLE, SMP kernel. dmesg attached:

 OpenBSD 4.6 (build) #5: Thu Nov 12 10:28:47 EST 2009
j...@cosmicnetworks.net:/usr/local/build

Ahem.  You're running a non-standard kernel and yet don't call that
out or describe what the difference is between it and the standard
GENERIC.MP config is?  Ah well, I guess I've typed this far, so I'll
send this response instead of deleting it...


Philip Guenther



Re: uvm_fault, possibly fstat(1) related

2009-12-27 Thread John Cosimano
--- Philip Guenther [Sun, Dec 27, 2009 at 03:46:33PM -0800]: --- 
 On Sun, Dec 27, 2009 at 10:25 AM, John Cosimano j...@cosmicnetworks.net 
 wrote:
 ...
  i saw in the archive that Stuart Henderson posted something similar a
  while back, but didn't see any follow-up. any hints to get me looking in
  the right direction?
 
 You have a reference to his post handy?

it was on tech@ now that i recall, which probably even makes it
irrelevant for having mentioned here in the first place. if it's not too
OT to mention here:

http://archives.neohapsis.com/archives/openbsd/2009-07/1051.html

  i'm running 4.6-STABLE, SMP kernel. dmesg attached:
 
  OpenBSD 4.6 (build) #5: Thu Nov 12 10:28:47 EST 2009
  ? ?...@cosmicnetworks.net:/usr/local/build
 
 Ahem.  You're running a non-standard kernel and yet don't call that
 out or describe what the difference is between it and the standard
 GENERIC.MP config is?  Ah well, I guess I've typed this far, so I'll
 send this response instead of deleting it...

sorry for not stating. i run an unmodified GENERIC.MP, i just build
outside of /usr/src when i apply patches that require a kernel rebuild.

shant happen again, sir.



Re: uvm_fault, possibly fstat(1) related

2009-12-27 Thread Brynet
 i'm running 4.6-STABLE, SMP kernel. dmesg attached:
 
 OpenBSD 4.6 (build) #5: *Thu Nov 12 10:28:47 EST 2009*

Update your tree, rebuild the kernel.

There were a few cases where fstat(1) would crash my systems as well.

http://marc.info/?l=openbsd-cvsm=125971073002018w=2
http://www.openbsd.org/cgi-bin/cvsweb/src/sys/kern/kern_sysctl.c#rev1.175.4.1

It appears to fix things, was commited on December 1st.

-Bryan.

--- src/sys/kern/kern_sysctl.c  2009/06/15 18:59:45 1.175
+++ src/sys/kern/kern_sysctl.c  2009/12/01 23:37:51 1.175.4.1
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.175 2009/06/15 17:59:45 deraadt Exp $   
*/
+/* $OpenBSD: kern_sysctl.c,v 1.175.4.1 2009/12/01 23:37:51 william Exp $   
*/
 /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */

 /*-
@@ -1086,6 +1086,8 @@ fill_file2(struct kinfo_file2 *kf, struct file *fp, st
kf-so_pcb = PTRTOINT64(so-so_pcb);
kf-so_protocol = so-so_proto-pr_protocol;
kf-so_family = so-so_proto-pr_domain-dom_family;
+   if (!so-so_pcb)
+   break;
switch (kf-so_family) {
case AF_INET: {
struct inpcb *inpcb = so-so_pcb;