[Interest] QtBluetoothSocket write() crashes on Android after sending a few messages

Krzysztof Lesiak wave.dev at hotmail.com
Tue Apr 18 18:33:22 CEST 2017


Alright, since my responses didn't go to the mailing list but to Thiago directly, I'm posting them here once again.


Here's the crash log from logcat:

04-03 11:03:29.598 31623 31643 F libc    : Fatal signal 7 (SIGBUS), code 2, fault addr 0x9ef84000 in tid 31643 (QtThread)
04-03 11:03:29.703   468   468 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-03 11:03:29.703   468   468 F DEBUG   : CM Version: '13.1.4-ZNH2KAS5FE-paella'
04-03 11:03:29.703   468   468 F DEBUG   : Build fingerprint: 'bq/Aquaris_X5/Aquaris_X5:6.0.1/MHC19Q/ZNH2KAS5FE:user/release-keys'
04-03 11:03:29.703   468   468 F DEBUG   : Revision: '0'
04-03 11:03:29.703   468   468 F DEBUG   : ABI: 'arm'
04-03 11:03:29.703   468   468 F DEBUG   : pid: 31623, tid: 31643, name: QtThread  >>> net.armsofsorrow.expressionist <<<
04-03 11:03:29.703   468   468 F DEBUG   : signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x9ef84000
04-03 11:03:29.726   468   468 F DEBUG   :     r0 9ef6776c  r1 00000000  r2 00004b44  r3 9ef83ff0
04-03 11:03:29.727   468   468 F DEBUG   :     r4 9ef6776c  r5 9ef676f0  r6 b3f96309  r7 9ef677d0
04-03 11:03:29.727   468   468 F DEBUG   :     r8 00000000  r9 9ef67700  sl b8c72298  fp 9ef6776c
04-03 11:03:29.727   468   468 F DEBUG   :     ip 00000000  sp 9ef67688  lr b5bfbc9d  pc b6ceadec  cpsr 28070010
04-03 11:03:29.747   468   468 F DEBUG   :
04-03 11:03:29.747   468   468 F DEBUG   : backtrace:
04-03 11:03:29.748   468   468 F DEBUG   :     #00 pc 00016dec  /system/lib/libc.so (memset+48)
04-03 11:03:29.748   468   468 F DEBUG   :     #01 pc 00009c99  /system/lib/libunwind.so (_Uarm_local_access_addr_space_init+8)
04-03 11:03:29.748   468   468 F DEBUG   :     #02 pc 000091b7  /system/lib/libunwind.so
04-03 11:03:29.748   468   468 F DEBUG   :     #03 pc 00002b5f  /system/lib/libunwind.so (unw_map_local_create+30)
04-03 11:03:29.748   468   468 F DEBUG   :     #04 pc 0000501f  /system/lib/libbacktrace.so (_ZN14UnwindMapLocal5BuildEv+4)
04-03 11:03:29.748   468   468 F DEBUG   :     #05 pc 000050c1  /system/lib/libbacktrace.so (_ZN12BacktraceMap6CreateEib+64)
04-03 11:03:29.748   468   468 F DEBUG   :     #06 pc 00003311  /system/lib/libbacktrace.so (_ZN9BacktraceC1EiiP12BacktraceMap+40)
04-03 11:03:29.748   468   468 F DEBUG   :     #07 pc 0000335d  /system/lib/libbacktrace.so (_ZN9Backtrace6CreateEiiP12BacktraceMap+60)
04-03 11:03:29.748   468   468 F DEBUG   :     #08 pc 0035a3f1  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_9ArtMethodEPv+112)
04-03 11:03:29.748   468   468 F DEBUG   :     #09 pc 0033af87  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+138)
04-03 11:03:29.748   468   468 F DEBUG   :     #10 pc 0024de23  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+750)
04-03 11:03:29.748   468   468 F DEBUG   :     #11 pc 0024e4c7  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+54)
04-03 11:03:29.748   468   468 F DEBUG   :     #12 pc 000fbc9d  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+28)
04-03 11:03:29.748   468   468 F DEBUG   :     #13 pc 00100aa3  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+4894)
04-03 11:03:29.749   468   468 F DEBUG   :     #14 pc 0010a6d5  /system/lib/libart.so (_ZN3art8CheckJNI17NewPrimitiveArrayEPKcP7_JNIEnviNS_9Primitive4TypeE+364)
04-03 11:03:29.749   468   468 F DEBUG   :     #15 pc 00067400  /data/app/net.armsofsorrow.expressionist-1/lib/arm/libQt5Bluetooth.so
04-03 11:03:30.203   468   468 F DEBUG   :
04-03 11:03:30.203   468   468 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_00


I didn't manage to get any meaningful stack trace when debugging with QtCreator; it reports a SIGSEGV and drops down to disassembly without a trace.



________________________________
From: Krzysztof Lesiak <wave.dev at hotmail.com>
Sent: Monday, April 17, 2017 11:17 PM
To: Thiago Macieira
Subject: Re: [Interest] QtBluetoothSocket write() crashes on Android after sending a few messages

I remember having the same problem with an older device with the app running on dalvik. However, I don't have it anymore and thus, can't get any meaningful output.

Is there something I can do to get a more precise trace to find out where that abort is coming from (or whatever else that could help in this case)?
On Apr 18, 2017 1:07 AM, Thiago Macieira <thiago.macieira at intel.com> wrote:

Java does, but this isn't Java.  This is a C++ library, whose purpose happens
to be to run a Java VM.

It looks like the Qt code caused an abort (frame #12 is
art::ScopedCheck::AbortF), and when trying to do a stack dump, ART crashed.
It's a double fault.

On segunda-feira, 17 de abril de 2017 16:04:09 PDT Krzysztof Lesiak wrote:
> Doesn't java usually throw exceptions, though, instead of segfaulting? Could
> it be some error inside the JNI wrapper code?

> Also, I've noticed that the crash always happens after the same number of
> iterations (I think it was 1620), which is particularly weird, but that
> actually allowed me to reliably step into the sources.
> On Apr 18, 2017
> 12:53 AM, Thiago Macieira <thiago.macieira at intel.com> wrote:
> On segunda-feira, 17 de abril de 2017 15:49:22 PDT Krzysztof Lesiak wrote:
>
> > It's never reported, neither in logcat, nor in the debugger. When I step
> > through the sources, the crashing line is in
> > QBluetoothSocketPrivate::writeData (qbluetoothsocket_android.cpp, line
> > 628)
>
> >
> >
> > "outputStream.callMethod<void>("write", "([BII)V", nativeData, 0,
> > (qint32)maxSize);"
> >
> >
> >
> >
> > This goes down into QAndroidJniObject template instances and crashes
> > somewhere inside there, which goes beyond my current understanding.
>
>
> Mine too. I haven't done Java since the mid-1990s.
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>


--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170418/c1d93a6d/attachment.html>


More information about the Interest mailing list