Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Sep 2014 22:44:37 +0800
From:      <mirnshi@gmail.com>
To:        freebsd-net@freebsd.org
Subject:   Is this a netmap bug?
Message-ID:  <CAH07=90%2BHHuM-M4PTrXSmi9hNGczCpQiOmNO6_uNvnZw1fDASQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I wrote a very simple netmap program on FreeBSD 10, run one or more times,
kernel crashed. Kernel configuration is GENERIC, only added netmap. The
host is VM, running in vmplayer, one nic.

How to repeat:
1. log into the system via ssh
2. run one or more times the program in the terminal.

Is it a bug?

core.txt.0
----------------------------------------------------------------------------------
bsd10 dumped core - see /var/crash/vmcore.0 Sun Sep 14 05:37:38 CST 2014
FreeBSD bsd10 10.0-RELEASE FreeBSD 10.0-RELEASE #0: Thu Sep 11 02:30:51 CST
2014 root@bsd10:/usr/obj/usr/src/sys/GENERIC amd64 panic: page fault GNU
gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is
free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions. Type "show copying" to see the conditions. There is absolutely
no warranty for GDB. Type "show warranty" for details. This GDB was
configured as "amd64-marcel-freebsd"... Unread portion of the kernel
message buffer: Fatal trap 12: page fault while in kernel mode cpuid = 0;
apic id = 00 fault virtual address = 0x30 fault code = supervisor read
data, page not present instruction pointer = 0x20:0xffffffff80615062 stack
pointer = 0x28:0xfffffe00002a5470 frame pointer = 0x28:0xfffffe00002a5520
code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1,
def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0
current process = 2238 (sshd) trap number = 12 panic: page fault cpuid = 0
KDB: stack backtrace: #0 0xffffffff808f5870 at kdb_backtrace+0x60 #1
0xffffffff808bd355 at panic+0x155 #2 0xffffffff80c9c132 at trap_fatal+0x3a2
#3 0xffffffff80c9c409 at trap_pfault+0x2c9 #4 0xffffffff80c9bb96 at
trap+0x5e6 #5 0xffffffff80c82e32 at calltrap+0x8 #6 0xffffffff80979cce at
ether_output+0x59e #7 0xffffffff809e48d4 at ip_output+0xf14 #8
0xffffffff80a4db74 at tcp_output+0x1684 #9 0xffffffff80a58f31 at
tcp_usr_send+0x3c1 #10 0xffffffff8092e135 at sosend_generic+0x465 #11
0xffffffff809135d9 at soo_write+0x49 #12 0xffffffff8090b35a at
dofilewrite+0x8a #13 0xffffffff8090b085 at kern_writev+0x65 #14
0xffffffff8090b013 at sys_write+0x63 #15 0xffffffff80c9ca27 at
amd64_syscall+0x357 #16 0xffffffff80c8311b at Xfast_syscall+0xfb Uptime:
9h6m25s Dumping 586 out of 2025
MB:..3%..11%..22%..31%..41%..52%..61%..71%..82%..91% Reading symbols from
/boot/kernel/uhid.ko.symbols...done. Loaded symbols for
/boot/kernel/uhid.ko.symbols #0 doadump (textdump=<value optimized out>) at
pcpu.h:219 219 pcpu.h: No such file or directory. in pcpu.h (kgdb) #0
doadump (textdump=<value optimized out>) at pcpu.h:219 #1
0xffffffff808bcfd0 in kern_reboot (howto=260) at
/usr/src/sys/kern/kern_shutdown.c:447 #2 0xffffffff808bd394 in panic
(fmt=<value optimized out>) at /usr/src/sys/kern/kern_shutdown.c:754 #3
0xffffffff80c9c132 in trap_fatal (frame=<value optimized out>, eva=<value
optimized out>) at /usr/src/sys/amd64/amd64/trap.c:882 #4
0xffffffff80c9c409 in trap_pfault (frame=0xfffffe00002a53c0, usermode=0) at
/usr/src/sys/amd64/amd64/trap.c:699 #5 0xffffffff80c9bb96 in trap
(frame=0xfffffe00002a53c0) at /usr/src/sys/amd64/amd64/trap.c:463 #6
0xffffffff80c82e32 in calltrap () at
/usr/src/sys/amd64/amd64/exception.S:232 #7 0xffffffff80615062 in
netmap_start (ifp=0xfffff800027d8800, m=0xfffff80037766c00) at
/usr/src/sys/dev/netmap/netmap.c:2346 #8 0xffffffff80979cce in ether_output
(ifp=0xfffff800027d8800, m=0xfffff80037766c00, dst=0xfffffe00002a5774,
ro=<value optimized out>) at /usr/src/sys/net/if_ethersubr.c:437 #9
0xffffffff809e48d4 in ip_output (m=0xfffff80037766c00, opt=<value optimized
out>, flags=<value optimized out>, imo=<value optimized out>,
inp=0xfffff80002f76188) at /usr/src/sys/netinet/ip_output.c:635 #10
0xffffffff80a4db74 in tcp_output (tp=0xfffff80002e68c00) at
/usr/src/sys/netinet/tcp_output.c:1231 #11 0xffffffff80a58f31 in
tcp_usr_send (so=<value optimized out>, flags=0, m=0xfffff80002f73400,
nam=<value optimized out>, control=<value optimized out>, td=<value
optimized out>) at /usr/src/sys/netinet/tcp_usrreq.c:872 #12
0xffffffff8092e135 in sosend_generic (so=0xfffff80002d20000, addr=0x0,
uio=0xfffffe00002a5ab0, top=<value optimized out>, control=<value optimized
out>, flags=<value optimized out>, td=<value optimized out>) at
/usr/src/sys/kern/uipc_socket.c:1271 #13 0xffffffff809135d9 in soo_write
(fp=<value optimized out>, uio=0xfffffe00002a5ab0, active_cred=<value
optimized out>, flags=<value optimized out>, td=<value optimized out>) at
/usr/src/sys/kern/sys_socket.c:103 #14 0xffffffff8090b35a in dofilewrite
(td=0xfffff80037650490, fd=3, fp=0xfffff80002c2a500,
auio=0xfffffe00002a5ab0, offset=<value optimized out>, flags=0) at
file.h:303 #15 0xffffffff8090b085 in kern_writev (td=0xfffff80037650490,
fd=3, auio=0xfffffe00002a5ab0) at /usr/src/sys/kern/sys_generic.c:467 #16
0xffffffff8090b013 in sys_write (td=<value optimized out>, uap=<value
optimized out>) at /usr/src/sys/kern/sys_generic.c:382 #17
0xffffffff80c9ca27 in amd64_syscall (td=0xfffff80037650490, traced=0) at
subr_syscall.c:134 #18 0xffffffff80c8311b in Xfast_syscall () at
/usr/src/sys/amd64/amd64/exception.S:391 #19 0x000000080320f0ca in ?? ()
Previous frame inner to this frame (corrupt stack?) Current language: auto;
currently minimal (kgdb)

-------------------------------------------------------------------------------------

program:
-------------------------------------------------------------------------------------

mmap_size = nmr.nr_memsize;
mmap_addr = mmap(0, mmap_size, PROT_WRITE | PROT_READ,
    MAP_SHARED, fd_netmap, 0);
 if (mmap_addr == MAP_FAILED) {
printf("Can't map %s ring.\n", txifn);
return 1;
}
 nmr.nr_version = NETMAP_API;
if (ioctl(fd_netmap, NIOCREGIF, &nmr) == -1) {
printf("Can't register %s ring.\n", txifn);
}
 printf("go on ......\n");
/* kernel will not crash if sleep for a while */
//sleep(4);
munmap(mmap_addr, mmap_size);
close(fd_netmap);
-----------------------------------------------------------------------------------------------


Thank you,
Paul



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAH07=90%2BHHuM-M4PTrXSmi9hNGczCpQiOmNO6_uNvnZw1fDASQ>