Thursday 31 January 2019

Binder driver protocol does not match user space protocol

After updating my Kernel 4.4 branch and also Android repo syncing of Nougat I started getting Binder driver protocol does not match user space protocol.

Log of my work follows:

  1. Updating kernel headers in bionic is the first step which was highlighted in my previous post
  2. Next I started snooping around and found that frameworks/libs/binder/ProcessState.cpp checks the version and then fails
  3. I wrote a simple C program to check what version the binder driver and the ioctl responds with Version 8
  4. Next I check the kernel headers and find that there is a version switch when BINDER_IPC_32BIT is defined or something else possibly BINDER_IPC_64BIT Ref: https://elixir.bootlin.com/linux/v4.4/source/include/uapi/linux/android/binder.h#L43 and https://elixir.bootlin.com/linux/v4.4/source/include/uapi/linux/android/binder.h#L94
  5. Changed it in the source external/kernel-headers/original/....../binder.h and commented out the BINDER_IPC_32BIT and kept only the 64 bit. This is because the kernel has moved on to 64 bit and there is no support for 32 bit. Due to this the KConfig variable is removed. I have still experiment by manually modifying the .config variable
  6. Ran tools/update_all.py and finally rebuilt the whole AOSP. 
These steps finally  fixed all the issues related to binder.

Next step is to fix the hwcomposer not found issue. Let us see how that goes.

No comments:

Post a Comment