rmmod segfaulting and causing lsmod to hang withh 2.6.3 kernel
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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 )
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.