Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.system > #480

Re: unable to "rmmod" the module

From "Mark" <mark_cruzNOTFORSPAM@hotmail.com>
Newsgroups comp.os.linux.embedded, comp.unix.programmer, comp.os.linux.development.system
Subject Re: unable to "rmmod" the module
Date 2012-12-14 08:20 -0500
Organization Aioe.org NNTP Server
Message-ID <kaf93o$3ue$1@speranza.aioe.org> (permalink)
References <kaamnd$6id$1@speranza.aioe.org>

Cross-posted to 3 groups.

Show all headers | View raw


Following up with my initial question -- the daemon opens 3 netlink sockets 
in to the kernel module and polls one of it. The main problem here is that 
the number of references to the module, i.e. how many processes are using 
the module (the 3rd field of /proc/net/modules), isn't zero and thus the 
module can't be unloaded.

Here is interesting part: before running the damon, the reference counter is 
rightfuly 0, after the daemon has been launched, the counter goes up to 6, 
although I'd expect just 3 given that it opens three sockets. So, after 
killing the damon, the counter goes down to 3, and thus the module can't be 
unloaded.

Are there any ways to catch what other descriptors etc. being kept open?

Thanks !


"Mark" <mark_cruzNOTFORSPAM@hotmail.com> wrote in message 
news:kaamnd$6id$1@speranza.aioe.org...
> Hello,
>
> I'm working with a large embedded software (ARM processor, embedded linux 
> 2.6.31, busybox) involving both kernel and user space code. There's a 
> kernel module normally loaded first, and daemon establishing netlink 
> socket with the module.
>
> The issue here is that after killing the daemon, I'm no longer able to 
> unload the module from the memory:
>
> % rmmod _module.ko
> % rmmod: _module.ko: Resource temporarily unavailable
> Analysis has shown that error (return value is -11, i.e. EAGAIN ?) is 
> returned by try_stop_module() invoked in syscall delete_module() 
> definition in kernel/module.c. Function try_stop_module() in turn calls 
> stop_machine() and this is where I've stuck, as I'm not sure what's 
> exactly happening there. I think the root cause is somewhere in the daemon 
> that opens connections to the module and obviously something else and 
> doesn't correctly close/clean-up on exit (apparently some references/locks 
> are not released?)

Mark

Back to comp.os.linux.development.system | Previous | Next | Find similar


Thread

Re: unable to "rmmod" the module "Mark" <mark_cruzNOTFORSPAM@hotmail.com> - 2012-12-14 08:20 -0500

csiph-web