From: manomugdha biswas <manomugdhab@yahoo.co.in>
To: linux-kernel@vger.kernel.org
Subject: kernel panic
Date: Mon, 29 Aug 2005 07:43:08 +0100 (BST) [thread overview]
Message-ID: <20050829064308.33986.qmail@web8510.mail.in.yahoo.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3113 bytes --]
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 #2: 3024876882-testmngmnt.c --]
[-- Type: application/octet-stream, Size: 2042 bytes --]
/*
Copyright (c) Ixia 2003-2005
All rights reserved.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <net/tcp.h>
#include <linux/skbuff.h>
#include <asm/uaccess.h>
#include <linux/netdevice.h>
int sClientMajorNum = 0;
static int VNICClientIoctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
static int VNICClientStart(unsigned long arg);
static struct file_operations VNICFops = {
owner: THIS_MODULE,
ioctl: VNICClientIoctl
};
static int
VNICClientStart(unsigned long arg)
{
unsigned int retryCnt = 30;
DECLARE_WAIT_QUEUE_HEAD(wq);
init_waitqueue_head(&wq);
printk("\nretry count ----- : %d\n", retryCnt);
while (retryCnt) {
--retryCnt;
printk("\nretry count : %d\n", retryCnt);
if (!retryCnt) {
return -1;
}
/* wait for small */
printk("\n++++before sleep+++\n");
interruptible_sleep_on_timeout(&wq, 2);
printk("\n++++after sleep+++\n");
} /* end while (retryCnt)*/
return 0; /* for success */
} /* end VNICClientStart() */
static int
VNICClientIoctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
switch (cmd) {
//case VNIC_CLIENT_START:
case 0:
return VNICClientStart(arg);
break;
default :
return 0 ;
break;
} /* End of switch */
return 0; /* VNIC_IOCTL_SUCCESS */
}
int __init
VNICClientModuleInit(void)
{
/* register the character device */
sClientMajorNum = register_chrdev(0, "VNICClient", &VNICFops);
if (sClientMajorNum < 0) {
return -EIO;
}
return 0;
}
void
VNICClientModuleCleanUp(void)
{
/* unRegiter the character device(); */
unregister_chrdev(sClientMajorNum, "VNICClient");
}
module_init(VNICClientModuleInit);
module_exit(VNICClientModuleCleanUp);
#ifdef MODULE_LICENSE
MODULE_LICENSE("GPL");
#endif /* MODULE_LICENSE */
next reply other threads:[~2005-08-29 6:43 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-29 6:43 manomugdha biswas [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-09-17 2:59 Kernel panic zhang xintao
2012-12-02 17:30 Stefan Beller
2012-12-02 17:51 ` Stefan Beller
2012-12-02 19:13 ` rh
[not found] <201201191202.q0JC243u029201@curly.dor.state.ma.us>
2012-01-19 15:26 ` Ron Murray
2011-10-24 11:19 kernel panic nick bray
2011-10-25 20:55 ` Bjorn Helgaas
2011-10-26 10:00 ` Len Brown
2011-10-26 14:53 ` Bjorn Helgaas
[not found] ` <4EA82832.2070201@ntlworld.com>
2011-10-26 16:18 ` Bjorn Helgaas
[not found] ` <4EA83F5D.20001@ntlworld.com>
2011-10-26 18:10 ` Bjorn Helgaas
2011-10-28 2:13 ` Thomas Renninger
2011-10-31 12:24 ` Thomas Renninger
2010-05-18 4:23 senthilkumaar2021
2010-05-18 4:47 ` Justin P. Mattock
2010-05-18 4:55 ` senthilkumaar2021
2010-05-18 5:05 ` Eric Dumazet
2010-05-18 5:08 ` Justin P. Mattock
[not found] <9a5eeacd0804210350v79db27f0of73a29c55e2b7311@mail.gmail.com>
2008-04-21 10:56 ` Kernel panic Matthias Andersson
2008-04-21 11:07 ` Bart Van Assche
2006-08-24 18:01 kernel panic febo
2006-02-24 10:15 Rogel Miguez
[not found] <4GLD8-5Wa-27@gated-at.bofh.it>
2005-08-29 23:50 ` Robert Hancock
2004-04-12 10:39 osmaker@hu
2004-04-12 10:43 ` osmaker@hu
2004-04-12 12:26 ` Zwane Mwaikambo
[not found] <S263478AbTLEJ0s/20031205092648Z+878@vger.kernel.org>
2003-12-05 9:34 ` Kernel panic neel vanan
2003-12-05 14:19 ` William Lee Irwin III
2003-12-06 5:47 ` William Lee Irwin III
2003-03-26 20:22 Kernel Panic David van Hoose
2003-03-26 11:28 ` dan carpenter
2002-04-06 4:16 Kernel panic Daniel Mundy
2002-04-06 18:05 ` Alan Cox
2002-03-05 22:31 Hanno Böck
2002-03-06 1:40 ` Lionel Bouton
2002-03-06 1:50 ` Andre Hedrick
2002-02-19 18:27 kernel panic chiranjeevi vaka
2002-02-19 18:50 ` Justin Carlson
2002-02-21 17:17 ` Fernando Korndorfer
2002-01-02 19:34 nntp
2001-12-15 18:47 mempool design Benjamin LaHaise
2001-12-15 22:18 ` Ingo Molnar
2001-12-17 15:04 ` Andrea Arcangeli
2001-12-17 15:38 ` Victor Yodaiken
2001-12-17 17:33 ` kernel panic Geoffrey
2000-11-17 17:44 Kernel Panic Dave Seff
2000-11-18 19:29 ` Chmouel Boudjnah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050829064308.33986.qmail@web8510.mail.in.yahoo.com \
--to=manomugdhab@yahoo.co.in \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®