kernel panic

From: manomugdha biswas
Date: Mon Aug 29 2005 - 01:43:36 EST


Hi,
I am using the following makefile and the .c file to
generate a kernel module. I can load this module
without error and warning. But when I call ioctl()
from user application to run this module it gets
kernel panic!

I am using redhat 9.0 and kernel 2.4.20-8.

testmngmnt.c:
=============
This file has been attached with this mail.

Makefile:
=========
# set the approriate value for additional cflags
GCC_VER := $(strip $(shell gcc -dumpversion))
XTRA_CFLAGS =
ifeq ($(GCC_VER), 3.2.2)
XTRA_CFLAGS = -DRH_9_0
endif # GCC_VER
ifeq ($(GCC_VER), 3.2.3)
XTRA_CFLAGS = -DRH_9_0
endif # GCC_VER


CC = gcc
LD = ld
LDFLAG = -r
LINUX_VERSION = linux-$(shell uname -r)


CFLAGS = -g -Wall -DMODULE -O2 -D__KERNEL__
$(XTRA_CFLAGS) -DLINK_ETHERNET \
-I/usr/src/$(LINUX_VERSION)/include -I${INCLUDE}
-D__DEBUG__


dvr_objs = testmngmnt.o




test.o: ${dvr_objs}
ld -X -r -o test.o ${dvr_objs} ; \


testmngmnt.o: testmngmnt.c
${CC} ${CFLAGS} -c testmngmnt.c


clean:
rm -f *.o *~ include/*~


all: test.o



Kernel panic dump:
==================
Unable to handle kernel NULL pointer dereference at
virtual address 00000005
printing eip:
c0118ffd
*pde = 00000000
Oops: 0002
test soundcore ide-cd cdrom i830 agpgart parport_pc lp
parport cisco_ipsec autofs 8139too mii keybdev
mousedev hid input usb-uhci ehci-hcd usbcore ext3 jbd
CPU: 0
EIP: 0060:[<c0118ffd>] Tainted: P
EFLAGS: 00210086

EIP is at interruptible_sleep_on_timeout [kernel] 0x2d
(2.4.20-8)
eax: f4f31f78 ebx: 00200286 ecx: f4f31f50 edx:
00000001
esi: 00000002 edi: f5050300 ebp: f4f31f60 esp:
f4f31f48
ds: 0068 es: 0068 ss: 0068
Process vnicClientMirro (pid: 4971,
stackpage=f4f31000)
Stack: 00000000 f4f30000 f5113980 f5113980 0000001d
00000000 f4f31f90 f8fe60b8
f8fe615c 0000001d f5113fa4 f5113700 00000001
f4f31f7c f4f31f7c 00000000
00000002 ffffffe7 00000003 c01566e9 bfffd880
f5050300 00000000 bfffd880
Call Trace: [<f8fe60b8>] VNICClientStart [test] 0x58
(0xf4f31f64))
[<f8fe615c>] .rodata.str1.1 [test] 0x2c (0xf4f31f68))
[<c01566e9>] sys_ioctl [kernel] 0xc9 (0xf4f31f94))
[<c0109537>] system_call [kernel] 0x33 (0xf4f31fc0))


Code: 89 4a 04 89 55 f0 89 45 f4 89 08 89 f0 e8 a1 cb
00 00 89 c6

Could you please give some light on this issue?

Regards,
Manomugdhab

Manomugdha Biswas



_______________________________________________________
Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com

Attachment: testmngmnt.c
Description: 3024876882-testmngmnt.c