2008-03-19 16:03:21

by 이주영

[permalink] [raw]
Subject: [Bluez-devel] I've found a bug in sdp_cstate_get() function.

Hi,

I've found a bug in sdp_cstate_get() function.
(bluez-utils/dist/sdpd/request.c)
-> memcpy(cstate, (sdp_cont_state_t *)pdata, sizeof(sdp_cont_state_t));
When running this code, "hcid daemon crash" occurred.(memory alignment error)
I think there's a bug with (sdp_cont_state_t *)pdata in sdp_cstate_get() function.
I fixed this code.
-> memcpy(cstate, pdata, sizeof(sdp_cont_state_t));
Now, hcid daemon doesn't die.


tkakel???? ???α?
?ȳ??ϼ???.


Attachments:
(No filename) (228.00 B)
(No filename) (164.00 B)
Download all attachments

2008-03-20 12:45:51

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] RFCOMM sockets

Hi Fabrizio,

> I have 3 embedded devices with temperature sensor. This devices are
> accessed from a pc with linux reading data with rfcomm socket, isn't
> need to make sdp query for channel because rfcomm channels are
> statically assigned (it's lab equipment).
>
> I need to read the 3 devices almost at same time and I've done a
> little
> C application using GLib IOChannels and non-blocking socket to read
> data from the devices. All works fine but if a device it's off the
> connection to the others it's slow, my impression is it waits timeout
> from the first device.
> I can understand why if I have 3 rfcomm connections issued in
> non-blocking way these influences each other.

because if you have to open ACL baseband connections, then it takes
time. Especially when they fail. The baseband connections can not be
done in parallel when it is the same host controller. You can use
hciconfig to change the page timeout.

Regards

Marcel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2008-03-20 11:22:39

by Fabrizio Guglielmino

[permalink] [raw]
Subject: [Bluez-devel] RFCOMM sockets

Hi all,
I have 3 embedded devices with temperature sensor. This devices are
accessed from a pc with linux reading data with rfcomm socket, isn't
need to make sdp query for channel because rfcomm channels are
statically assigned (it's lab equipment).

I need to read the 3 devices almost at same time and I've done a little
C application using GLib IOChannels and non-blocking socket to read
data from the devices. All works fine but if a device it's off the
connection to the others it's slow, my impression is it waits timeout
from the first device.
I can understand why if I have 3 rfcomm connections issued in
non-blocking way these influences each other.

I'm using BlueZ 3.22 on a debian 4.0 whith kernel version 2.6.22

Thanks

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2008-03-19 16:47:11

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] I've found a bug in sdp_cstate_get() function.

Hi,

> I've found a bug in sdp_cstate_get() function.
> (bluez-utils/dist/sdpd/request.c)
> -> memcpy(cstate, (sdp_cont_state_t *)pdata,
> sizeof(sdp_cont_state_t));
> When running this code, "hcid daemon crash" occurred.(memory
> alignment error)
>
> I think there's a bug with (sdp_cont_state_t *)pdata in
> sdp_cstate_get() function.
> I fixed this code.
> -> memcpy(cstate, pdata, sizeof(sdp_cont_state_t));
> Now, hcid daemon doesn't die.
>

which version? This should have been fixed by now. Either in the
latest bluez-utils-3.28 or the CVS.

Regards

Marcel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel