hello everyone,
i am new to kernel coding. i am doing a module for process migration. while trying to allocate a task_struct type cache using kmem_cache_alloc() function from a module, i get segmentation fault. with following in log file. what the actual reason for -unable to access kernel NULL pointer dereference at virtual address. can anyone help me?.......
Apr 8 23:11:48 localhost kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000000
Apr 8 23:11:48 localhost kernel: printing eip:
Apr 8 23:11:48 localhost kernel: c014c48f
Apr 8 23:11:48 localhost kernel: *pde = 11100067
Apr 8 23:11:48 localhost kernel: Oops: 0000 [#2]
Apr 8 23:11:48 localhost kernel: EIP is at kmem_cache_alloc+0x1f/0x70
Are you new to C programming,
Are you new to C programming, as well?
The answer is right in front of you; don't dereference a NULL pointer.
Find out exactly where you're doing that, and then don't.
Accessing Memory Descriptor of interupted process
thanks for ur valid suggestion. But actually what i meant to ask is, can we able copy memory descriptor of interrupted process to a new task_struct descriptor and continue execution..
??
Then why did you waste your and our time by asking the wrong question?? I still don't understand, what you do and what you want to know.
i dint ask wrong question,
i dint ask wrong question, the way i asked the question is wrong.
sorry , if i wasted ur valuable time. i asked "While i tried to allocate a new task_struct type using kmem_cache_alloc for a process migration, i got segmentation fault." Did copying the memory descriptor of another process and using it will result in unknown virtual address fault?....
hope i made u understand the question this time....... thanx for ur replies......
No, you haven't. Sounds like
No, you haven't. Sounds like you're basically asking, "can I assign a pointer value, and then access it". Well, yes, just don't dereference it when it's NULL. When does it become NULL? We DON'T KNOW, because you haven't shown the code.
You need to post the code. We couldn't care less what you're trying to do functionally; we need to see the actual code to be of any help. It's like saying, "I'm trying to write this super cool 3D game, but it keeps segfaulting. What am I doing wrong".
Post your code?
Post your code?
Man.... lighten up n give the
Man.... lighten up n give the dude a break... everyone learns somehow and if your just the coding GOD then what're you doin in a forum ripping the shit outa this guy?
... Ah... im just waiting for you to post a question and get it ripped down instead of awnsered and frustrate the hell outa you...
You're attempting to derefere
You're attempting to dereference a null pointer, which is not allowed.
You need to provide us with the complete Oops message, and ideally the source code. Otherwise you'll find that many people will just not be willing to help you as we don't have all the details.