From owner-freebsd-current@FreeBSD.ORG Tue Sep 22 21:49:28 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0707A106566C for ; Tue, 22 Sep 2009 21:49:28 +0000 (UTC) (envelope-from kubito@gmail.com) Received: from mail-iw0-f181.google.com (mail-iw0-f181.google.com [209.85.223.181]) by mx1.freebsd.org (Postfix) with ESMTP id B22A38FC0A for ; Tue, 22 Sep 2009 21:49:27 +0000 (UTC) Received: by iwn11 with SMTP id 11so112580iwn.3 for ; Tue, 22 Sep 2009 14:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ui7gefhtSTHN2hgOJsJdJoui2YNAH0rNmrg0t0acOiQ=; b=TQ1nTF8vuIJ84g1PVwE5XcjO1317THl/I2Yw1D0qYi5d0HBosAKAu2zhv+dC2ZjBcB yP4cOiZ0n1rXPkg+AmvS6Jmj10L2o2Ret5+YgXm2gC8qG2YZVGEJp5FTrL4a8cug7oHj aT1ljBi8rzy+EagzuHfksW6EesOEW/OrYgo98= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=I/j/Qy6iHj2Q2czIojHTtPA8kUUD/PY647Df45TpJq8Zn7xawKgOEd2jt6IDx3Ciix xZrwmAV3IEfzKJlqRug1b8OLOrGjoiwEpA16NtEQKAA4eSKE1GNXvXSNeGXEUCJB9cjS zdO8bKUZAY9kFpJwmgyiJZxSeOfM0vSjvtunU= MIME-Version: 1.0 Received: by 10.231.83.75 with SMTP id e11mr2963105ibl.11.1253656166813; Tue, 22 Sep 2009 14:49:26 -0700 (PDT) In-Reply-To: <3a142e750909221420m29ae8302t71ed9558c77542f4@mail.gmail.com> References: <68c3445d0909212153rf19ec23p81ecc0a070f6d594@mail.gmail.com> <3a142e750909220343k153daac0xc00099fc09c176ac@mail.gmail.com> <68c3445d0909220551k33973d38iccf20c030a00b6c8@mail.gmail.com> <3a142e750909221420m29ae8302t71ed9558c77542f4@mail.gmail.com> Date: Tue, 22 Sep 2009 18:49:26 -0300 Message-ID: <68c3445d0909221449g62904ae7pa4deb939baf4be1@mail.gmail.com> From: Raphael Kubo da Costa To: "Paul B. Mahol" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: 8.0RC1 - Kernel panic when loading a ndisgen-generated module (rtl8180_sys) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2009 21:49:28 -0000 2009/9/22 Paul B. Mahol : > On 9/22/09, Raphael Kubo da Costa wrote: >> 2009/9/22 Paul B. Mahol : >>> On 9/22/09, Raphael Kubo da Costa wrote: >>>> Hi there, >>>> >>>> I'm not sure this is the proper place to send this, so please tell me >>>> if I should send this mail to another mailing list or file a PR about >>>> this. >>>> >>>> I used freebsd-update to upgrade from 7.2-RELEASE-p3 to 8.0-RC1. >>>> Everything went fine, but I had to regenerate my wireless card >>>> (Realtek RTL8180L) module with ndisgen. However, when I load the >>>> generated module with kldload I get a kernel panic and the system >>>> reboots. I also have a 67mb vmcore; I can try to make it available if >>>> needed. >>> >>> You are saying that it worked without problems on 7.2? >> Yes, until this upgrade everything worked fine. >> >>> There were very little changes with sys/compat/ndis between that two >>> versions >>> so if problem really exist it must be somewhere in if_ndis module. >>> Are you sure that complete world and kernel are in sync? >> I think so; I've followed >> http://www.daemonology.net/blog/2009-07-11-freebsd-update-to-8.0-beta1.h= tml >> and ran "freebsd-update -r 8.0-RC1 upgrade", "freebsd-update install", >> rebooted, reran "freebsd-update install", rebooted and ran ndisgen. > > Once more, ndisgen(ndiscvt) requires correct kernel sources to make > working kernel module. > > For example you _must_ have 8.0-RC1 in /src and not some other version. > >> >>> And you really did loaded regenerated module? >> Yes, I ran ndisgen and used kldload to load the generated module and >> besides I copied the module to /boot/modules and tried loading it >> after the kernel panics. >> >>>> >>>> I'll paste some sections from core.txt; I can attach the whole file if >>>> you >>>> want. >>>> >>>> ----------- >>>> >>>> Unread portion of the kernel message buffer: >>>> >>>> >>>> Fatal trap 12: page fault while in kernel mode >>>> cpuid =3D 0; apic id =3D 00 >>>> fault virtual address =3D 0xc4ea831a >>>> fault code =A0 =A0 =A0 =A0 =A0 =A0=3D supervisor read, page not presen= t >>>> instruction pointer =A0 =3D 0x20:0xc4df96b3 >>>> stack pointer =A0 =A0 =A0 =A0 =3D 0x28:0xe3744a44 >>>> frame pointer =A0 =A0 =A0 =A0 =3D 0x28:0xe3744aac >>>> code segment =A0 =A0 =A0 =A0 =A0=3D base 0x0, limit 0xfffff, type 0x1b >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D DPL 0, pres 1, def32 1= , gran 1 >>>> processor eflags =A0 =A0 =A0=3D interrupt enabled, resume, IOPL =3D 0 >>>> current process =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D 1110 (ifconfig) >>>> trap number =A0 =A0 =A0 =A0 =A0 =3D 12 >>>> panic: page fault >>>> cpuid =3D 0 >>>> Uptime: 36s >>>> Physical memory: 883 MB >>>> Dumping 67 MB: 52 36 20 4 >>>> >>>> Reading symbols from /boot/kernel/snd_hda.ko...Reading symbols from >>>> /boot/kernel/snd_hda.ko.symbols...done. >>>> done. >>>> Loaded symbols for /boot/kernel/snd_hda.ko >>>> Reading symbols from /boot/kernel/sound.ko...Reading symbols from >>>> /boot/kernel/sound.ko.symbols...done. >>>> done. >>>> Loaded symbols for /boot/kernel/sound.ko >>>> Reading symbols from /boot/kernel/linprocfs.ko...Reading symbols from >>>> /boot/kernel/linprocfs.ko.symbols...done. >>>> done. >>>> Loaded symbols for /boot/kernel/linprocfs.ko >>>> Reading symbols from /boot/kernel/linux.ko...Reading symbols from >>>> /boot/kernel/linux.ko.symbols...done. >>>> done. >>>> Loaded symbols for /boot/kernel/linux.ko >>>> Reading symbols from /boot/kernel/reiserfs.ko...Reading symbols from >>>> /boot/kernel/reiserfs.ko.symbols...done. >>>> done. >>>> Loaded symbols for /boot/kernel/reiserfs.ko >>>> Reading symbols from /boot/kernel/logo_saver.ko...Reading symbols from >>>> /boot/kernel/logo_saver.ko.symbols...done. >>>> done. >>>> Loaded symbols for /boot/kernel/logo_saver.ko >>>> Reading symbols from /boot/modules/rtl8180_sys.ko...done. >>>> Loaded symbols for /boot/modules/rtl8180_sys.ko >>>> Reading symbols from /boot/kernel/if_ndis.ko...Reading symbols from >>>> /boot/kernel/if_ndis.ko.symbols...done. >>>> done. >>>> Loaded symbols for /boot/kernel/if_ndis.ko >>>> Reading symbols from /boot/kernel/ndis.ko...Reading symbols from >>>> /boot/kernel/ndis.ko.symbols...done. >>>> done. >>>> Loaded symbols for /boot/kernel/ndis.ko >>>> #0 =A0doadump () at pcpu.h:246 >>>> 246 =A0 pcpu.h: No such file or directory. >>>> =A0 =A0 =A0 in pcpu.h >>>> (kgdb) #0 =A0doadump () at pcpu.h:246 >>>> #1 =A00xc08823c7 in boot (howto=3D260) at >>>> /usr/src/sys/kern/kern_shutdown.c:416 >>>> #2 =A00xc08826b9 in panic (fmt=3DVariable "fmt" is not available. >>>> ) at /usr/src/sys/kern/kern_shutdown.c:579 >>>> #3 =A00xc0bb346c in trap_fatal (frame=3D0xe3744a04, eva=3D3303703322) >>>> =A0 =A0 at /usr/src/sys/i386/i386/trap.c:933 >>>> #4 =A00xc0bb36f0 in trap_pfault (frame=3D0xe3744a04, usermode=3D0, >>>> eva=3D3303703322) >>>> =A0 =A0 at /usr/src/sys/i386/i386/trap.c:846 >>>> #5 =A00xc0bb40d5 in trap (frame=3D0xe3744a04) at >>>> /usr/src/sys/i386/i386/trap.c:528 >>>> #6 =A00xc0b96a4b in calltrap () at /usr/src/sys/i386/i386/exception.s:= 165 >>>> #7 =A00xc4df96b3 in ndis_rtl8180_sys_drv_data_start () >>>> =A0 =A0from /boot/modules/rtl8180_sys.ko >>>> Previous frame inner to this frame (corrupt stack?) >>>> (kgdb) >>>> >>>> >>>> ------ Last lines from dmesg -------- >>>> Tue Sep 22 01:02:49 BRT 2009 >>>> Sep 22 01:02:55 borges login: ROOT LOGIN (root) ON ttyv0 >>>> warning: KLD '/boot/modules/rtl8180_sys.ko' is newer than the >>>> linker.hints >>>> file >>>> ndis0: port >>>> 0xe800-0xe8ff mem 0xdffffc00-0xdffffcff irq 16 at device 6.0 on pci1 >>>> ndis0: [ITHREAD] >>>> ndis0: NDIS API version: 5.1 >>>> ifa_add_loopback_route: insertion failed >>> >>> Try to enable debug.ndis sysctl. >> And then paste the same sections here? > > You can post newly introduced messages.(aka diff) >>>> >>>> Fatal trap 12: page fault while in kernel mode >>>> cpuid =3D 0; apic id =3D 00 >>>> fault virtual address =3D 0xc4ea831a >>>> fault code =A0 =A0 =A0 =A0 =A0 =A0=3D supervisor read, page not presen= t >>>> instruction pointer =A0 =3D 0x20:0xc4df96b3 >>>> stack pointer =A0 =A0 =A0 =A0 =3D 0x28:0xe3744a44 >>>> frame pointer =A0 =A0 =A0 =A0 =3D 0x28:0xe3744aac >>>> code segment =A0 =A0 =A0 =A0 =A0=3D base 0x0, limit 0xfffff, type 0x1b >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D DPL 0, pres 1, def32 1= , gran 1 >>>> processor eflags =A0 =A0 =A0=3D interrupt enabled, resume, IOPL =3D 0 >>>> current process =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D 1110 (ifconfig) >>> >>> What commands are to reproduce this? >> # kldload rtl8180_sys > > But up there is ifconfig mentioned so I need exact way to reproduce > it because backtrace is misleading. While I'm not at home to do the other things you've mentioned: I don't even have time to run ifconfig - I've commented out the lines enabling ndis, if_ndis and rtl8180_sys in /boot/loader.conf. I just run kldload rtl8180_sys the kernel panics automatically.