2

I am working on a kernel module and a user-space application to test that module.

The problem is that during testing my system hangs/freeze.

I have placed lots of debug prints in the code.

The last message that is printed is just before linux select call in my user-space application. Does select somehow freeze the system?

So, How can i debug that where is problem? whether the problem is on user-space application or kernel module?

3
  • 3
    You have an uninitialised variable in line 42. May 16, 2012 at 12:50
  • How do you know? I don't see the code.
    – Linuxios
    May 16, 2012 at 13:08
  • 1
    @wildplasser: which file you are talking about? :)
    – MA1
    May 16, 2012 at 17:33

2 Answers 2

3

As n.m mentioned, your userspace program can't freeze Linux, so its an error in your kernel module. The best way to debug this is to use a kernel debugger, and figure out what your module is doing wrong.

Common errors are uninitialized pointers that your module passes to the kernel or locking issues, so take a close look at those.

2

A userspace program cannot, by definition, freeze Linux. There's a bug in the kernel.

2
  • yep. But the problem is how to debug that?
    – MA1
    May 16, 2012 at 17:31
  • Well, if I were to debug a kernel I would seriously consider something like a kernel debugger. May 16, 2012 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.