Re: Problem killing a kernel_thread.

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

 



On Mon, Oct 11, 2004 at 09:54:41 +0530, Praveen Nair wrote:
> 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.

Kernel threads don't handle signals.

So, you must send the signal (as a way to force accept to return), but
then you must:
    1) Manualy find that you got the signal (with signal_pending macro).
    2) Find out whether the reason is unloading of the module.
    3) If it is not, clear the signal (it's somewhere in current).
    4) If it is, exit the thread via complete_and_exit call.
    5) In module_done, wait for the completion to complete.

Note: The error you sent looks strange. It seems to happen during LOAD
process of the i810_audio module.

> 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.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[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