Trying to make kernel thread sleep

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

 



Hi All,

I am trying to put kernel thread to sleep via
interruptible_sleep_on_timeout(). Body of kernel
thread function is as follows

static int print_taskinfo(void * data)
{
     wait_queue_head_t wait;
                                                      
                                   
init_waitqueue_head (&wait);
     for (;;)
     {
         // do something useful here.
         interruptible_sleep_on_timeout(&wait, HZ);  
         //check whether we have to break loop or 
continue.      
     }
}

I am facing following kernel oops :

Unable to handle kernel NULL pointer dereference at
virtual address 00000005
 printing eip:
c011905d
*pde = 00000000
Oops: 0002
CPU:    0
EIP:    0060:[<c011905d>]    Tainted: PF
EFLAGS: 00010086

EIP is at interruptible_sleep_on_timeout [kernel] 0x2d
(2.4.20-6)
eax: c2cadfc4   ebx: 00000286   ecx: c2cadfac   edx:
00000001
esi: 00000064   edi: c8dc7540   ebp: c2cadfbc   esp:
c2cadfa4
ds: 0068   es: 0068   ss: 0068
Process insmod (pid: 3884, stackpage=c2cad000)
Stack: 00000000 c2cac000 00000f2b 00000000 c034c000
c8dc74c0 c2cadfec d087d1a1 
       00000001 c2cadfc8 c2cadfc8 00000000 00000000
00000000 00000000 d087d074 
       00000000 00000000 00000000 c010742d 00000000
00000000 00000000 
Call Trace:   [<d087d1a1>] print_taskinfo [hello1]
0x12d (0xc2cadfc0))
[<d087d074>] print_taskinfo [hello1] 0x0 (0xc2cadfe0))
[<c010742d>] kernel_thread_helper [kernel] 0x5
(0xc2cadff0))


Code: 89 4a 04 89 55 f0 89 45 f4 89 08 89 f0 e8 d1 ca
00 00 89 c6 
 general protection fault: 0000
hello1 fealnx mii ide-cd cdrom soundcore mousedev
input parport_pc lp parport autofs ipt_REJECT
iptable_filter ip_tables ext3 jbd  
CPU:    0
EIP:    0060:[<c011b416>]    Tainted: PF
EFLAGS: 00210216

EIP is at __mmdrop [kernel] 0x126 (2.4.20-6)
eax: 00000000   ebx: ffffffff   ecx: 000001ac   edx:
ffffffff
esi: c2020000   edi: ffffffff   ebp: 00000000   esp:
c2021efc
ds: 0068   es: 0068   ss: 0068
Process bash (pid: 3840, stackpage=c2021000)
Stack: ffffffff 00000011 00000011 c011a170 ffffffff
c2020000 000006b0 c2020000 
       c011a8f7 c2020000 c015b890 c1b04244 000001f0
c2021f54 c47a1480 fffffff4 
       c47a1480 c47a1480 c01519d5 00000004 c2020000
00000011 00000000 bfffe2c8 
Call Trace:   [<c011a170>] dup_task_struct [kernel]
0x30 (0xc2021f08))
[<c011a8f7>] copy_process [kernel] 0x87 (0xc2021f1c))
[<c015b890>] d_alloc [kernel] 0x20 (0xc2021f24))
[<c01519d5>] do_pipe [kernel] 0x185 (0xc2021f44))
[<c011b1fe>] do_fork [kernel] 0x4e (0xc2021f5c))
[<c0107ad7>] sys_fork [kernel] 0x37 (0xc2021fa4))
[<c0109537>] system_call [kernel] 0x33 (0xc2021fc0))


Code: f3 a5 e9 53 ff ff ff 8d 76 00 c1 e9 02 89 d7 f3
a5 a4 e9 43 
 
Can anyone guide me where I am going wrong?

Regards


		
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/

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