OPTEE + Android 8

Hi Victor ,
I created a new stack all-together , enabled PRODUCT_FULL_TREBLE_OVERRIDE := true in device/linaro/hikey/hikey.mk.
Still same issue

Parsing out/target/product/hikey/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_policy_raw.cil
[ 45% 34203/75024] build out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy
FAILED: out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy 
/bin/bash -c "(out/host/linux-x86/bin/secilc -M true -G -c 30 out/target/product/hikey/obj/ETC/plat_sepolicy.cil_intermediates/plat_sepolicy.cil out/target/product/hikey/obj/ETC/26.0.cil_intermediates/26.0.cil out/target/product/hikey/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil -o out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy.tmp -f /dev/null ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy.tmp permissive > out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ]; then 		echo \"==========\" 1>&2; 		echo \"ERROR: permissive domains not allowed in user builds\" 1>&2; 		echo \"List of invalid domains:\" 1>&2; 		cat out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains 1>&2; 		exit 1; 		fi ) && (mv out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy.tmp out/target/product/hikey/obj/ETC/sepolicy_intermediates/sepolicy )"
neverallow check failed at out/target/product/hikey/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil:2477
  (neverallow base_typeattr_55_26_0 base_typeattr_56_26_0 (file (execute execute_no_trans entrypoint)))
    <root>
    allow at out/target/product/hikey/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil:5777
      (allow hal_bluetooth_hikey hal_bluetooth_hikey_exec (file (read getattr execute entrypoint open)))
    <root>
    allow at out/target/product/hikey/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil:5786
      (allow hci_attach hci_attach_exec (file (read getattr execute entrypoint open)))

neverallow check failed at out/target/product/hikey/obj/ETC/plat_sepolicy.cil_intermediates/plat_sepolicy.cil:4423 from system/sepolicy/public/domain.te:672
  (neverallow base_typeattr_55 base_typeattr_56 (file (execute execute_no_trans entrypoint)))
    <root>
    allow at out/target/product/hikey/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil:5777
      (allow hal_bluetooth_hikey hal_bluetooth_hikey_exec (file (read getattr execute entrypoint open)))
    <root>
    allow at out/target/product/hikey/obj/ETC/nonplat_sepolicy.cil_intermediates/nonplat_sepolicy.cil:5786
      (allow hci_attach hci_attach_exec (file (read getattr execute entrypoint open)))

Failed to generate binary
Failed to build policydb

AOSP8+OPTEE , cool, will try later as my plate is full rught now :frowning: . Thanks for the update !!!

Thanks

Just checked with one of our android guys and PRODUCT_FULL_TREBLE_OVERRIDE is probably not supported on HiKey yet. In any case, Treble can be tested with VTS.

https://source.android.com/devices/architecture/treble#testing-treble

Thanks for the update @vchong

I am trying to create AOSP environment on hikey board similar to my customerā€™s hardware setup, so, treble is required.
Anyways, I will wait for it. I hope it would be supported in days to come.
If the Android team active on the forums ? Is it possible to contact them ?
If so , I would like to know their plans/ETA for treble option

Thanks

Hi ,
In SCREEN ON condition, when power button is pressed, screen goes off and also adb connection is lost. Means , hikey is not going to sleep mode ?

I want to control hikey board via adb commands and test my S/W
So, when I give ā€œadb shell input keyevent 26ā€ , adb connection is lost
Is there any way to avoid this ?
Need some inputs here !!!

Thanks

Hi @vchong,
I am trying to download aosp8+optee stack from the link you gave previously :

and I am facing repo sync errors.
error: Exited sync due to fetch errors

Total size came to : 26Gig
If run sync command again, size comes to 27Gig. Its been like this from 21Gig

Is this repo latest ? Repo is stable enough to download ?

Sync command I am running is : repo sync -j1 -f --force-sync

Errors appearing :
> Fetching projects: 49% (291/592) Fetching project platform/system/hardware/interfaces

Fetching project platform/frameworks/layoutlib
fatal: Couldn't find remote ref refs/tags/android-8.1.0_r14
Unexpected end of command stream
fatal: Couldn't find remote ref refs/tags/android-8.1.0_r14
Unexpected end of command stream
error: Cannot fetch platform/frameworks/layoutlib
warn: --force-broken, continuing to sync
Fetching project platform/external/regex-re2

Thanks

It was updated to 8.1.0_r14 recently and worked for me. Did you try from the very beginning, i.e. repo init ..?

Ok. I donā€™t see an r14 tag for platform/frameworks/layoutlib. Will try to investigate. In the meantime, please continue to use r7 for now.

ok.
and i believe only thing to change is in ā€œgit initā€ command :
android-8.1.0_r14 - > android-8.1.0_r7

and remaining parts are same ā€¦ right ?

Thanks

and remaining parts are same ā€¦ right ?

Right

Hi @vchong,
I can successfully compile using r7 , and flashed the hikey board with image.
But , the image is not stable.

When I do some UI operations like open settings/audio app etc, after some time, screen goes blank, ANDROID boot logo appears (its not a complete reboot), and home screen appears.
Thereā€™s a crash :

--------- beginning of crash
01-01 00:02:53.269 2022 2028 F libc : Invalid address 0x75ffffffff passed to free: value not allocated
01-01 00:02:53.270 2022 2028 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 2028 (ReferenceQueueD), pid 2022 (system_server)
01-01 00:02:53.304 2022 2980 E UserRestrictionsUtils: Unknown restriction: null

Complete Log : [15:45:32]viswanath@[~/.../sw]$ adb logcat --------- beginning of main01-0 - Pastebin.com

Can you pls check if thereā€™s already a fix for this ?

Thanks

HI, @deepakmnvl

There is a similar problem reported here: https://issuetracker.google.com/issues/71421054

but I am still not able to find the root cause for it yet.
If you have any new findings on it, please share with me.

Thanks,
Yongqin Liu

So , seems there is an issue indeed !!!

@vchong, does similar issue exist in r14 too ?
If not, can you pls fix the tag issue

Thanks

@deepakmnvl I donā€™t know. @liuyq have you tried r14? In any case, the r14 tag issue has been fixed, but weā€™re currently experiencing xtest errors. You can still test it against the stability issue though if you wish.

@deepakmnvl @vchong
The same problem exists with r14 too.

Thanks,
Yongqin Liu

itsnt there any work around for this ?
Even a rough patch is enough for me, as I am working on a local engineering setup !!!

@liuyq , have seen your comment in issue tracker, can you pls post your changes

yo...@linaro.org <yo...@linaro.org> #3 Jan 9, 2018 02:02PM
With some changes on luni/src/main/java/libcore/util/NativeAllocationRegistry.java, I am not able to reproduce the UI problem,
but the change is obviously not right, it only makes the referent not garbage collected, so that the freeFunction is not called I think.

It looks like related to ./luni/src/main/java/java/nio/charset/CharsetEncoderICU.java,but still not able to find the root cause yet.

Thanks

@deepakmnvl
You could use the NativeAllocationRegistry-no-crash.patch attached in the #comment.
https://issuetracker.google.com/issues/71421054#comment3

Or use the hack workaround here:
https://android-review.linaro.org/#/c/18093/1/icu4c/source/common/ucnv_bld.h

just doing below change :
ucnv_bld.h: add 3 pointer type fields for UConverter struct to workaround the crash problem when debug fs enabled for others !!!

Strange , will make this change and verify , thanks

@liuyq
this worked : You could use the NativeAllocationRegistry-no-crash.patch attached in the #comment.
https://issuetracker.google.com/issues/71421054#comment3

this didnt : Or use the hack workaround here:
https://android-review.linaro.org/#/c/18093/1/icu4c/source/common/ucnv_bld.h

Thanks for the patch :relieved:

@deepakmnvl

Thanks very much for the feedback.

For the workaround with ucnv_bld.h, one problem I got with it is that the problem might happened in the 2nd boot.
If possible, could you please share me whatā€™s problem you had with it?
just want to collect more information about this problem.

Thanks,
Yongqin Liu

@liuyq ,
With ucnv_bld.h change, crash logs were pretty much same.
And I think the crash was there in 1st boot too. or I didnt observe it correctly.

I then applied native allocation patch , and crash wasnā€™t there
Then , I removed ā€œucnv_bld.h changeā€ and UI is stable enough for me to work with !!!

HTH,
Thanks