anbox / anbox

Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system
https://anbox.io
GNU General Public License v3.0
8.87k stars 1.15k forks source link

Running Chrome/Chromium in Anbox #1637

Open Niek opened 3 years ago

Niek commented 3 years ago

Did anyone manage to get Chrome or Chromium or any derivative working in Anbox? I have tried:

All of them have the same issue: the browser starts fine, but when I try to load any page (or even chrome://version) it hangs. This is the output from adb logcat:

10-12 13:41:00.963   871   892 E EGL_emulation: tid 892: eglCreateContext(919): error 0x3005 (EGL_BAD_CONFIG)
10-12 13:41:00.963   871   892 E chromium: [ERROR:gl_context_egl.cc(233)] eglCreateContext failed with error EGL_BAD_CONFIG
10-12 13:41:00.963   871   892 E chromium: [ERROR:gpu_channel_manager.cc(711)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
10-12 13:41:00.963   871   892 E chromium: [ERROR:shared_image_stub.cc(417)] SharedImageStub: unable to create context
10-12 13:41:00.963   871   892 E chromium: [ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub
10-12 13:41:00.964   871   892 E EGL_emulation: tid 892: eglCreateContext(919): error 0x3005 (EGL_BAD_CONFIG)
10-12 13:41:00.964   871   892 E chromium: [ERROR:gl_context_egl.cc(233)] eglCreateContext failed with error EGL_BAD_CONFIG
10-12 13:41:00.964   871   892 E chromium: [ERROR:gpu_channel_manager.cc(711)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
10-12 13:41:00.964   871   892 E chromium: [ERROR:shared_image_stub.cc(417)] SharedImageStub: unable to create context
10-12 13:41:00.964   871   892 E chromium: [ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub
10-12 13:41:00.984   871   892 E EGL_emulation: tid 892: eglCreateContext(919): error 0x3005 (EGL_BAD_CONFIG)
10-12 13:41:00.984   871   892 E chromium: [ERROR:gl_context_egl.cc(233)] eglCreateContext failed with error EGL_BAD_CONFIG
10-12 13:41:00.984   871   892 E chromium: [ERROR:gpu_channel_manager.cc(711)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
10-12 13:41:00.984   871   892 E chromium: [ERROR:shared_image_stub.cc(417)] SharedImageStub: unable to create context
10-12 13:41:00.984   871   892 E chromium: [ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub

I have tried:

Any other suggestions?

tazihad commented 3 years ago

No. Mine Just close automatically. Manjaro 5.8. Snaps install

Niek commented 3 years ago

Direct APK links if anyone else wants to test:

supaplextor commented 3 years ago

I'm running today's beta/rolling snap and while other apps seem to be ok, chrome is a dud in anbox. I almost had a screenshot of two instances, one all black screen, the other - one tab, but unresponsive to anything else. Webview works (as bare bones yeah)

Niek commented 3 years ago

I tried the latest version as I had some hope that this commit by @jnnksdev would solve the EGL emulation issues, but still the same EGL_BAD_CONFIG errors.

Firefox Fenix is working fine on Anbox, and so is (the super outdated) webview as @supaplextor mentioned. It would be great if someone would have any ideas how to to get Chrome running.

jnnks commented 3 years ago

Inspecting the chromium source we can find the root of the error [ERROR:gpu_channel_manager.cc(749)]. The entry-point in Anbox might be eglCreateContext, but that is a shot in the dark. If that is the case, then an Android image has to be rebuilt and published, which might take some time.

Niek commented 3 years ago

@jnnksdev that's indeed the place where the error occurs. The image that is used now is definitely fairly old. Would be it be a simple rebuild or does the code need to be synced with AOSP?

jnnks commented 3 years ago

This project did not see a lot of love lately, resulting in the old image. When having to deploy a new one it might make sense to go with a newer Android version than of 7.1.1 . These changes are beyond creating small PRs though. At least I can only spend more time on big questions earliest december.

I'll do more research about the topic on the weekend.

jnnks commented 3 years ago

OK, so my suspicion was correct. eglCreateContext is called (thrice ?) before the first ERROR shows up.

logcat ``` I ActivityManager: Start proc 731:com.android.chrome:sandboxed_process0/u0i0 for service com.android.chrome/org.chromium.content.app.SandboxedProcessService0 D : HostConnection::get() New Host Connection established 0xe98c7040, tid 729 I OpenGLRenderer: Initialized EGL, version 1.4 D OpenGLRenderer: Swap behavior 1 I EGL_emulation: ANBOX eglCreateContext I ActivityManager: Displayed com.android.chrome/com.google.android.apps.chrome.Main: +832ms W art : Unexpected CPU variant for X86 using defaults: x86 I ActivityManager: Start proc 760:com.android.chrome:privileged_process0/u0a49 for service com.android.chrome/org.chromium.content.app.PrivilegedProcessService0 I art : Starting a blocking GC AddRemoveAppImageSpace W GooglePlayServicesUtil: Google Play Store is missing. I LoadedApk: No resource references to update in package com.android.chrome.cablev2_authenticator I LoadedApk: No resource references to update in package com.android.chrome.autofill_assistant I LoadedApk: No resource references to update in package com.android.chrome.chime I LoadedApk: No resource references to update in package com.android.chrome.dev_ui I LoadedApk: No resource references to update in package com.android.chrome.stack_unwinder I LoadedApk: No resource references to update in package com.android.chrome.test_dummy I cr_ChildProcessService: Creating new ChildProcessService pid=760 I cr_LibraryLoader: Loaded native library version number "86.0.4240.75" I cr_CachingUmaRecorder: Flushed 1 samples from 1 histograms. W cr_KnoxSettingsProvider: Permission to read device policy denied. E cr_CompositorSurfaceMgr: Transitioning to surface with format : -1 E cr_CompositorSurfaceMgr: surfaceCreated format : 0 I cr_ContextualSearch: Tap suppression enabled: false I cr_ChromeTabbedActivity: #initializeState I cr_CipherFactory: #restoreFromBundle, no savedInstanceState. I cr_tabmodel: #loadState, ignoreIncognitoFiles? true I cr_tabmodel: Tab metadata, skipIncognitoCount? false incognitoCount: 0 totalCount: 1 E libEGL : validate_display:99 error 3008 (EGL_BAD_DISPLAY) I art : Do partial code cache collection, code=28KB, data=30KB I art : After code cache collection, code=28KB, data=30KB I cr_tabmodel: #isIncognitoTabBeingRestored from tabState: false I art : Increasing code cache capacity to 128KB D : HostConnection::get() New Host Connection established 0xe98e5100, tid 779 I EGL_emulation: ANBOX eglCreateContext I EGL_emulation: ANBOX eglCreateContext E EGL_emulation: tid 779: eglCreateContext(921): error 0x3005 (EGL_BAD_CONFIG) E chromium: [ERROR:gl_context_egl.cc(248)] eglCreateContext failed with error EGL_BAD_CONFIG E chromium: [ERROR:gpu_channel_manager.cc(749)] ContextResult::kFatalFailure: Failed to create shared context for virtualization. E chromium: [ERROR:shared_image_stub.cc(470)] SharedImageStub: unable to create context E chromium: [ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub ```

Considering that it has been called once without issues, I'm not sure why it has been failing other times.

Interesting to note would be E libEGL : validate_display:99 error 3008 (EGL_BAD_DISPLAY) EGL complaining about a bad display. That may cause the issue instead.

Niek commented 3 years ago

Thanks for investigating @jnnksdev! The display error seems to be coming from here: https://github.com/anbox/anbox/blob/7f1bfaf90de1f808d4ce8f49ef050120c5c8d1ef/android/opengl/system/egl/egl.cpp#L94-L103

I wonder if this could be fixed with an updated Android base image.

Fincer commented 3 years ago

Hi,

@jnnksdev thank you for the verbose log output. And thanks @Niek for emailing me.

Default Anbox WebView application (org.chromium.webview_shell) gives the same validate_display:99 error 3008 (EGL_BAD_DISPLAY) error but still renders the web content fine (I tested it). Therefore, I doubt the relevant error is hinted by eglCreateContext(921): error 0x3005 (EGL_BAD_CONFIG) instead. This does not exclude the possibility these two are related, however.

My Anbox adb shell informs OpenGL version as follows:

> adb shell dumpsys SurfaceFlinger |grep OpenGL
GLES: Intel, Mesa Intel(R) UHD Graphics 630 (CFL GT2), OpenGL ES 2.0

logcat output of the default Anbox WebView app (org.chromium.webview_shell) which still successfully renders a web page:

WebView app logcat ``` 11-23 18:36:59.798 1231 1231 W System : ClassLoader referenced unknown path: /system/app/Browser2/lib/x86_64 11-23 18:37:00.236 1231 1231 W System : ClassLoader referenced unknown path: /system/app/webview/lib/x86_64 11-23 18:37:00.241 1231 1231 D ApplicationLoaders: ignored Vulkan layer search path /system/app/webview/lib/x86_64:/system/app/webview/webview.apk!/lib/x86_64:/system/lib64:/vendor/lib64 for namespace 0x7ff023cfa0f0 11-23 18:37:00.264 1231 1231 I WebViewFactory: Loading com.android.webview version 52.0.2743.100 (code 275610060) 11-23 18:37:00.895 1231 1231 I cr_LibraryLoader: Time to load native libraries: 135 ms (timestamps 6703-6838) 11-23 18:37:00.895 1231 1231 I cr_LibraryLoader: Expected native library version number "52.0.2743.100", actual native library version number "52.0.2743.100" 11-23 18:37:01.039 1231 1231 I cr_LibraryLoader: Expected native library version number "52.0.2743.100", actual native library version number "52.0.2743.100" 11-23 18:37:01.157 1231 1231 I chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0 11-23 18:37:01.311 1231 1231 I cr_BrowserStartup: Initializing chromium process, singleProcess=true 11-23 18:37:01.796 1231 1231 D : HostConnection::get() New Host Connection established 0x7ff01adca340, tid 1231 11-23 18:37:02.021 1231 1255 W cr_media: Requires BLUETOOTH permission 11-23 18:37:02.237 1231 1231 I cr_DRP : No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp 11-23 18:37:02.746 1231 1231 W cr_AwContents: onDetachedFromWindow called when already detached. Ignoring 11-23 18:37:02.900 1231 1262 I OpenGLRenderer: Initialized EGL, version 1.4 11-23 18:37:02.905 1231 1262 D OpenGLRenderer: Swap behavior 1 11-23 18:37:02.905 1231 1262 D : HostConnection::get() New Host Connection established 0x7ff01d812c00, tid 1262 11-23 18:37:03.333 113 134 I ActivityManager: Displayed org.chromium.webview_shell/.WebViewBrowserActivity: +3s856ms 11-23 18:37:07.926 113 1263 W DropBoxManagerService: Dropping: system_app_strictmode (10 > 0 bytes) 11-23 18:37:25.987 1231 1231 I cr_Ime : ImeThread is not enabled. 11-23 18:37:26.707 1231 1271 E libEGL : validate_display:99 error 3008 (EGL_BAD_DISPLAY) 11-23 18:37:26.901 1231 1271 W VideoCapabilities: Unrecognized profile/level 0/0 for video/mpeg2 11-23 18:37:26.901 1231 1271 W VideoCapabilities: Unrecognized profile/level 0/2 for video/mpeg2 11-23 18:37:26.901 1231 1271 W VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2 11-23 18:37:26.919 1231 1271 I VideoCapabilities: Unsupported profile 4 for video/mp4v-es 11-23 18:37:26.924 1231 1271 D : HostConnection::get() New Host Connection established 0x7ff01d9a8d80, tid 1271 11-23 18:37:27.395 1231 1277 D NetworkSecurityConfig: No Network Security Config specified, using platform default 11-23 18:37:27.923 1231 1231 I chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'worker-src'. 11-23 18:37:27.923 1231 1231 I chromium: ", source: https://github.com/ (0) 11-23 18:37:27.924 1231 1231 W cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 1231 11-23 18:37:28.070 1231 1271 E EGL_emulation: eglQueryContext 32c0 EGL_BAD_ATTRIBUTE 11-23 18:37:28.070 1231 1271 E EGL_emulation: tid 1271: eglQueryContext(1132): error 0x3004 (EGL_BAD_ATTRIBUTE) 11-23 18:37:28.123 1231 1271 E EGL_emulation: eglQueryContext 32c0 EGL_BAD_ATTRIBUTE 11-23 18:37:28.123 1231 1271 E EGL_emulation: tid 1271: eglQueryContext(1132): error 0x3004 (EGL_BAD_ATTRIBUTE) ... ``` - `validate_display:99 error 3008 (EGL_BAD_DISPLAY)` error message is there, still the webUI content is rendered.

Chromium output is same than posted in https://github.com/anbox/anbox/issues/1637#issuecomment-724003542. Snipped logcat part. Fails to render a web page:

L1 | 11-23 18:46:58.867   733   749 E chromium: [ERROR:shared_image_stub.cc(417)] SharedImageStub: unable to create context
L2 | 11-23 18:46:58.867   733   749 E chromium: [ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub
L3 | 11-23 18:46:58.868   733   749 E EGL_emulation: tid 749: eglCreateContext(919): error 0x3005 (EGL_BAD_CONFIG)
L4 | 11-23 18:46:58.868   733   749 E chromium: [ERROR:gl_context_egl.cc(233)] eglCreateContext failed with error EGL_BAD_CONFIG
L5 | 11-23 18:46:58.868   733   749 E chromium: [ERROR:gpu_channel_manager.cc(711)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
...

Referred chromium source code parts:


As a quick test, I commented out the relevant egl.cpp source code (shown below) from an anbox-git Linux package. With this test I wanted to see where the error actually comes from, and how does commenting out the code affects application behavior.

egl.cpp source code lines 917-920 say as follows:

    // Currently only support GLES1 and 2
    if (version != 1 && version != 2) {
        setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
    }

where the line 919 is where the logcat output refers to (I highly suspect).

However, the error message error 0x3005 (EGL_BAD_CONFIG) was still there with the same line 919 reference. I suspect the error originates from precompiled Android image (7.1.1) contents. For those who don't know: Android image file requires Anbox source code sections to be used during image creation process. As I excluded the mentioned egl.cpp code part from installed anbox-git Linux package but not from the Android image, the image was the only potential source for the error message. However, I didn't actually re-compiled the image file for now, so there is no absolute 100% certainty.

Basically, I could compile a new Android image especially for this issue, but just commenting out code section 917-920 does not resolve the issue, anyway.


To sum up, I didn't test the issue further but I suspect it has something to do with OpenGL versions that Anbox uses/supports/registers to Chromium or vice versa. I don't know, but someone might have time to investigate this issue further.

Further code & log analysis is required. For instance:

Not sure if the following is relevant. However, this is from an early Anbox boot process:

Anbox boot log - GL stuff ``` ... 11-23 18:51:50.707 31 31 I SurfaceFlinger: SurfaceFlinger is starting 11-23 18:51:50.707 31 31 I SurfaceFlinger: SurfaceFlinger's main thread ready to run. Initializing graphics H/W... 11-23 18:51:50.707 31 31 D libEGL : Emulator has host GPU support, qemu.gles is set to 1. 11-23 18:51:50.708 31 31 E libEGL : load_driver(/system/lib64/egl/libGLES_emulation.so): dlopen failed: library "/system/lib64/egl/libGLES_emulation.so" not found 11-23 18:51:51.379 31 31 D libEGL : loaded /system/lib64/egl/libEGL_emulation.so 11-23 18:51:51.471 31 31 D libEGL : loaded /system/lib64/egl/libGLESv1_CM_emulation.so 11-23 18:51:51.544 31 31 D libEGL : loaded /system/lib64/egl/libGLESv2_emulation.so 11-23 18:51:51.555 39 39 I mediacodec: @@@ mediacodecservice starting 11-23 18:51:51.556 34 34 I : sMaxFastTracks = 8 11-23 18:51:51.556 39 39 W : No seccomp filter defined for this architecture. 11-23 18:51:51.557 31 31 D : HostConnection::get() New Host Connection established 0x7f47e2c3f0c0, tid 31 11-23 18:51:51.561 31 31 E SurfaceFlinger: Couldn't set SCHED_FIFO for SFEventThread 11-23 18:51:51.568 31 31 D hwcomposer: int hwc_device_open(const hw_module_t *, const char *, hw_device_t **) 11-23 18:51:51.568 31 31 I SurfaceFlinger: Using composer version 1.0 11-23 18:51:51.570 31 31 W SurfaceFlinger: no suitable EGLConfig found, trying a simpler query 11-23 18:51:51.571 31 31 I SurfaceFlinger: EGL information: 11-23 18:51:51.571 31 31 I SurfaceFlinger: vendor : Android 11-23 18:51:51.571 31 31 I SurfaceFlinger: version : 1.4 Android META-EGL 11-23 18:51:51.571 31 31 I SurfaceFlinger: extensions: EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_swap_buffers_with_damage EGL_ANDROID_create_native_client_buffer EGL_ANDROID_front_buffer_auto_refresh EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer 11-23 18:51:51.571 31 31 I SurfaceFlinger: Client API: OpenGL_ES 11-23 18:51:51.571 31 31 I SurfaceFlinger: EGLSurface: 8-8-8-8, config=0x0 11-23 18:51:51.575 31 31 W SurfaceFlinger: no suitable EGLConfig found, trying a simpler query 11-23 18:51:51.576 31 31 I SurfaceFlinger: EGL information: 11-23 18:51:51.576 31 31 I SurfaceFlinger: vendor : Android 11-23 18:51:51.576 31 31 I SurfaceFlinger: version : 1.4 Android META-EGL ... ``` See also: https://github.com/anbox/anbox/issues/922 Somewhat interesting (?) notes: - `META-EGL` version: 1.4, `composer version`: 1.0. Any relevance? - File `/system/lib64/egl/libGLES_emulation.so` is missing. Files `/system/lib64/egl/{libEGL_emulation.so, libGLES_android.so, libGLESv1_CM_emulation.so, libGLESv2_emulation.so}` still exist, however.
Fincer commented 3 years ago

I decided to re-compile Android image with the code sections 908-909 and 917-920 commented out in egl.cpp. The application doesn't still work but the logcat output differs, as expected. The commented out code section basically checks whether to return EGL_BAD_CONFIG if GLES version is not OK, so I just disabled this check procedure. I applied the same code modification to my anbox-git Linux package.

Chromium logcat, custom Android image, no GLES version check ``` ... 1-25 00:28:11.197 837 883 I cr_LogcatExtraction: Succeeded extracting logcat to 399d02ad-4578-4538-af1c-d484b9416348.dmp1902.try0. 11-25 00:28:11.197 837 883 I cr_MinidumpJobService: Scheduling upload of all pending minidumps. 11-25 00:28:11.407 864 878 E chromium: [ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer. 11-25 00:28:11.407 118 360 I ActivityManager: Process org.ungoogled.chromium.stable:privileged_process2 (pid 1940) has died 11-25 00:28:11.407 118 360 D ActivityManager: cleanUpApplicationRecord -- 1940 11-25 00:28:11.407 118 360 W ActivityManager: Scheduling restart of crashed service org.ungoogled.chromium.stable/org.chromium.content.app.PrivilegedProcessService2 in 1000ms 11-25 00:28:11.407 837 884 W chromium: [WARNING:gpu_process_host.cc(1256)] The GPU process has crashed 28 time(s) 11-25 00:28:11.407 837 863 W cr_ChildProcessConn: onServiceDisconnected (crash or killed by oom): pid=1940 bindings:W S state:3 counts:0,0,0,2, 11-25 00:28:11.408 837 837 E chromium: [ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer. 11-25 00:28:11.409 837 837 W chromium: [WARNING:compositor_view.cc(315)] Child process died (type=9) pid=1940) 11-25 00:28:11.411 837 837 I Choreographer: Skipped 41 frames! The application may be doing too much work on its main thread. 11-25 00:28:11.411 10 10 W : debuggerd: resuming target 1940 11-25 00:28:11.411 118 1974 W DropBoxManagerService: Dropping: data_app_native_crash (3067 > 0 bytes) 11-25 00:28:11.411 118 136 I BootReceiver: Copying /data/tombstones/tombstone_07 to DropBox (SYSTEM_TOMBSTONE) 11-25 00:28:11.411 33 33 I Zygote : Process 1940 exited due to signal (11) 11-25 00:28:11.419 837 890 I cr_LogcatExtraction: Trying to extract logcat for minidump c8b05142-5b47-4281-85e4-5c8368f11f96.dmp1940. 11-25 00:28:11.419 118 136 W DropBoxManagerService: Dropping: SYSTEM_TOMBSTONE (10 > 0 bytes) 11-25 00:28:11.422 837 1975 I cr_MDUploadJobImpl: Attempting to upload 1 minidumps. 11-25 00:28:11.422 837 1975 I cr_MDUploadJobImpl: Attempting to upload 399d02ad-4578-4538-af1c-d484b9416348.dmp1902.try0 11-25 00:28:11.422 837 1975 I cr_MDUploadCallable: Minidump upload is not permitted by user. Marking file as skipped for cleanup to prevent future uploads. 11-25 00:28:11.424 1977 1977 W art : Unexpected CPU variant for X86 using defaults: x86 11-25 00:28:11.425 118 130 I ActivityManager: Start proc 1977:org.ungoogled.chromium.stable:privileged_process3/u0a49 for service org.ungoogled.chromium.stable/org.chromium.content.app.PrivilegedProcessService3 11-25 00:28:11.453 1977 1977 I cr_ChildProcessService: Creating new ChildProcessService pid=1977 11-25 00:28:11.458 1977 1991 I cr_Linker: Using linker: org.chromium.base.library_loader.LegacyLinker 11-25 00:28:11.460 1977 1993 I cr_LibraryLoader: Loading chrome from within /data/app/org.ungoogled.chromium.stable-1/base.apk 11-25 00:28:11.487 1977 1993 I cr_LibraryLoader: Loaded native library version number "85.0.4183.121" 11-25 00:28:11.488 1977 1993 I cr_CachingUmaRecorder: Flushed 1 samples from 1 histograms. 11-25 00:28:11.497 1977 1993 E libEGL : validate_display:99 error 3008 (EGL_BAD_DISPLAY) 11-25 00:28:11.498 1977 1993 D : HostConnection::get() New Host Connection established 0xf23f8bd0, tid 1993 11-25 00:28:11.529 837 884 W chromium: [WARNING:gpu_process_host.cc(984)] Reinitialized the GPU process after a crash. The reported initialization time was 35 ms 11-25 00:28:11.564 2001 2001 E chromium: [1125/002811.564109:ERROR:exception_handler_server.cc(192)] Handler Client SetPtracer: Operation not permitted (1) 11-25 00:28:11.576 2001 2001 E chromium: [1125/002811.576790:ERROR:elf_dynamic_array_reader.h(61)] tag not found 11-25 00:28:11.591 2001 2001 E chromium: [1125/002811.591437:ERROR:ptrace_client.cc(378)] Broker Open: access denied 11-25 00:28:11.591 2001 2001 E chromium: [1125/002811.591589:ERROR:system_snapshot_linux.cc(126)] Couldn't read property ro.product.board 11-25 00:28:11.603 2001 2001 E chromium: [1125/002811.602900:ERROR:socket.cc(182)] incorrect payload size 0 11-25 00:28:11.603 1977 1993 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10 in tid 1993 (CrGpuMain) 11-25 00:28:11.603 10 10 W : debuggerd: handling request: pid=1977 uid=10049 gid=10049 tid=1993 11-25 00:28:11.665 2005 2005 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 11-25 00:28:11.665 2005 2005 F DEBUG : Build fingerprint: 'Android/anbox_x86_64/x86_64:7.1.1/N6F26Q/fincer11241943:userdebug/test-keys' 11-25 00:28:11.665 2005 2005 F DEBUG : Revision: '0' 11-25 00:28:11.665 2005 2005 F DEBUG : ABI: 'x86' 11-25 00:28:11.665 2005 2005 F DEBUG : pid: 1977, tid: 1993, name: CrGpuMain >>> org.ungoogled.chromium.stable:privileged_process3 <<< 11-25 00:28:11.665 2005 2005 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10 11-25 00:28:11.665 2005 2005 F DEBUG : eax 00000000 ebx e6f7ed7c ecx 00000000 edx 00008869 11-25 00:28:11.665 2005 2005 F DEBUG : esi f2581cf4 edi f2581cf4 11-25 00:28:11.665 2005 2005 F DEBUG : xcs 00000023 xds 0000002b xes 0000002b xfs 0000006b xss 0000002b 11-25 00:28:11.665 2005 2005 F DEBUG : eip e6f5e82a ebp f2581c08 esp f2581bf0 flags 00210246 11-25 00:28:11.686 2005 2005 F DEBUG : 11-25 00:28:11.686 2005 2005 F DEBUG : backtrace: 11-25 00:28:11.686 2005 2005 F DEBUG : #00 pc 0000d82a /system/lib/libGLESv2_enc.so (_ZN13GLClientState23getClientStateParameterIiEEbjPT_+362) 11-25 00:28:11.686 2005 2005 F DEBUG : #01 pc 0000999a /system/lib/libGLESv2_enc.so (_ZN10GL2Encoder15s_glGetIntegervEPvjPi+250) 11-25 00:28:11.686 2005 2005 F DEBUG : #02 pc 0000666f /system/lib/egl/libGLESv2_emulation.so (glGetIntegerv+79) 11-25 00:28:11.686 2005 2005 F DEBUG : #03 pc 0000c379 /system/lib/libGLESv2.so (glGetIntegerv+57) 11-25 00:28:11.686 2005 2005 F DEBUG : #04 pc 03c76d1d /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.686 2005 2005 F DEBUG : #05 pc 03c91e21 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #06 pc 04016c63 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #07 pc 04015954 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #08 pc 0404804c /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #09 pc 0404a3c2 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #10 pc 0413b1b9 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #11 pc 0413df52 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #12 pc 0413eb65 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #13 pc 0413d1df /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #14 pc 01d31e51 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #15 pc 03184039 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #20 pc 03194bb5 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #23 pc 02ebd496 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #24 pc 02ebba6c /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #25 pc 04532f5c /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #26 pc 02ebc962 /data/app/org.ungoogled.chromium.stable-1/base.apk (offset 0xc78000) 11-25 00:28:11.687 2005 2005 F DEBUG : #27 pc 006ca842 /data/app/org.ungoogled.chromium.stable-1/oat/x86/base.odex (offset 0x6bc000) 11-25 00:28:12.004 837 890 I cr_LogcatExtraction: Succeeded extracting logcat to c8b05142-5b47-4281-85e4-5c8368f11f96.dmp1940.try0. 11-25 00:28:12.004 837 890 I cr_MinidumpJobService: Scheduling upload of all pending minidumps. 11-25 00:28:12.243 118 136 I BootReceiver: Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE) 11-25 00:28:12.251 864 878 E chromium: [ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer. 11-25 00:28:12.251 118 362 I ActivityManager: Process org.ungoogled.chromium.stable:privileged_process3 (pid 1977) has died 11-25 00:28:12.251 837 837 E chromium: [ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer. 11-25 00:28:12.251 118 362 D ActivityManager: cleanUpApplicationRecord -- 1977 11-25 00:28:12.251 33 33 I Zygote : Process 1977 exited due to signal (11) 11-25 00:28:12.251 837 884 W chromium: [WARNING:gpu_process_host.cc(1256)] The GPU process has crashed 29 time(s) 11-25 00:28:12.251 118 362 W ActivityManager: Scheduling restart of crashed service org.ungoogled.chromium.stable/org.chromium.content.app.PrivilegedProcessService3 in 1000ms 11-25 00:28:12.251 837 863 W cr_ChildProcessConn: onServiceDisconnected (crash or killed by oom): pid=1977 bindings:W S state:3 counts:0,0,0,2, 11-25 00:28:12.253 837 837 W chromium: [WARNING:compositor_view.cc(315)] Child process died (type=9) pid=1977) 11-25 00:28:12.256 10 10 W : debuggerd: resuming target 1977 11-25 00:28:12.256 10 10 E : debuggerd: failed to send signal 18 to target: No such process 11-25 00:28:12.256 118 2011 W DropBoxManagerService: Dropping: data_app_native_crash (3337 > 0 bytes) 11-25 00:28:12.256 837 837 I Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread. 11-25 00:28:12.261 118 136 W DropBoxManagerService: Dropping: SYSTEM_TOMBSTONE (10 > 0 bytes) 11-25 00:28:12.262 837 888 I cr_LogcatExtraction: Trying to extract logcat for minidump 6a280fa0-1ec9-45ad-a7a9-57404c2ef4e1.dmp1977. 11-25 00:28:12.265 837 2012 I cr_MDUploadJobImpl: Attempting to upload 1 minidumps. 11-25 00:28:12.265 837 2012 I cr_MDUploadJobImpl: Attempting to upload c8b05142-5b47-4281-85e4-5c8368f11f96.dmp1940.try0 11-25 00:28:12.266 837 2012 I cr_MDUploadCallable: Minidump upload is not permitted by user. Marking file as skipped for cleanup to prevent future uploads. ... ```

And, as usual, that log output generates an endless loop.

If anyone is interested, I uploaded the Android image to my web server. The image file has audio timing patchset applied, and this code modification. You find the image file here.

This issue is an interesting one and may have correlation: GitHub - VirtualGL/virtualgl - Support for recent chrome/chromium ? #73

Motivated by the VirtualGL issue above, I tested Android version of Chrome 54.0.2840.85 which renders websites fine whereas later versions either crash the application window, incorrectly place clickable elements etc.

I downloaded Chrome 54.0.2840.85 from (somewhat untrustful) ApkMirror.com.

Edit:

As I feel it's important to share as much information as possible, I give the following links for any future reference:

Niek commented 3 years ago

Thanks a lot for the research @Fincer! Great job on finding a working Chrome version. The diff between the 2 releases is here: https://github.com/chromium/chromium/compare/54.0.2840.85...55.0.2883.32 - that's a lot of changes to go through 😳

What I've tried so far is:

Niek commented 3 years ago

There's an interesting PR here: https://github.com/anbox/anbox/pull/1678

Unfortunately it doesn't seem to help in my case (or I'm missing something).

Fincer commented 3 years ago

@Niek

Good finding. Thank you for the link. Unless you already tried, I'll rebuild a new Android image with the PR applied.

Edit: Yeah, you are right. Doesn't work - even with the image rebuilt.

Niek commented 3 years ago

I haven't tried that yet, maybe that helps. Thanks!

Edit: thanks for testing @Fincer!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kuailexs commented 3 years ago

try to this PR : https://github.com/anbox/anbox/pull/1875

Fincer commented 3 years ago

@kuailexs

Thank you for your PR! Have you directly tested Chromium browsers or variants?

I applied the PR and did a quick test. Webview Shell works as intended but still no luck with Chromium browsers. Can anyone reproduce?

kuailexs commented 3 years ago

@Fincer I haven't tested Chromium browsers,only Webview Shell.

kuailexs commented 3 years ago

Sorry, my local workspace is not clean and there is something wrong with the submitted code

kuailexs commented 3 years ago

try to this PR: https://github.com/anbox/anbox/pull/1877 update anbox Binary file and android.img Chromium and Webview Shell works tested this apk : https://github.com/bromite/chromium/releases/download/86.0.4240.92/chr_x86_ChromePublic.apk

Fincer commented 3 years ago

@kuailexs Will do later, soon. I'll let you know. Thanks a lot!

kuailexs commented 3 years ago

@Fincer Excuse me, what is the result?

Fincer commented 3 years ago

@kuailexs

Ah, sorry. I've been quite busy with other things.

I just tested the new patch. Compiled both android.img & the anbox software with the patch applied. Still no luck.

Just some minor things: I see your screenshots have output text EGL_RENDERABLE_TYPE can not > EGL_OPENGL_ES2_BIT ... but it seems you have exluded this specific diff from your latest commit:

--- a/src/anbox/graphics/emugl/RendererConfig.cpp
+++ b/src/anbox/graphics/emugl/RendererConfig.cpp
@@ -142,6 +142,13 @@ int RendererConfigList::chooseConfig(const EGLint* attribs, EGLint* configs,
         mustReplaceSurfaceType = true;
       }
     }
+    // EGL_RENDERABLE_TYPE , fix webview
+    if (attribs[numAttribs] == EGL_RENDERABLE_TYPE) {
+      if (attribs[numAttribs + 1] > EGL_OPENGL_ES2_BIT) {
+        ERROR("EGL_RENDERABLE_TYPE can not > EGL_OPENGL_ES2_BIT");
+        return 0;
+      }
+    }
     numAttribs += 2;
   }

Not sure if this is relevant, though.

Moreover, about my setup: I checked I did not use any other conflicting patches or OpenGL settings for anbox that could have altered the testing.

kuailexs commented 3 years ago

Here is a useful but not the best way to modify it,I think we should change 'RendererConfigList::chooseConfig' only,But the tests didn't work。 only change ‘eglGetConfigAttrib’,It worked in my tests, To achieve the same effect

baptx commented 2 years ago

It would be useful to have Chrome and Chromium working on Anbox because there are some things I was not able to dot with Firefox on Android. For example some apps are using a web view to log in and then redirect you to the mobile app with their own URL scheme, which did not work with Firefox. Also I was not able to add a custom CA certificate to the latest Firefox on Android which does not use the CA certificates present on the system unlike Chrome / Chromium. I followed the instructions from https://blog.jeroenhd.nl/article/firefox-for-android-using-a-custom-certificate-authority but I still cannot view the HTTPS traffic in a tool like mitmproxy for websites using HSTS. If someone wants to try Chromium, which is currently not working on Anbox, the official daily build can be downloaded with an app like https://f-droid.org/en/packages/com.anddevw.getchromium/ or directly by getting the APK like the app is doing by first getting the latest build number at https://commondatastorage.googleapis.com/chromium-browser-snapshots/Android/LAST_CHANGE, then use this number in a URL like https://commondatastorage.googleapis.com/chromium-browser-snapshots/Android/932368/chrome-android.zip, unzip the file and install ChromePublic.apk.

Update: I tested the latest Chromium build 932368 with Android x86 on VirtualBox but it crashes also, unlike Chrome. Maybe because this latest build is not stable enough. I also tested the Chromium developer build used in the stable release of Google Chrome, which is currently 911475 according to the instructions from https://www.chromium.org/getting-involved/download-chromium but it did not work either with Android x86 on VirtualBox.

Fuseteam commented 2 years ago

um @baptx doesn't chrome and chromium just work on linux anyway?

baptx commented 2 years ago

@Fuseteam Yes but I need Chrome or Chromium working on Android for the reasons I described because some mobile apps are opening a mobile web browser for authentication with a redirect using their own URL scheme to be logged in on the mobile app.

Fuseteam commented 2 years ago

ah, i didn't think of that thanks for the insight

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Fuseteam commented 2 years ago

Hmm this still seems relevant

Manouchehri commented 2 years ago

Agreed.