satoy
Posts: 1
Joined: Wed Nov 06, 2013 9:33 am

insmod fails for a simple kernel module hello.ko

Fri Nov 08, 2013 8:44 am

Hi, all.

I can't load a simple kernel mudule hello.ko with insmod command.
(board: Raspberry Pi Model B 512MB, OS: raspbian)
An Oops message occurs: "Unable to handle kernel NULL pointer dereference at virtual address 00000004".
Can anyone tell me what is the cause and how to solve the problem.

What I tried is as follows:
(1) Download 2013-09-25-wheezy-raspbian.zip from http://downloads.raspberrypi.org/raspbian_latest.
(2) Unzip it and write the image to a SD card with Win32DiskImager.exe.
(3) Insert the SD card into RaspberryPi (only a USB keyboard, HDMI and a LAN cable are connected to that), then power on it.
(4) Select <Finish> raspi-config without setting anything up.
(5) Get kernel source with get-kernel-source.sh:

Code: Select all

     pi@raspberrypi ~$ wget https://raw.github.com/gkaindl/ambi-tv/master/misc/get-kernel-source.sh
     pi@raspberrypi ~$ chmod a+x get-kernel-source.sh
     pi@raspberrypi ~$ sudo -i
     root@raspberrypi:~# cd /home/pi/
     root@raspberrypi:/home/pi# ./get-kernel-source.sh > get-kernel-source.mylog 2>&1
     root@raspberrypi:/home/pi# echo $?
     0
log get-kernel-source.mylog here:

Code: Select all

Installing kernel source for revision d4f5315cfac4e...
--2013-11-08 06:28:25--  https://raw.github.com/raspberrypi/firmware/d4f5315cfac4e/extra/git_hash
Resolving raw.github.com (raw.github.com)... 103.245.222.133
Connecting to raw.github.com (raw.github.com)|103.245.222.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 41 [text/plain]
Saving to: `rasp-tmp/git_hash'

     0K                                                       100% 60.8K=0.001s

2013-11-08 06:28:31 (60.8 KB/s) - `rasp-tmp/git_hash' saved [41/41]

--2013-11-08 06:28:31--  https://raw.github.com/raspberrypi/firmware/d4f5315cfac4e/extra/Module.symvers
Resolving raw.github.com (raw.github.com)... 103.245.222.133
Connecting to raw.github.com (raw.github.com)|103.245.222.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 450335 (440K) [text/plain]
Saving to: `rasp-tmp/Module.symvers'

     0K .......... .......... .......... .......... .......... 11% 1.27M 0s
    50K .......... .......... .......... .......... .......... 22% 1.91M 0s
   100K .......... .......... .......... .......... .......... 34% 1.55M 0s
   150K .......... .......... .......... .......... .......... 45% 3.17M 0s
   200K .......... .......... .......... .......... .......... 56% 2.34M 0s
   250K .......... .......... .......... .......... .......... 68% 2.88M 0s
   300K .......... .......... .......... .......... .......... 79% 3.26M 0s
   350K .......... .......... .......... .......... .......... 90% 2.83M 0s
   400K .......... .......... .......... .........            100% 3.84M=0.2s

2013-11-08 06:28:37 (2.25 MB/s) - `rasp-tmp/Module.symvers' saved [450335/450335]

--2013-11-08 06:28:37--  https://github.com/raspberrypi/linux/tarball/1587f775d0a3c437485262ba951afc5e30be69fa
Resolving github.com (github.com)... 192.30.252.129
Connecting to github.com (github.com)|192.30.252.129|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/raspberrypi/linux/legacy.tar.gz/1587f775d0a3c437485262ba951afc5e30be69fa [following]
--2013-11-08 06:28:43--  https://codeload.github.com/raspberrypi/linux/legacy.tar.gz/1587f775d0a3c437485262ba951afc5e30be69fa
Resolving codeload.github.com (codeload.github.com)... 192.30.252.146
Connecting to codeload.github.com (codeload.github.com)|192.30.252.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 106487882 (102M) [application/x-gzip]
Saving to: `rasp-tmp/linux.tar.gz'

     0K .......... .......... .......... .......... ..........  0%  131K 13m13s
    50K .......... .......... .......... .......... ..........  0%  261K 9m55s
   100K .......... .......... .......... .......... ..........  0%  263K 8m48s
                   (...... Omit here ......)
103850K .......... .......... .......... .......... .......... 99% 4.29M 0s
103900K .......... .......... .......... .......... .......... 99% 4.25M 0s
103950K .......... .......... .......... .......... ..        100% 3.68M=53s

2013-11-08 06:29:45 (1.91 MB/s) - `rasp-tmp/linux.tar.gz' saved [106487882/106487882]

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#
scripts/kconfig/conf --silentoldconfig Kconfig
  WRAP    arch/arm/include/generated/asm/auxvec.h
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/percpu.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  HOSTCC  scripts/genksyms/genksyms.o
  SHIPPED scripts/genksyms/lex.lex.c
  SHIPPED scripts/genksyms/keywords.hash.c
  SHIPPED scripts/genksyms/parse.tab.h
  HOSTCC  scripts/genksyms/lex.lex.o
  SHIPPED scripts/genksyms/parse.tab.c
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/bin2c
(6) Compile kernel mudule hello.ko:

Code: Select all

     pi@raspberrypi ~/hello$ make V=1 > compile-hello.mylog 2>&1
     pi@raspberrypi ~/hello$ echo $?
     0
log compile-hello.mylog here:

Code: Select all

make -C /lib/modules/3.6.11+/build M=/home/pi/hello modules
make[1]: Entering directory `/usr/src/linux-source-3.6.11+'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
	echo >&2;							\
	echo >&2 "  ERROR: Kernel configuration is invalid.";		\
	echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
	echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
	echo >&2 ;							\
	/bin/false)
mkdir -p /home/pi/hello/.tmp_versions ; rm -f /home/pi/hello/.tmp_versions/*
make -f scripts/Makefile.build obj=/home/pi/hello
make[2]: Warning: File `include/config/auto.conf' has modification time 3.7e+06 s in the future
  gcc -Wp,-MD,/home/pi/hello/.hello.o.d  -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/4.6/include -I/usr/src/linux-source-3.6.11+/arch/arm/include -Iarch/arm/include/generated -Iinclude  -include /usr/src/linux-source-3.6.11+/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2708/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -marm -fno-dwarf2-cfi-asm -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=6 -march=armv6 -mtune=arm1136j-s -msoft-float -Uarm -Wframe-larger-than=1024 -Wno-unused-but-set-variable -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(hello)"  -D"KBUILD_MODNAME=KBUILD_STR(hello)" -c -o /home/pi/hello/.tmp_hello.o /home/pi/hello/hello.c
(cat /dev/null;   echo kernel//home/pi/hello/hello.ko;) > /home/pi/hello/modules.order
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make -f /usr/src/linux-source-3.6.11+/scripts/Makefile.modpost
make[2]: Warning: File `include/config/auto.conf' has modification time 3.7e+06 s in the future
  scripts/mod/modpost -m -a -i /usr/src/linux-source-3.6.11+/Module.symvers -I /home/pi/hello/Module.symvers  -o /home/pi/hello/Module.symvers -S -w  -s
  gcc -Wp,-MD,/home/pi/hello/.hello.mod.o.d  -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/4.6/include -I/usr/src/linux-source-3.6.11+/arch/arm/include -Iarch/arm/include/generated -Iinclude  -include /usr/src/linux-source-3.6.11+/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2708/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -marm -fno-dwarf2-cfi-asm -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=6 -march=armv6 -mtune=arm1136j-s -msoft-float -Uarm -Wframe-larger-than=1024 -Wno-unused-but-set-variable -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(hello.mod)"  -D"KBUILD_MODNAME=KBUILD_STR(hello)" -DMODULE  -c -o /home/pi/hello/hello.mod.o /home/pi/hello/hello.mod.c
  ld -EL -r  -T /usr/src/linux-source-3.6.11+/scripts/module-common.lds --build-id  -o /home/pi/hello/hello.ko /home/pi/hello/hello.o /home/pi/hello/hello.mod.o
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving directory `/usr/src/linux-source-3.6.11+'
(7) Load hello.ko with insmod command as below, but the Oops occurs and insmod fails.

Code: Select all

     pi@raspberrypi ~$ sudo -i
     root@raspberrypi:~# cd /home/pi/hello/
     root@raspberrypi:/home/pi/hello# insmod hello.ko
(8) Now OS seems to be freeze... Any input from USB keyboard has no effect.

But /dev/ttyAMA0 (UART) is still working and kdb is running on the serial console via UART cable connected to Connector P1 as below:

Code: Select all

root@raspberrypi:/home/pi/hello# insmod hello.ko
[  400.954687] [hello]: hello_load()
[  400.959430] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[  400.970310] pgd = d9e4c000
[  400.974421] [00000004] *pgd=00000000
[  400.979342] Internal error: Oops: 5 [#1] PREEMPT ARM

Entering kdb (current=0xd9e86e40, pid 2685) Oops: (null)
due to oops @ 0xc005ce34

Pid: 2685, comm:               insmod
CPU: 0    Tainted: P           O  (3.6.11+ #538)
PC is at module_put+0x28/0x6c
LR is at sys_init_module+0x428/0x19d0
pc : [<c005ce34>]    lr : [<c005e08c>]    psr: a0000013
sp : d9ea5ef0  ip : 00000000  fp : 000000ee
r10: 00000024  r9 : bf0700cc  r8 : 0000001c
r7 : 00000001  r6 : daae9c40  r5 : bf070084  r4 : d9ea4000
r3 : 00000000  r2 : 00000000  r1 : 00000001  r0 : bf070084
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 00c5387d  Table: 19e4c008  DAC: 00000015
[<c0013b60>] (unwind_backtrace+0x0/0xf0) from [<c0072fe0>] (kdb_dumpregs+0x28/0x50)
[<c0072fe0>] (kdb_dumpregs+0x28/0x50) from [<c0075364>] (kdb_main_loop+0x3a8/0x6fc)
[<c0075364>] (kdb_main_loop+0x3a8/0x6fc) from [<c0077a48>] (kdb_stub+0x154/0x380)
[<c0077a48>] (kdb_stub+0x154/0x380) from [<c006eb7c>] (kgdb_handle_exception+0x1f8/0x668)
[<c006eb7c>] (kgdb_handle_exception+0x1f8/0x668) from [<c00132e0>] (kgdb_notify+0x24/0x40)
[<c00132e0>] (kgdb_notify+0x24/0x40) from [<c03a32d4>] (notifier_call_chain+0x44/0x84)
[<c03a32d4>] (notifier_call_chain+0x44/0x84) from [<c03a334c>] (__atomic_notifier_call_chain+0x38/0x4c)
[<c03a334c>] (__atomic_notifier_call_chain+0x38/0x4c) from [<c03a3378>] (atomic_notifier_call_chain+0x18/0x20)
[<c03a3378>] (atomic_notifier_call_chain+0x18/0x20) from [<c03a33b8>] (notify_die+0x38/0x44)
[<c03a33b8>] (notify_die+0x38/0x44) from [<c001102c>] (die+0xc4/0x39c)
[<c001102c>] (die+0xc4/0x39c) from [<c039b6b8>] (__do_kernel_fault.part.9+0x54/0x74)
[<c039b6b8>] (__do_kernel_fault.part.9+0x54/0x74) from [<c03a2ff4>] (do_page_fault+0x1d8/0x3cc)
[<c03a2ff4>] (do_page_fault+0x1d8/0x3cc) from [<c000832c>] (do_DataAbort+0x34/0x98)
[<c000832c>] (do_DataAbort+0x34/0x98) from [<c03a17f8>] (__dabt_svc+0x38/0x60)
Exception stack(0xd9ea5ea8 to 0xd9ea5ef0)
5ea0:                   bf070084 00000001 00000000 00000000 d9ea4000 bf070084
5ec0: daae9c40 00000001 0000001c bf0700cc 00000024 000000ee 00000000 d9ea5ef0
5ee0: c005e08c c005ce34 a0000013 ffffffff
[<c03a17f8>] (__dabt_svc+0x38/0x60) from [<c005ce34>] (module_put+0x28/0x6c)
[<c005ce34>] (module_put+0x28/0x6c) from [<c005e08c>] (sys_init_module+0x428/0x19d0)
[<c005e08c>] (sys_init_module+0x428/0x19d0) from [<c000da60>] (ret_fast_syscall+0x0/0x30)
more>
kdb>

kdb>
kdb>
kdb> 
(Now I can input to kdb prompt via serial console, but I don't know what to do...)

Thanks for any hint.


source code here:
<1> hello.c:

Code: Select all

#include <linux/kernel.h>
#include <linux/module.h>

/* on driver load */
static int __init hello_load(void)
{
	printk(KERN_CRIT "[hello]: %s()\n", __func__);
	return 0;
}

/* on driver unload */
static void __exit hello_unload(void)
{
	printk(KERN_CRIT "[hello]: %s()\n", __func__);
}

module_init(hello_load);
module_exit(hello_unload);
<2> Mekefile:

Code: Select all

obj-m := hello.o

KDIR := /lib/modules/$(shell uname -r)/build

default:
	$(MAKE) -C $(KDIR) M=$(shell pwd) modules

clean:
	$(MAKE) -C $(KDIR) M=$(shell pwd) clean
	rm -f TAGS Module.symvers Module.markers modules.order

IsaacDynamo
Posts: 2
Joined: Wed Nov 06, 2013 12:07 pm

Re: insmod fails for a simple kernel module hello.ko

Fri Nov 08, 2013 11:20 am

Hi satoy,

You are not alone, I'm probably experiencing the same problem as you.
http://www.raspberrypi.org/phpBB3/viewt ... 99&p=0&e=0

I'm sorry that I don't have an answer, but if you find one, please let me know.

Greetings,

luka1983
Posts: 2
Joined: Sun Nov 17, 2013 7:05 pm

Re: insmod fails for a simple kernel module hello.ko

Wed Nov 20, 2013 9:26 pm

Hi Guys,

I have identical problem with raspbian 3.6.11+ from 2013-09-25. So I've managed to dig out older release from 2013-02-09. I've run the same get-kernel-source.sh script to setup mu environment and module loads without oops now. Regarding the root cause, I have no idea why the module fails with latest foundation release (2013-09-25).

Br,
Luka

Heater
Posts: 19412
Joined: Tue Jul 17, 2012 3:02 pm

Re: insmod fails for a simple kernel module hello.ko

Thu Nov 21, 2013 7:45 am

I can't help thinking that the big error message in your compilation is trying to tell you something:

Code: Select all

   echo >&2 "  ERROR: Kernel configuration is invalid.";      \
   echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
   echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";   \
Slava Ukrayini.

luka1983
Posts: 2
Joined: Sun Nov 17, 2013 7:05 pm

Re: insmod fails for a simple kernel module hello.ko

Thu Nov 21, 2013 6:49 pm

Hi Heater,

in my case the compilation passes cleanly but the end result is the same nevertheless. Also, the same procedure for configuration of kernel source tree on older foundation release produces modules which are loaded without a problem.

Anyway I really don't understand why the kernel headers are not provided with every release. It almost looks as the foundation is not happy with users producing custom, widely applicable modules.

Br,
Luka

Metalo
Posts: 1
Joined: Thu Aug 28, 2014 4:43 pm

Re: insmod fails for a simple kernel module hello.ko

Thu Aug 28, 2014 4:44 pm

Hi guys,

I am having the same problem, did you figure it out?

Thanks,

Paul

rbrito
Posts: 1
Joined: Fri Sep 05, 2014 3:18 am

Re: insmod fails for a simple kernel module hello.ko

Fri Sep 05, 2014 3:22 am

Hi,

Anyone with luck in this matter?

I have 3.12.22+ and I am having the same problem when loading hello.ko (as per example in LDD3 book).

[382194.035371] Hello, world
[382194.039175] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[382194.047509] pgd = d39dc000
[382194.050342] [00000004] *pgd=00000000
[382194.054040] Internal error: Oops: 5 [#1] PREEMPT ARM
[382194.059085] Modules linked in: hello(O) snd_bcm2835 snd_soc_bcm2708_i2s regmap_mmio snd_soc_core regmap_spi snd_pcm_dmaengine snd_pcm snd_page_alloc 8192cu regmap_i2c snd_compress snd_seq snd_timer snd_seq_device leds_gpio led_class snd
[382194.080182] CPU: 0 PID: 5285 Comm: insmod Tainted: G O 3.12.22+ #691
[382194.087483] task: d39f2580 ti: d39b2000 task.ti: d39b2000
[382194.092977] PC is at module_put+0x28/0x6c
[382194.097073] LR is at load_module+0x1730/0x1d80
[382194.101600] pc : [<c0066e0c>] lr : [<c0069328>] psr: a0000013
[382194.101600] sp : d39b3ea0 ip : d39b2000 fp : c0066b34
[382194.113232] r10: 00000000 r9 : bf1620d4 r8 : d3a07f40
[382194.118534] r7 : 00000001 r6 : bf16208c r5 : bf162098 r4 : d39b2000
[382194.125135] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : bf16208c
[382194.131739] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[382194.138949] Control: 00c5387d Table: 139dc008 DAC: 00000015
[382194.144772] Process insmod (pid: 5285, stack limit = 0xd39b21b8)
[382194.150855] Stack: (0xd39b3ea0 to 0xd39b4000)
[382194.155300] 3ea0: d39b3f58 c0069328 bf162098 00007fff c0066ccc da695000 c0066bb4 da694000
[382194.163557] 3ec0: bf1621d4 bf162098 d39b2000 bf16208c c02394d8 c055a93c 00000000 00000000
[382194.171813] 3ee0: 00000000 00000000 00000000 00000000 6e72656b 00006c65 00000000 00000000
[382194.180068] 3f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[382194.188323] 3f20: 00000000 00000000 00000000 ac01d8cb 000000d2 00000bb0 b6f45000 b6f05948
[382194.196582] 3f40: 00000080 c000e328 d39b2000 00000000 00000000 c0069a50 da694000 00000bb0
[382194.204839] 3f60: da6944c8 da694401 da694ac0 000001e0 000002c0 00000000 00000000 00000000
[382194.213094] 3f80: 00000012 00000013 0000000a 00000008 00000006 00000000 bea3f6dc 00000000
[382194.221350] 3fa0: b77fdff8 c000e180 bea3f6dc 00000000 b6f45000 00000bb0 b6f05948 b6f45000
[382194.229606] 3fc0: bea3f6dc 00000000 b77fdff8 00000080 b77fdf48 00000bb0 b6f05948 00000000
[382194.237862] 3fe0: 00000000 bea3f684 b6efcfb4 b6e67fd4 60000010 b6f45000 00000000 00000000
[382194.246136] [<c0066e0c>] (module_put+0x28/0x6c) from [<c0069328>] (load_module+0x1730/0x1d80)
[382194.254751] [<c0069328>] (load_module+0x1730/0x1d80) from [<c0069a50>] (SyS_init_module+0xd8/0xec)
[382194.263805] [<c0069a50>] (SyS_init_module+0xd8/0xec) from [<c000e180>] (ret_fast_syscall+0x0/0x30)
[382194.272845] Code: e5943004 e2833001 e5843004 e5903158 (e5932004)
[382194.279255] ---[ end trace e6a641b95f8b75ed ]---
[382194.284069] note: insmod[5285] exited with preempt_count 1

Aurelian_15
Posts: 9
Joined: Sun Nov 11, 2012 4:59 pm

Re: insmod fails for a simple kernel module hello.ko

Fri Sep 19, 2014 11:34 am

Same problem as in the above post here:

Code: Select all

[   79.560914] Unable to handle kernel NULL pointer dereference at virtual address 000000fc
[   79.572816] pgd = db394000
[   79.577374] [000000fc] *pgd=00000000
[   79.582821] Internal error: Oops: 5 [#1] PREEMPT ARM
[   79.589518] Modules linked in: homeeasy_driver(O) snd_bcm2835 arc4 rt2800usb snd_soc_bcm2708_i2s rt2800lib regmap_mmio rt2x00usb rt2x00lib snd_soc_core snd_compress regmap_i
2c snd_pcm_dmaengine mac80211 regmap_spi snd_pcm snd_page_alloc snd_seq snd_seq_device cfg80211 snd_timer crc_ccitt rfkill leds_gpio led_class snd
[   79.625227] CPU: 0 PID: 2377 Comm: insmod Tainted: G           O 3.12.28+ #709
[   79.634274] task: db38be80 ti: d941c000 task.ti: d941c000
[   79.641465] PC is at module_put+0x28/0x7c
[   79.647220] LR is at load_module+0x19f0/0x1e98
[   79.653358] pc : [<c006a260>]    lr : [<c006d0dc>]    psr: a0000013
[   79.653358] sp : d941de90  ip : d941c018  fp : db24f364
[   79.668248] r10: bf1c2580  r9 : 00000001  r8 : db24f340
[   79.675180] r7 : 00000001  r6 : bf1c2538  r5 : 00000000  r4 : d941c010
[   79.683433] r3 : 000000f8  r2 : 00000001  r1 : 00000000  r0 : bf1c2538
[   79.691676] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   79.700580] Control: 00c5387d  Table: 1b394008  DAC: 00000015
[   79.708118] Process insmod (pid: 2377, stack limit = 0xd941c1b8)
[   79.715920] Stack: (0xd941de90 to 0xd941e000)
[   79.722053] de80:                                     bf1c2544 c006d0dc bf1c2544 00007fff
[   79.733827] dea0: c006a3b0 dc803000 00000000 c006a47c 00000000 bf1c2680 bf1c2544 d941c018
[   79.745612] dec0: dde5e224 bf1c2538 d941df60 d941df8c c024cca0 20000013 00000000 00000000
[   79.757596] dee0: 00000000 00000000 00000000 00000000 6e72656b 00006c65 00000000 00000000
[   79.769747] df00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   79.781919] df20: 00000000 00000000 00000000 3a153cdf b6ec6948 00001b97 b6f09000 b6ec6948
[   79.794130] df40: 00000080 c000e068 d941c000 00000000 00000000 c006d660 dde5d000 00001b97
[   79.806460] df60: dde5dd9c dde5dc57 dde5e93c 000006d0 000008a0 00000000 00000000 00000000
[   79.818968] df80: 0000001d 0000001e 00000015 00000012 00000010 00000000 bec4c68c 00000000
[   79.831637] dfa0: b7aaafa8 c000dec0 bec4c68c 00000000 b6f09000 00001b97 b6ec6948 b6f09000
[   79.844487] dfc0: bec4c68c 00000000 b7aaafa8 00000080 b7aaaed8 00001b97 b6ec6948 00000000
[   79.857456] dfe0: 00000000 bec4c634 b6ebdfb4 b6e290d4 60000010 b6f09000 00000000 00000000
[   79.870569] [<c006a260>] (module_put+0x28/0x7c) from [<c006d0dc>] (load_module+0x19f0/0x1e98)
[   79.884134] [<c006d0dc>] (load_module+0x19f0/0x1e98) from [<c006d660>] (SyS_init_module+0xdc/0xf0)
[   79.898172] [<c006d660>] (SyS_init_module+0xdc/0xf0) from [<c000dec0>] (ret_fast_syscall+0x0/0x30)
[   79.912189] Code: e5932004 e2822001 e5832004 e5903158 (e5932004) 
[   79.921107] ---[ end trace 02e8d41247d5c067 ]---
[   79.928308] note: insmod[2377] exited with preempt_count 1
same module runs fine on a desktop computer, fresh raspbian installation, kernel 3.12.28+

Aurelian_15
Posts: 9
Joined: Sun Nov 11, 2012 4:59 pm

Re: insmod fails for a simple kernel module hello.ko

Fri Sep 19, 2014 12:25 pm

Must be a Raspbian problem, the same module runs fine on the same kernel version on Arch.

Return to “Raspberry Pi OS”