From owner-freebsd-net@FreeBSD.ORG Tue Feb 24 00:03:58 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B65A16A4CE for ; Tue, 24 Feb 2004 00:03:58 -0800 (PST) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47E5943D2F for ; Tue, 24 Feb 2004 00:03:57 -0800 (PST) (envelope-from glebius@cell.sick.ru) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.9/8.12.8) with ESMTP id i1O83sQE076320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 24 Feb 2004 11:03:54 +0300 (MSK) (envelope-from glebius@cell.sick.ru) Received: (from glebius@localhost) by cell.sick.ru (8.12.9/8.12.6/Submit) id i1O83rPS076319 for freebsd-net@freebsd.org; Tue, 24 Feb 2004 11:03:53 +0300 (MSK) Date: Tue, 24 Feb 2004 11:03:53 +0300 From: Gleb Smirnoff To: freebsd-net@freebsd.org Message-ID: <20040224080353.GA76272@cell.sick.ru> Mail-Followup-To: Gleb Smirnoff , freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: rtalloc()/rtfree() problems on CURRENT X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2004 08:03:58 -0000 Dear sirs, please take a look at the following problem. I've been successfully using the following code on STABLE and 5.1-RELEASE: struct route ro; struct sockaddr_in *sin; bzero((caddr_t)&ro, sizeof(ro)); sin = (struct sockaddr_in *)&ro.ro_dst; sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr = fle->r.r_dst; rtalloc(&ro); if (ro.ro_rt != NULL) { struct rtentry *rt = ro.ro_rt; /* here some read-only things are done with rt */ rtfree(ro.ro_rt); } But on CURRENT rtfree() causes panic. Here is backtrace: #0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240 #1 0xc0527749 in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:374 #2 0xc0527b48 in __panic () at /usr/src/sys/kern/kern_shutdown.c:552 #3 0xc0678ee6 in trap_fatal (frame=0xcdae3a44, eva=0) at /usr/src/sys/i386/i386/trap.c:819 #4 0xc0678503 in trap (frame={tf_fs = 24, tf_es = 16, tf_ds = -844234736, tf_edi = -1023635456, tf_esi = 0, tf_ebp = -844219772, tf_isp = -844219792, tf_ebx = -1023665052, tf_edx = -1051741536, tf_ecx = -1051741536, tf_eax = 0, tf_trapno = 12, tf_err = 0, tf_eip = -1068166506, tf_cs = 8, tf_eflags = 65666, tf_esp = -844219736, tf_ss = -1068381542}) at /usr/src/sys/i386/i386/trap.c:250 #5 0xc0551296 in turnstile_head (ts=0x0) at /usr/src/sys/kern/subr_turnstile.c:709 #6 0xc051ca9a in _mtx_unlock_sleep (m=0xc2fc1c64, opts=0, file=0x0, line=0) at /usr/src/sys/kern/kern_mutex.c:645 #7 0xc05a3fd6 in rtfree (rt=0xc2fc1c64) at /usr/src/sys/net/route.c:289 #8 0xc2f8834b in flow_add () from /boot/kernel/ng_netflow.ko #9 0xc2f87a08 in ng_netflow_rcvdata () from /boot/kernel/ng_netflow.ko #10 0xc2f794c9 in ng_apply_item () from /boot/kernel/netgraph.ko #11 0xc2f79054 in ng_snd_item () from /boot/kernel/netgraph.ko #12 0xc2bab79e in ngt_rcvdata () from /boot/kernel/ng_tee.ko #13 0xc2f794c9 in ng_apply_item () from /boot/kernel/netgraph.ko #14 0xc2f7babb in ngintr () from /boot/kernel/netgraph.ko #15 0xc05a1c2f in swi_net (dummy=0x0) at /usr/src/sys/net/netisr.c:255 #16 0xc0511048 in ithread_loop (arg=0xc14f8480) at /usr/src/sys/kern/kern_intr.c:547 #17 0xc050fca8 in fork_exit (callout=0xc0510e70 , arg=0x0, frame=0x0) at /usr/src/sys/kern/kern_fork.c:802 Does this mean that something is broken in CURRENT or I am doing something wrong? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE