RE: Problem killing a kernel_thread.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Praveen,

It looks to me that the kernel thread is not really killed and the
address is invalid after unloading the modules (But the kernel thread
still being scheduled) ! Just a guess.

Can you add a new global variable checked in the kernel thread and if it
is set, just exit from the kernel thread rather than killing from out
side. From the module cleanup function, set the kill variable and exit
from the cleanup function only after kernel thread is killed itself.

This is just my thought ...

kill_proc() working properly would have been nice !

Aboo


-----Original Message-----
From: kernelnewbies-bounce@xxxxxxxxxxxx
[mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Praveen Nair
Sent: Monday, October 11, 2004 2:25 PM
To: kernelnewbies@xxxxxxxxxxxx
Subject: Problem killing a kernel_thread.

Hi,

 I am writting a kernel module with a thread that waits for accepting
socket
connections (sock->ops->accept()). This thread is spawned from the init
function
and i am trying to kill the thread from the exit function using
kill_proc(tid, SIGKILL,1).
But as soon as i unload the module i get the following error.

Unable to handle kernel paging request at virtual address d296e337
 printing eip:
d296e337
*pde = 01bae067
*pte = 00000000
Oops: 0000
i810_audio ac97_codec soundcore agpgart parport_pc lp parport nfsd lockd
sunrpc autofs ds yenta_socket pcmcia_core e100 keybdev
mousedev hid input usb-uhci eh
CPU:    0
EIP:    0060:[<d296e337>]    Tainted: GF
EFLAGS: 00010246
EIP is at __insmod_i810_audio_S.data_L776 [i810_audio] 0x6077
(2.4.20-28.9)
eax: fffffe00   ebx: 00000000   ecx: cb1918e0   edx: fffffe00
esi: 00000000   edi: 00000000   ebp: c6449fec   esp: c6449f84
ds: 0068   es: 0068   ss: 0068
Process insmod (pid: 3953, stackpage=c6449000)
Stack: cb1918c4 c64a5374 00000000 c0329da0 00000000 00000000 00000000
00000000
       00000000 00000000 00000000 cff46b00 cff46b00 ced29e60 c0108d2e
cff46b00
       d296e254 00000000 00000000 00000000 703d0002 0100007f 00000000
00000068
Call Trace:   [<c0108d2e>] ret_from_fork [kernel] 0x6 (0xc6449fbc))
[<c0106fc1>] kernel_thread_helper [kernel] 0x5 (0xc6449ff0))
Code:  Bad EIP value.

If i don't kill the thread then the unload happens without issues.
Please do help me out.

Regards,
- Praveen

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux