Android WifiP2PManager API crashes wpa_supplicant

Which version of system do you use? Khadas official images, self built images, or others?

Using Android 11 official image for VIM4: vim4-android-11-64bit-v220826.img.xz

Please describe your issue below:

We have an Android application signed with AOSP platform signature to get system permissions for P2P APIs.

When using Android Java WifiP2PManager API wpa_supplicant crashes and Wifi is disconnected. We can see Wifi setting disabled.

Post a console log of your issue below:

2023-02-01 10:28:24.577  4703-4703  MyWifiP2PService  		com.company.wifip2papp               I  setWFDInfo succeeded: mWfdEnabled=true, mWfdEnabling=false
2023-02-01 10:28:24.577  4703-4703  MyWifiP2PService  		com.company.wifip2papp               I  action: android.net.wifi.p2p.THIS_DEVICE_CHANGED
2023-02-01 10:28:24.578  4703-4703  MyWifiP2PService  		com.company.wifip2papp               I  this device name: VIM4
2023-02-01 10:28:24.578  4703-4703  MyWifiP2PService  		com.company.wifip2papp               I  this device isWfdEnabled: true
2023-02-01 10:28:24.578  4703-4703  MyWifiP2PService  		com.company.wifip2papp               I  this device type: 1
2023-02-01 10:28:24.578   668-757   SupplicantP2pIfaceHal   system_process                       D  entering find(120)
2023-02-01 10:28:24.578  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: P2P: Use 500 ms search delay due to concurrent operation on interface wlan0
2023-02-01 10:28:24.578  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: Starting find (type=0)
2023-02-01 10:28:24.578  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: p2p_scan is already running
2023-02-01 10:28:24.578  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: Clear timeout (state=SEARCH)
2023-02-01 10:28:24.578  1452-1452  wpa_supplicant          wpa_supplicant                       D  wpa_driver_set_ap_wps_p2p_ie: Entry
2023-02-01 10:28:24.578  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: State SEARCH -> SEARCH
2023-02-01 10:28:24.578  1452-1452  wpa_supplicant          wpa_supplicant                       I  p2p-dev-wlan0: P2P: Reject scan trigger since one is already pending
2023-02-01 10:28:24.578  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: Failed to start p2p_scan - another p2p_scan was already running
2023-02-01 10:28:24.579   668-757   SupplicantP2pIfaceHal   system_process                       D  find(120) completed successfully.
2023-02-01 10:28:24.579   668-757   SupplicantP2pIfaceHal   system_process                       D  leaving find(120)
2023-02-01 10:28:24.579   668-757   WifiAsyncC...P2pService system_process                       D  replyToMessage replyToMessage recvdMessage=139265 sendingUid=10071 sentMessage=139267
2023-02-01 10:28:24.579  4703-4703  MyWifiP2PService  		com.company.wifip2papp               D  discoverPeers() succeeded
2023-02-01 10:28:24.643   860-860   ThermalService          com.droidlogic                       I  CPU temperatures: [59.100002]
2023-02-01 10:28:24.860   393-1448  android.ha...droidlogic and...etooth@1.0-service-droidlogic  I  wole_config_cback, status = 0, opcode=0xfe54
2023-02-01 10:28:25.197   492-513   RIL RILU                rild                                 D  find_pci_device is 0
2023-02-01 10:28:25.197   492-513   RIL RILU                rild                                 E  cannot find ttyname for AT Port
2023-02-01 10:28:25.197   492-513   RIL RILC                rild                                 D  USB can't find at device
2023-02-01 10:28:25.240   399-931   gps_ql                  android.hardware.gnss@1.0-service    D  Error connecting rild-nmea (Connection refused)
2023-02-01 10:28:25.240   399-931   gps_ql                  android.hardware.gnss@1.0-service    D  fail to open GPS channel <rild-nmea>!
2023-02-01 10:28:25.242  2752-2752  HidlServiceManagement   com.android.phone                    W  Waited one second for android.hardware.radio@1.1::IRadio/slot1
2023-02-01 10:28:25.242   281-281   hwservicemanager        hwservicemanager                     I  Since android.hardware.radio@1.1::IRadio/slot1 is not registered, trying to start it as a lazy HAL.
2023-02-01 10:28:25.242  2752-2752  HidlServiceManagement   com.android.phone                    I  getService: Trying again for android.hardware.radio@1.1::IRadio/slot1...
2023-02-01 10:28:25.243   281-4952  libc                    hwservicemanager                     W  Unable to set property "ctl.interface_start" to "android.hardware.radio@1.1::IRadio/slot1": error code: 0x20
2023-02-01 10:28:25.661   393-1448  android.ha...droidlogic and...etooth@1.0-service-droidlogic  I  wole_config_cback, status = 0, opcode=0xfe54
2023-02-01 10:28:26.240   399-931   gps_ql                  android.hardware.gnss@1.0-service    D  Error connecting rild-nmea (Connection refused)
2023-02-01 10:28:26.240   399-931   gps_ql                  android.hardware.gnss@1.0-service    D  fail to open GPS channel <rild-nmea>!
2023-02-01 10:28:26.243  2752-2752  HidlServiceManagement   com.android.phone                    W  Waited one second for android.hardware.radio@1.1::IRadio/slot1
2023-02-01 10:28:26.243   281-281   hwservicemanager        hwservicemanager                     I  Since android.hardware.radio@1.1::IRadio/slot1 is not registered, trying to start it as a lazy HAL.
2023-02-01 10:28:26.243  2752-2752  HidlServiceManagement   com.android.phone                    I  getService: Trying again for android.hardware.radio@1.1::IRadio/slot1...
2023-02-01 10:28:26.243   281-4954  libc                    hwservicemanager                     W  Unable to set property "ctl.interface_start" to "android.hardware.radio@1.1::IRadio/slot1": error code: 0x20
2023-02-01 10:28:26.343   554-554   wificond                wificond                             E  Failed to get interface index from scan result notification
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  nl80211: Drv Event 34 (NL80211_CMD_NEW_SCAN_RESULTS) received for p2p-dev-wlan0
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: nl80211: New scan results available
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  nl80211: Scan probed for SSID 'DIRECT-'
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  nl80211: Scan included frequencies: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 5180 5200 5220 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660 5680 5700 5720 5745 5765 5785 5805 5825
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: Event SCAN_RESULTS (3) received
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: Scan completed in 1.768810 seconds
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  nl80211: Received scan results (1 BSSes)
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: BSS: Start scan result update 9
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  BSS: last_scan_res_used=1/64
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: Radio work 'p2p-scan'@0xb4000079cedac550 done in 1.773259 seconds
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: radio_work_free('p2p-scan'@0xb4000079cedac550): num_active_works --> 0
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: Scan results received (1 BSS)
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: Ignore old scan result for 00:78:88:e8:8e:5d (rx_time=371.080804 find_start=499.943152)
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: State SEARCH -> SEARCH
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: Starting short listen state (state=SEARCH)
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  WPS:  * Version (hardcoded 0x10)
2023-02-01 10:28:26.343  1452-1452  wpa_supplicant          wpa_supplicant                       D  WPS:  * UUID-E
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  WPS:  * Version2 (0x20)
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: * P2P IE header
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: * Capability dev=25 group=00
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  P2P: * Device Info
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: Add radio work 'p2p-listen'@0xb4000079cedac550
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: First radio work item in the queue - schedule start immediately
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  wlan0: Updating scan results from sibling
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  nl80211: Received scan results (1 BSSes)
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  nl80211: Scan results indicate BSS status with 00:78:88:e8:8e:5d as associated
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  wlan0: BSS: Start scan result update 9
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  BSS: last_scan_res_used=1/64
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  p2p-dev-wlan0: Starting radio work 'p2p-listen'@0xb4000079cedac550 after 0.000245 second wait
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  wpa_driver_set_ap_wps_p2p_ie: Entry
2023-02-01 10:28:26.344  1452-1452  wpa_supplicant          wpa_supplicant                       D  Re-routing DRIVER cmd to parent iface
2023-02-01 10:28:26.344  1452-1452  libc                    wpa_supplicant                       A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x2 in tid 1452 (wpa_supplicant), pid 1452 (wpa_supplicant)
2023-02-01 10:28:26.359  4957-4957  crash_dump64            pid-4957                             I  obtaining output fd from tombstoned, type: kDebuggerdTombstone
2023-02-01 10:28:26.359   360-360   tombstoned              tombstoned                           I  received crash request for pid 1452
2023-02-01 10:28:26.360  4957-4957  crash_dump64            pid-4957                             I  performing dump of process 1452 (target tid = 1452)
2023-02-01 10:28:26.361  4957-4957  DEBUG                   pid-4957                             A  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2023-02-01 10:28:26.361  4957-4957  DEBUG                   pid-4957                             A  Build fingerprint: 'OnePlus/OnePlus6/OnePlus6:8.1.0/OPM1.171019.011/06140300:user/release-keys'
2023-02-01 10:28:26.361  4957-4957  DEBUG                   pid-4957                             A  Revision: '0'
2023-02-01 10:28:26.361  4957-4957  DEBUG                   pid-4957                             A  ABI: 'arm64'
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A  Timestamp: 2023-02-01 09:28:26+0000
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A  pid: 1452, tid: 1452, name: wpa_supplicant  >>> /vendor/bin/hw/wpa_supplicant <<<
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A  uid: 1010
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A  signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x2
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A  Cause: null pointer dereference
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      x0  0000000000000001  x1  0000007ff9c26bf0  x2  0000000000000002  x3  0000000000000003
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      x4  0000007ff9c26c40  x5  0000000000000020  x6  fefeff6462606568  x7  7f7f7f7f7f7f7f7f
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      x8  b400007adeda7010  x9  7daa25951ce2fa75  x10 0000007ff9c26c48  x11 fffffffffffffffd
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      x12 0000007ff9c26d60  x13 0000000000000026  x14 0000007bffc53d22  x15 ffffffffffffffff
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      x16 0000007bff399540  x17 0000007bffc32fb0  x18 0000007c0042e000  x19 b4000079feda5e50
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      x20 b400007a7edab3c0  x21 b4000079feda5e50  x22 00000000000000ab  x23 b4000079eedac3d0
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      x24 0000000000000002  x25 0000007bfffd3000  x26 0000007ff9c27430  x27 0000007ff9c274e8
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      x28 0000005cfc70f120  x29 0000007ff9c27460
2023-02-01 10:28:26.362  4957-4957  DEBUG                   pid-4957                             A      lr  0000005cfc6c5538  sp  0000007ff9c273a0  pc  0000005cfc6c5550  pst 0000000060000000
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A  backtrace:
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A        #00 pc 000000000022c550  /vendor/bin/hw/wpa_supplicant (wpa_driver_nl80211_driver_cmd+524) (BuildId: 65e77ca902bb19310be6c94022dd7aec)
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A        #01 pc 000000000022cb9c  /vendor/bin/hw/wpa_supplicant (wpa_driver_set_ap_wps_p2p_ie+256) (BuildId: 65e77ca902bb19310be6c94022dd7aec)
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A        #02 pc 000000000011e800  /vendor/bin/hw/wpa_supplicant (wpas_start_listen_cb+104) (BuildId: 65e77ca902bb19310be6c94022dd7aec)
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A        #03 pc 00000000001f6c58  /vendor/bin/hw/wpa_supplicant (radio_start_next_work+312) (BuildId: 65e77ca902bb19310be6c94022dd7aec)
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A        #04 pc 00000000000d7cd8  /vendor/bin/hw/wpa_supplicant (eloop_run+1248) (BuildId: 65e77ca902bb19310be6c94022dd7aec)
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A        #05 pc 00000000001f8b0c  /vendor/bin/hw/wpa_supplicant (wpa_supplicant_run+120) (BuildId: 65e77ca902bb19310be6c94022dd7aec)
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A        #06 pc 0000000000209510  /vendor/bin/hw/wpa_supplicant (main+964) (BuildId: 65e77ca902bb19310be6c94022dd7aec)
2023-02-01 10:28:26.377  4957-4957  DEBUG                   pid-4957                             A        #07 pc 000000000004988c  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: 49090ae59e6ae37f8beae53c551820ad)
2023-02-01 10:28:26.397  4957-4957  crash_dump64            pid-4957                             I  type=1400 audit(0.0:805): avc: denied { open } for path="/dev/__properties__/u:object_r:vendor_wifi_prop:s0" dev="tmpfs" ino=21756 scontext=u:r:crash_dump:s0 tcontext=u:object_r:vendor_wifi_prop:s0 tclass=file permissive=1
2023-02-01 10:28:26.406     0-0     [  501.780986@2]  logd  kernel                               D  logdr: UID=1010 GID=1010 PID=4957 n tail=50 logMask=8 pid=1452 start=0ns timeout=0ns
2023-02-01 10:28:26.408     0-0     [  501.782795@2]  logd  kernel                               D  logdr: UID=1010 GID=1010 PID=4957 n tail=50 logMask=1 pid=1452 start=0ns timeout=0ns
2023-02-01 10:28:26.397  4957-4957  crash_dump64            pid-4957                             I  type=1400 audit(0.0:807): avc: denied { map } for path="/dev/__properties__/u:object_r:vendor_wifi_prop:s0" dev="tmpfs" ino=21756 scontext=u:r:crash_dump:s0 tcontext=u:object_r:vendor_wifi_prop:s0 tclass=file permissive=1
2023-02-01 10:28:26.416     0-0     [  501.788078@2]  logd  kernel                               D  logdr: UID=1010 GID=1010 PID=4957 n tail=0 logMask=8 pid=1452 start=0ns timeout=0ns
2023-02-01 10:28:26.416     0-0     [  501.791943@2]  logd  kernel                               D  logdr: UID=1010 GID=1010 PID=4957 n tail=0 logMask=1 pid=1452 start=0ns timeout=0ns
2023-02-01 10:28:26.397  4957-4957  crash_dump64            pid-4957                             I  type=1400 audit(0.0:810): avc: denied { map } for path="/dev/__properties__/u:object_r:hwservicemanager_prop:s0" dev="tmpfs" ino=21683 scontext=u:r:crash_dump:s0 tcontext=u:object_r:hwservicemanager_prop:s0 tclass=file permissive=1
2023-02-01 10:28:26.421   668-847   NativeCrashListener     system_process                       W  Couldn't find ProcessRecord for pid 1452
2023-02-01 10:28:26.422   360-360   tombstoned              tombstoned                           E  Tombstone written to: /data/tombstones/tombstone_08
2023-02-01 10:28:26.422     0-0     [  501.800360@7]  init  kernel                               I  Untracked pid 4957 exited with status 0
2023-02-01 10:28:26.424   668-701   BootReceiver            system_process                       I  Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE)
2023-02-01 10:28:26.425   668-701   DropBoxManagerService   system_process                       I  add tag=SYSTEM_TOMBSTONE isTagEnabled=true flags=0x2
2023-02-01 10:28:26.426     0-0     [  501.801403@7]  init  kernel                               I  Untracked pid 4959 exited with status 0
2023-02-01 10:28:26.438   668-694   BroadcastQueue          system_process                       W  Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
2023-02-01 10:28:26.438   668-694   BroadcastQueue          system_process                       W  Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
2023-02-01 10:28:26.441   668-694   ActivityManager         system_process                       I  Killing 2918:com.google.android.partnersetup/u0a26 (adj 985): empty #17
2023-02-01 10:28:26.443   406-406   memtrack_aml            and...hardware.memtrack@1.0-service  D  debugfs path
2023-02-01 10:28:26.444   406-406   memtrack_aml            and...hardware.memtrack@1.0-service  D  get task_name ndroid.settings
2023-02-01 10:28:26.454   406-406   memtrack_aml            and...hardware.memtrack@1.0-service  D  debugfs path
2023-02-01 10:28:26.457   367-367   Zygote                  zygote64                             I  Process 2918 exited due to signal 9 (Killed)
2023-02-01 10:28:26.461   393-1448  android.ha...droidlogic and...etooth@1.0-service-droidlogic  I  wole_config_cback, status = 0, opcode=0xfe54
2023-02-01 10:28:26.476   406-406   memtrack_aml            and...hardware.memtrack@1.0-service  D  debugfs path
2023-02-01 10:28:26.483   406-406   memtrack_aml            and...hardware.memtrack@1.0-service  D  debugfs path
2023-02-01 10:28:26.487   668-696   libprocessgroup         system_process                       I  Successfully killed process cgroup uid 10026 pid 2918 in 45ms
2023-02-01 10:28:26.489   406-406   memtrack_aml            and...hardware.memtrack@1.0-service  D  debugfs path

Hi channel, I checked that this issue is fixed with latest official VIM4 Android image vim4-android-11-64bit-v221228.img.xz

1 Like