Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oculus Go font loading SEGV #949

Closed
avaer opened this issue Apr 19, 2019 · 5 comments · Fixed by #956
Closed

Oculus Go font loading SEGV #949

avaer opened this issue Apr 19, 2019 · 5 comments · Fixed by #956
Labels
bug Something isn't working

Comments

@avaer
Copy link
Member

avaer commented Apr 19, 2019

Loading <canvas> 2D bootstraps the font system in Skia, which tries to load default system fonts. This fails on Oculus Go, resulting in a segfault:

0x0000007f74d46fb4 in SkFontMgr_Android::SkFontMgr_Android(SkFontMgr_Android_CustomFonts const*) () from /home/a/exokit/android/app/src/main/arm64-v8a/libnative-main.so

We need to make sure the requisite font location is correct/the default font loads successfully to unlock <canvas> 2D on Android.

@avaer avaer added the bug Something isn't working label Apr 19, 2019
@avaer
Copy link
Member Author

avaer commented Apr 20, 2019

Found the culprit. The reason for this error is that we are literally using the magic leap build of skia in the android build, and that build has an OS-specific hack to load fonts.xml from the package instead of the operating system: https://github.com/modulesio/skia/pull/6/files

We'll need to rebuild skia and somehow make this hack contingent on the ANDROID/LUMIN difference. Ideally it's detected at runtime so we can continue to share the lib across both platforms...

@chrislatorres
Copy link
Contributor

That is the change from here? avaer/skia@534a3a0

@avaer
Copy link
Member Author

avaer commented Apr 20, 2019

Yeah, probably.

For runtime detection I think the presence of ANDROID_HOME might work: https://github.com/modulesio/skia/pull/6/files#diff-17ccc70e187937a2f38ca4845a74ef75R784

@chrislatorres
Copy link
Contributor

found a reference for android env variables:

ANDROID_ASSETS: /system/app
ANDROID_DATA: /data
ANDROID_ROOT: /system
ASEC_MOUNTPOINT: /mnt/asec
BOOTCLASSPATH: /system/framework/core.jar:/system/framework/core-...
EXTERNAL_STORAGE: /storage/sdcard
LOOP_MOUNTPOINT: /mnt/obb
PATH: /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin

source

@avaer
Copy link
Member Author

avaer commented Apr 20, 2019

Yes but the real question is does LUMIN define these, so can we rely on it to differentiate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants