Skip to content

V8 crash on Android 32-bit device #434

Open

Description

@DeekshaGunjal

I had built v8 for Android following the documentation : https://v8.dev/docs/cross-compile-arm

I specifically needed the v8_monolith.a archive library to use in an ongoing android project. Also, I needed to build it with NDK version 21, which is not the one that we get in //third_party/android_ndk directory of v8 . So i downloaded the NDKr21 and copied the NDK folder to //third_party/android_ndk folder and removed r20 version that was there so that V8 uses NDKr21 while building.

After building for arm64-v8a and copying the v8_monolith.a library to the android project, it was working fine. But after building it for arm and copying the library again, running the app, the app is getting crashed. So i build v8 for arm in debug mode. For arm abi , the following arguments were used:

target_os = "android"

is_debug = true

is_component_build = false

target_cpu = "arm"

v8_target_cpu = "arm"

v8_enable_pointer_compression = false

clang_use_chrome_plugins = false

v8_monolithic=true

v8_use_external_startup_data=false

symbol_level=2

v8_enable_i18n_support=false

and then building using command ninja -C out.gn/arm.release v8_monolith -vv

It turns out that it is working fine for arm64-v8a and x86_64 ( basically 64-bit ) and crashing for x86 and arm ( 32-bit).

The logcat output after running on a device supporting armeabi-v7a is :
v8crash

I have linux-x86_64 machine.

Is there any argument required for building and running v8 on 32-bit android devices? What am i doing wrong here?

Activity

  1. michaelcplusplus commented on Jan 4, 2021

    @michaelcplusplus

    I have the same problem with NDK 20 and V8 8.9
    Is there a solution to this problem?

  2. AlessandroFlorio commented on Jan 21, 2021

    @AlessandroFlorio

    I had the same problem with NDK 20 and V8 8.9 where the library linked correctly but the application crashed once started. With the following arguments V8 is loaded correctly and runs without crashing:

    is_debug = false
    target_os = "android"
    target_cpu = "arm"
    v8_target_cpu = "arm"
    is_component_build = false
    v8_monolithic = true
    v8_use_external_startup_data = false
    v8_static_library = true
    use_custom_libcxx = false
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions