Re: kernel thread signal

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

 



> > to kill this thread. So, when i send a SIGTERM, the linux crash.
> > Ah, in my cleanup_module i have kill_proc(pid[i], SIGKILL, 1), and it
> > crash too.
> close the socket the thread is blocked on and it would free the thread.
> Regarding the signal stuff: What I can tell you is that the kernel checks
> for pending signals before going back from kernel space to user space (after
> a system call) and when waking up from interruptible sleep. The first is not relevant
> to you because your thread remains in the kernel always and neither the second
> because your thread is still sleeping. I think you should go with closing the socket.

But sending a signal includes changing TASK_INTEPRUTIBLE state to TASK_RUNNING,
so the process should wake up from interuptible sleep (after all, that's why
it's called interruptible - however it won't wake up from uninterruptible sleep).
On the other hand, handler won't be invoked there. You should just see the
signal_pending() check returning true. Thus I don't expect SIGKILL to work.
You must make sure the thread will terminate yourself (and wait for the thread
to actualy die before returning from cleanup_module).

However, that does not explain, why the system should crash. It would help
to see the oops trace.

--------------------------------------------------------------------------------
                  				- Jan Hudec `Bulb' <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/



[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