2004-03-07 02:34:32

by wim delvaux

[permalink] [raw]
Subject: bnep module use count ...

I have a theory about this module use count.

What is my setup.

When I insert the usb dongle, hci/sdp and pand --listen is started wating for
a connection.

Then I activate the connection on my Ipaq and notice in syslog that the
connection is request.

Pand will then create a bnep module in the kernel. This will trigger a
hotplug event causing ifup to be executed on bnep0.

So far so good.

Now I disconnect my Ipaq. (either by pand -k and kill or whatever).
This event does not get detected by anybody.

The Ipaq when it comes back will request a new session and a new handle to
bnep0 is created in the kernel (causing refcount to increase beyond the real
use count).

Once this occurs the module is no longer unloadable and actually causes the
system to hang when the usb dongle is removed !!!! A reboot is then
needed ;-((((((

WHat you think of this scenario ?

W


2004-03-07 03:03:53

by Marcel Holtmann

[permalink] [raw]
Subject: [Bluez-users] Re: bnep module use count ...

Hi Wim,

> Is there anything you want me to put in the bnep/bluetooth network module
> so that I can give you more info ? E.g where is the reference counting
> mantained (dev->refcnt is apparently the field but I cannot seem to find the
> ++ for it)
>
> I just did a normal connect/disconnect (not suspend) and then did a pand -l
> and all connections are gone ...

at the moment I have no idea where to start. Play a little bit with it.

> I also added this line to the listen loop. It reads the pids of children
> processes so you have no more ghost apps.
>
> while( waitpid( -1, 0, WNOHANG) > 0 ) ;

Send me a patch against the CVS code.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2004-03-07 03:00:04

by wim delvaux

[permalink] [raw]
Subject: Re: bnep module use count ...

> this can be possible, but I can't tell you anything without more
> information. Last time I check the reference counting it was working
> perfect for all upper L2CAP modules. Maybe there is a problem in the
> BNEP module or in the network layer.

Is there anything you want me to put in the bnep/bluetooth network module
so that I can give you more info ? E.g where is the reference counting
mantained (dev->refcnt is apparently the field but I cannot seem to find the
++ for it)

I just did a normal connect/disconnect (not suspend) and then did a pand -l
and all connections are gone ...

I also added this line to the listen loop. It reads the pids of children
processes so you have no more ghost apps.

while( waitpid( -1, 0, WNOHANG) > 0 ) ;

W

2004-03-07 02:40:14

by Marcel Holtmann

[permalink] [raw]
Subject: [Bluez-users] Re: bnep module use count ...

Hi Wim,

> I have a theory about this module use count.
>
> What is my setup.
>
> When I insert the usb dongle, hci/sdp and pand --listen is started wating for
> a connection.
>
> Then I activate the connection on my Ipaq and notice in syslog that the
> connection is request.
>
> Pand will then create a bnep module in the kernel. This will trigger a
> hotplug event causing ifup to be executed on bnep0.
>
> So far so good.
>
> Now I disconnect my Ipaq. (either by pand -k and kill or whatever).
> This event does not get detected by anybody.
>
> The Ipaq when it comes back will request a new session and a new handle to
> bnep0 is created in the kernel (causing refcount to increase beyond the real
> use count).
>
> Once this occurs the module is no longer unloadable and actually causes the
> system to hang when the usb dongle is removed !!!! A reboot is then
> needed ;-((((((
>
> WHat you think of this scenario ?

this can be possible, but I can't tell you anything without more
information. Last time I check the reference counting it was working
perfect for all upper L2CAP modules. Maybe there is a problem in the
BNEP module or in the network layer.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users