Re: Changing the state of a process

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

 



On Mon, Dec 26, 2005 at 21:33:25 -0800, Rajaram Suryanarayanan wrote:
>  I was able to change the state of the parent process by including the following line in my init_module()
>  
>  current->parent->state = TASK_UNINTERRUPTIBLE;
>  
>  When I inserted this module with "insmod process-1.ko", the bash shell hung.
>  I understand that this is because the bash was actually in TASK_INTERRUPTIBLE state waiting for SIGCHLD signal, but I changed it to TASK_UNINTERRUPTIBLE state so that even when SIGCHLD is given by insmod on its completion, the parent bash process was not receiving the signal. So it hung. I was not able to kill and remove the bash process at all, even by "kill -9". Because I guess it never responded to signals.
>  
>  But I do not understand one thing. I wrote another module to change the state of that bash shell ( pid = 4256 ) again to TASK_INTERRUPTIBLE. 
>  
>  for_each_process(task)
>   {
>     if (task->pid==4256)
>     {
>       printk(KERN_INFO "Found the idiot process 4256\nGoing to repair it");
>       printk(KERN_INFO "Process state before repair :%d \n",task->state);
>       task->state = TASK_INTERRUPTIBLE;
>       printk(KERN_INFO "Process state after repair :%d \n",task->state);
>     }
>  }
>  
>  Then I tried to kill the process using "kill -9 4256". But still it was not receiving kill signal .
>  
>  Could you please explain this ?

No, I can't. But that state transition (between interruptible and
uninterruptible) is not supported. So it might be that the scheduler never
actually notices.

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