rmmod segfaulting and causing lsmod to hang withh 2.6.3 kernel
OK, I'm getting into kernel devel, and to learn the API I've got a useless module I'm writing. Right now, all it does is printk something on load and something else on unload. I can insmod it fine, but when I rmmod it, it simply segfaults. After I do rmmod, anytime I run lsmod, it simply hangs and I cannot kill it! I cannot kill it! The damned beast simply WILL NOT DIE! DIE, BEAST, DIE! DIE! BWA-HA-HA-HA-HA!
But yeah, rmmod and lsmod are acting retarded. Any ideas? |
I'm not sure if this is it but in the latest 2.6.x kernel series, you compile in support to remove modules, etc. Do you have such support?
|
Yes, I did that.
Earlier I was trying to remove the same module, and it explicitly told me that I hadn't compiled support for module unloading in. So I recompiled with unloading support, and now things just go all to hell rather than a nice, polite error message :) |
What's your source code? Have you correctly initialize each struct?
|
So far, this is it (eventually, it's going to be a driver for a device similar to /dev/zero, except it spits out 'z's instead of '0's):
Code:
#include <linux/module.h> |
I test this code with my 2.4.24 kernel and everything went fine. Note that I have to add "#include <linux/kernel.h>" for printk purposes and I have also removed "#incude <linux/config.h> which was not necessary for me.
I also look about "Migrating device drivers to Linux kernel 2.6" and your code seems to be good. So the question is: do you have already had such behaviour with other modules with your 2.6 kernel? (I suppose the answer is no, but we never know) the last advice I can give you to debug it is to use UML (User Mode Linux of course :) ) |
All times are GMT -5. The time now is 05:44 AM. |