On Tue, 13 Nov 2001, Norm Dresner wrote: > The initial Segmentation Fault is undoubtedly due to some > unexpected operation(s) in your own module. Once that > happens during removal, the module is still in the kernel > and in the state "TERMINATING" (or "REMOVING" or something > similar). If it is in this state, it can't be removed > because its already being removed (at least the kernel > thinks so) and you can't remove the rtl_XXX modules because > they still depend on you module. > > Baring some heroic measures I won't even begin to describe > because they involve hand-modifying several kernel > structures, the only solutions to this dilemma are:
Haha that's really funny actually.. hahaha. It's true.. there's not much you can do, except MAYBE changing the state of the module and it's use count to 0 (via writing another custom module to do this.. now if THAT module also crashes you are in for a long loop of writing custom cleanup modules) so that you can attempt to remove again (but probably you will segfault in your module again anyway so you probably can't do that). Generally speaking, yeah.. follow Norm's advice and don't segfault in the kernel. This means be really safe in your cleanup_module() code.. and overall try and be a very defensive programmer, especially when you are in the kernel. -Calin > 1. Don't Segmentation Fault the cleanup function > 2. Reboot > > Norm > > ----- Original Message ----- > From: Tim Beamish <[EMAIL PROTECTED]> > To: rtlinux help <[EMAIL PROTECTED]> > Sent: Tuesday, November 13, 2001 1:47 PM > Subject: [rtl] error in removing a module > > > > 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) > > rtl_sched 27856 0 [tt_mod] > > rtl_posixio 7216 0 [rtl_fifo tt_mod] > > rtl_time 4736 0 [tt_mod rtl_sched > rtl_posixio] > > rtl 18080 0 [rtl_fifo tt_mod > rtl_sched rtl_posixio rtl_time] > > mbuff 6368 2 [tt_mod] > > es1371 28176 0 (autoclean) > > ac97_codec 8768 0 (autoclean) [es1371] > > soundcore 4048 4 (autoclean) [es1371] > > usb-uhci 22416 0 (unused) > > usbcore 29616 0 [usb-uhci] > > > > It looks like the module is still loaded so I tried to > remove it with > > rmmod and got this: > > rmmod: module tt_mod is not loaded > > > > So I tried to insert it again and I got this message: > > insmod: a module named tt_mod already exists > > > > And so I tried to remove it and I got this: > > rmmod: module tt_mod is not loaded > > > > And on and on... > > > > So I tried to stop rtlinux and got this: > > rmmod: mbuff is in use > > rmmod: rtl is in use > > rmmod: rtl_posixio is in use > > rmmod: rtl_sched is in use > > rmmod: rtl_time is in use > > > > Scheme: (-) not loaded, (+) loaded > > (+) mbuff > > (+) rtl > > (-) rtl_fifo > > (+) rtl_posixio > > (+) rtl_sched > > (+) rtl_time > > > > I can't insert tt_mod because it's already there and I > can't remove it > > because it isn't there. Now I can't even stop rtlinux as > everything > > seems to be in use. Is there a way to clean out the > loaded modules in > > rtlinux and force it to quit? > > > > Tim > > > > > > -- [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/ > -- [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/
