OSDN Git Service

android/hal: Set callbacks before initializing IPC
authorSzymon Janc <szymon.janc@tieto.com>
Mon, 28 Oct 2013 15:45:37 +0000 (16:45 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 29 Oct 2013 12:03:39 +0000 (14:03 +0200)
commit2abdd0364cbccd134f82c8180a6944e5c8a4013d
tree3441d461d4f002bf59702c4d4b7bac80ef0035e5
parentc9902d2b50b9c95f005f62092338d180b04caba1
android/hal: Set callbacks before initializing IPC

Notification thread is started on IPC init and it can be scheduled
before main thread.

Fix following crash on HAL init:

pid: 3392, tid: 3492, name: droid.bluetooth  >>> com.android.bluetooth <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000028
    eax 00000000  ebx ce047f64  ecx ce0405d0  edx f7763724
    esi cdf3af00  edi f837fb90
    xcs 00000023  xds 0000002b  xes 0000002b  xfs 00000000  xss 0000002b
    eip ce042289  ebp cdf3a9f8  esp cdf3a9e0  flags 00010292

backtrace:
    #00  pc 00003289  /system/lib/hw/bluetooth.default.so (bt_thread_associate+25)
    #01  pc 000015f8  /system/lib/hw/bluetooth.default.so (notification_handler+40)
    #02  pc 0000f804  /system/lib/libc.so (__thread_entry+276)
    #03  pc 0002999d  /system/lib/libc.so
    #04  pc 00082ae7  /system/lib/libdvm.so (dvmThreadSelf()+39)
    #05  pc 00010db9  /system/lib/libc.so (pthread_mutex_unlock+25)
android/hal-bluetooth.c