Open GoogleCodeExporter opened 8 years ago
Bisecting this issue, I see that snapshot 20 still works, but snapshot 23 does
not. I
cannot test in-between versions, as they are not available. Checking out r2850
(which
should be the sources for snapshot 20), as well as trying to build from the
snapshot
20 sources.tar.gz does not fix the issue. To me, it appears as if the packaged
sources
were not exactly the sources the snapshot was built from.
Original comment by johannes.schindelin
on 24 May 2010 at 11:51
Okay, I had an idea. I put the libbluecove.so of snapshot 20 into the .jar of
snapshot 23. And all of a sudden it worked! A little disassembly later, it
appears
that all that changed was the order of the local variables on the stack.
As you might have guessed, the issue is uninitialized memory: In line 45 of
bluecove-
gpl/src/main/c/BlueCoveBlueZ_L2CAP.c, a struct sockaddr_l2 is declared, but
never
initialized to 0. family, psm and bdaddr are subsequently set, but cid is left
as-is.
The safe way is to memset() it to 0, which is what I did in this patch (along
with a
few other places where I deemed it safer to memset() than rely on all the
fields
being set properly:
http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?
p=bluecove/.git;a=commitdiff_plain;h=c8dc4cb7a0aafbb23793164335294a81fdfcdd2e
Original comment by johannes.schindelin
on 24 May 2010 at 12:27
Thanks Johannes
I applied the suggested changes. As well the same to RFCOMM code.
In GPL and BlueZ Dbus versions.
Once we made a new build somebody needs to confirm that this fixed the problem!
Original comment by skarzhev...@gmail.com
on 24 May 2010 at 6:00
Just let me know, I'll test at once. Thank you for applying the patch!
Original comment by johannes.schindelin
on 24 May 2010 at 9:11
Original issue reported on code.google.com by
Andrew....@gmail.com
on 1 Mar 2010 at 4:38