On Tue, 13 Nov 2001, Der Herr Hofrat wrote: > > I inserted a self made module called 'tt_mod' into rtlinux and when I > > tried to remove it, I got a segmentation fault. I did an lsmod and got > > this: > > > > Module Size Used by > > rtl_fifo 9792 0 (unused) > > tt_mod 0 0 (deleted) > > this means that rmmod called your cleanup_module function and this function > returned with an error -> kernel/module.c in free_module()
Actually no. Actually cleanup_module is a void function. Really the module-cleaning-thread died in the kernel (meaning basically inside the delete_module() system call that rmmod uses) due to probably an attempt to dereference NULL or some other invalid memory address. The kernel then reacted by nixxing the whole thread, thus leaving the module's state in the very impossible-to-get-out-of 'deleted' state. This was most likely caused by a pointer bug in the module's own cleanup code. > as your cleanup_module failed the module not removed from the kernels module > list - as this module list includes references to the modules that reference > this module aswell as those that are used by this module the other modules > also can't be removed as they are still "in use" . True, true. > > the only way out is a reboot and check your cleanu_module function. Actually, it would be a cool exercise to write a module-cleaner-module as a hack that basically undoes the kernel module structures and kfree's the memory taken up by a module in the 'deleted' state. However such a hack has stability implications as if that module did anything non-trivial with any other kernel data structures.. VERY BAD THINGS CAN HAPPEN. :) > > hofrat > -- [rtl] --- > To unsubscribe: > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR > echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] > -- > For more information on Real-Time Linux see: > http://www.rtlinux.org/ > -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/
