Hi, On Wed, 3 Jul 2013 13:55:45 +0200 Marko Cupać <marko.cu...@mimar.rs> wrote: > In last 10 days machine hanged twice. I do not have hang message from > the first time, but this time i read this: > > uvm_fault(0xd8f5f680, 0x0, 0, 3) -> e > kernel: page fault trap, code=0 > Stopped at pipex_close_session+0xc4: movl %eax,0x6c(%exc) > ddb{3}>
This panic is fixed after 5.3. > Below is my dmesg: > OpenBSD 5.3 (GENERIC.MP) #58: Tue Mar 12 18:43:53 MDT 2013 > dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP Can you try latest snapshot or below patch? CVSROOT: /cvs Module name: src Changes by: yasu...@cvs.openbsd.org 2013/04/16 01:36:55 Modified files: sys/net : pipex.c pipex_local.h Log message: When pipex session is terminated by idle timer, there was a problem that the session is removed from the pipex_closed_wait_list twice, fixed it. It always causes panic because QUEUE_MACRO_DEBUG is enabled by default. Also remove some needless (struct pipex_session *) casts. Index: src/sys/net/pipex.c diff -u src/sys/net/pipex.c:1.40 src/sys/net/pipex.c:1.41 --- src/sys/net/pipex.c:1.40 Thu Mar 28 17:10:05 2013 +++ src/sys/net/pipex.c Tue Apr 16 01:36:55 2013 @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex.c,v 1.40 2013/03/28 23:10:05 tedu Exp $ */ +/* $OpenBSD: pipex.c,v 1.41 2013/04/16 07:36:55 yasuoka Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -520,7 +520,7 @@ /* remove from close_wait list */ if (session->state == PIPEX_STATE_CLOSE_WAIT) - LIST_REMOVE((struct pipex_session *)session, state_list); + LIST_REMOVE(session, state_list); /* get statistics before destroy the session */ req->pcr_stat = session->stat; @@ -579,9 +579,10 @@ while (!LIST_EMPTY(&pipex_close_wait_list)) { session = LIST_FIRST(&pipex_close_wait_list); req->plr_ppp_id[req->plr_ppp_id_count++] = session->ppp_id; - LIST_REMOVE((struct pipex_session *)session, state_list); + LIST_REMOVE(session, state_list); + session->state = PIPEX_STATE_CLOSE_WAIT2; if (req->plr_ppp_id_count >= PIPEX_MAX_LISTREQ) { - if (LIST_NEXT(session, state_list)) + if (!LIST_EMPTY(&pipex_close_wait_list)) req->plr_flags |= PIPEX_LISTREQ_MORE; break; } @@ -607,18 +608,16 @@ KASSERT(rn != NULL); } - LIST_REMOVE((struct pipex_session *)session, id_chain); - LIST_REMOVE((struct pipex_session *)session, session_list); + LIST_REMOVE(session, id_chain); + LIST_REMOVE(session, session_list); #ifdef PIPEX_PPTP if (session->protocol == PIPEX_PROTO_PPTP) { - LIST_REMOVE((struct pipex_session *)session, - peer_addr_chain); + LIST_REMOVE(session, peer_addr_chain); } #endif #ifdef PIPEX_L2TP if (session->protocol == PIPEX_PROTO_L2TP) { - LIST_REMOVE((struct pipex_session *)session, - peer_addr_chain); + LIST_REMOVE(session, peer_addr_chain); } #endif /* if final session is destroyed, stop timer */ @@ -850,6 +849,7 @@ break; case PIPEX_STATE_CLOSE_WAIT: + case PIPEX_STATE_CLOSE_WAIT2: session->stat.idle_time++; if (session->stat.idle_time < PIPEX_CLOSE_TIMEOUT) continue; Index: src/sys/net/pipex_local.h diff -u src/sys/net/pipex_local.h:1.17 src/sys/net/pipex_local.h:1.18 --- src/sys/net/pipex_local.h:1.17 Wed Sep 19 11:50:17 2012 +++ src/sys/net/pipex_local.h Tue Apr 16 01:36:55 2013 @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex_local.h,v 1.17 2012/09/19 17:50:17 yasuoka Exp $ */ +/* $OpenBSD: pipex_local.h,v 1.18 2013/04/16 07:36:55 yasuoka Exp $ */ /* * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -162,7 +162,8 @@ #define PIPEX_STATE_INITIAL 0x0000 #define PIPEX_STATE_OPENED 0x0001 #define PIPEX_STATE_CLOSE_WAIT 0x0002 -#define PIPEX_STATE_CLOSED 0x0003 +#define PIPEX_STATE_CLOSE_WAIT2 0x0003 +#define PIPEX_STATE_CLOSED 0x0004 uint16_t ip_forward:1, /* {en|dis}ableIP forwarding */ ip6_forward:1, /* {en|dis}able IPv6 forwarding */