Crash when using Bluetooth
Kate Alhola
kate.alhola at gmail.com
Wed Dec 26 15:36:21 UTC 2012
On 13.12.2012, at 16.41, Dominique Rety <dominiquerety at hotmail.fr> wrote:
> Hi,
>
> I am currently developing a telecommunication project involving Blutooth communication between Android devices. For this purpose, I'm trying to use Necessitas Bluetooth support and I experiment very similar problems that are described in the "Crash when using Bluetooth" (Kate Alhola) archive thread.
>
There is several issues in current necessitas libQtConnectivity version. I have hopefully fixed most of them and i have version of libQtConnectivity that least works with my own applocation. I try to deliver patches to necessitas project so that fixes could be included in next release.
> Environment:
> Java JDK 1.7.0_09
> Qt Creator 2.5.83 Based on Qt 4.8.3 running on Linux Suze
> Kit = Necessitas Qt 4.8.2 for Android armv7a
> Compiler = Android GCC (arm-4.4.3)
> Android target SDK = android-16
> Deploy to Nexus 7 with Android version 4.2.
>
> I firstly tried to deploy the btchat sample and I faced the same problem:
> JNI ERROR (app bug): accessed stale local reference 0xe680001d (index 7 in a table of size 4)
> VM aborting
> Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 13965 (.example.btchat)
>
> Setting traces in different source files of the connectivity library, I also noticed that the error happens when trying to use some member functions of QBluetoothLocalDevice (btchat sample requests for the local device name from the main function).
>
> I tried to bypass this problem by only creating the QBluetoothLocalDevice without requesting for the device name in the btchat application. The program then starts correctly.
>
> In the btchat application, the "Connect" button calls the QBluetoothServiceDiscoveryAgent::start function. This function randomly processes the request because it relies on discoveryState and deviceAddress members, which seem not to be initialized : either the discovery process freezes or the program aborts with an error (if luckily discoveryState and deviceAddress members get consistent values). I didn't try any further investigation. It seems to me that the connectivity library is compiled with qbluetoothlocaldevice_p.cpp, which just contains empty functions for the QBluetoothLocalDevice class, instead of a customized source for Android.
>
Yes, that's case. The QBluetoothLocalDevice initializes static handles to java virtual machine that are then referenced by other modules. I have made fixes to several parts of libQtConnectivity
> Is Bluetooth support for Android in Necessitas complete ?
Most of, some functions are still missing but there are some bugs in current version
> Is the btchat sample expected to work properly with Android ?
I have not tried that one
> Is there any specific configuration issue I could miss ?
That's good question, what is origin of the bugs, does it work with older android
Versions ? The source reason of bugs is JNI handles alocation that conflict with
Current thread structure and some that handles are expired when used. I have only tested with
Android 4.x
> Is there any corrective or complement software I could download ?
I could make my patches avaiable before next release but overriding default necessitas libQtConnectivity requires some tricks
> How can I progress on this issue ? What is the best way to get help and advices ?
This list works fine.
Kate
>
> Regards,
> Dominique RETY
> dominiquerety at hotmail.fr
>
> _______________________________________________
> Necessitas-devel mailing list
> Necessitas-devel at kde.org
> https://mail.kde.org/mailman/listinfo/necessitas-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/necessitas-devel/attachments/20121226/13856266/attachment.html>
More information about the Necessitas-devel
mailing list