Stable ubuntu platform to run Anbox, segfault


#1

Hello gentlemen… My name is Charlie, I am an Android architect formerly with AndyOS. I have taken an interest in this project and have been working with it, in-depth, to discover it’s capabilities and see if there is a way that I can help move the project along.

My goal at the momment is to come up with a core and set of dependencies that will run Anbox consistantly. Currently, Anbox will run on Ubuntu platforms X16, however after running the Ubuntu updates, Anbox breaks and is not recoverable.

My confusion scenaio:
Per the wiki, to stop services to mount a differnt android.img, it is required to use
initctl (upstart)
systemctl (systemd)

However Anbox can not run on update per the dbus-user-session dependency that will install systemv components that break Anbox forever.

I have tried every flavor of ubuntu distro, including starting at core and manually adding dependencies to build it out just for Anbox, then updates still break it.

This is a unique product, so debugging it is not something anyone has seen before. And long story short, the snippet below of the adb logcat keeps looping, over and over again. This is with any stock android.img OR any android.img that I compile when Anbox is in the broken state.

So once it’s broke, I can’t recover to find out what is actually happening, and other than the snippet, I have nothing else to go on.

Thank you for your time.

---- Logcat snippet
07-05 14:32:51.710 227 227 I Netd : Netd 1.0 starting
07-05 14:32:51.711 227 227 D TetherController: Setting IP forward enable = 0
07-05 14:32:51.754 227 227 E Netd : cannot find interface dummy0
07-05 14:32:51.755 225 225 I cameraserver: ServiceManager: 0xf749af20
07-05 14:32:51.755 225 225 I CameraService: CameraService started (pid=225)
07-05 14:32:51.755 225 225 I CameraService: CameraService process starting
07-05 14:32:51.755 225 225 W BatteryNotifier: batterystats service unavailable!
07-05 14:32:51.755 225 225 W BatteryNotifier: batterystats service unavailable!
07-05 14:32:51.757 225 225 E EmulatedCamera_QemuClient: receiveMessage: Unable to obtain payload size: Invalid argument
07-05 14:32:51.757 225 225 E EmulatedCamera_QemuClient: doQuery Response to query ‘list’ has failed: Invalid argument
07-05 14:32:51.757 225 225 E EmulatedCamera_QemuClient: listCameras: List cameras query failed: No error message
07-05 14:32:51.757 225 225 E cutils-trace: Error opening trace file: No such file or directory (2)
07-05 14:32:51.757 225 225 I CameraService: Loaded “Emulated Camera Module” camera module
07-05 14:32:51.757 225 225 E CameraService: setUpVendorTags: Vendor tag operations not fully defined. Ignoring definitions.
07-05 14:32:51.757 225 225 I ServiceManager: Waiting for service media.camera.proxy…
07-05 14:32:51.757 227 227 E Netd : Unable to create netlink socket: Protocol not supported
07-05 14:32:51.757 227 227 W Netd : Unable to open qlog quota socket, check if xt_quota2 can send via UeventHandler
07-05 14:32:51.758 227 227 D MDnsDS : MDnsSdListener::Hander starting up
07-05 14:32:51.758 227 235 D MDnsDS : MDnsSdListener starting to monitor
07-05 14:32:51.758 227 235 D MDnsDS : Going to poll with pollCount 1
07-05 14:32:51.829 224 224 I : sMaxFastTracks = 8
07-05 14:32:51.830 224 224 I audioserver: ServiceManager: 0xf741af20
07-05 14:32:51.831 224 224 W BatteryNotifier: batterystats service unavailable!
07-05 14:32:51.831 224 224 I AudioFlinger: Using default 3000 mSec as standby time.
07-05 14:32:51.831 224 224 I AudioPolicyService: AudioPolicyService CSTOR in new mode
07-05 14:32:51.831 224 224 I APM::ConfigParsingUtils: loadAudioPolicyConfig() loaded /system/etc/audio_policy.conf
07-05 14:32:51.832 224 224 I AudioFlinger: loadHwModule() Loaded primary audio interface from Anbox audio HW HAL (audio) handle 10
07-05 14:32:51.832 224 224 I AudioFlinger: openOutput(), module 10 Device 2, SamplingRate 44100, Format 0x000001, Channels 3, flags 2
07-05 14:32:51.847 224 224 E audio_hw_generic: Successfully connected Anbox audio server
07-05 14:32:51.847 224 224 I AudioFlinger: HAL output buffer size 1024 frames, normal sink buffer size 1024 frames
07-05 14:32:51.848 224 224 I BufferProvider: found effect “Multichannel Downmix To Stereo” from The Android Open Source Project
07-05 14:32:51.848 224 224 I AudioFlinger: Using module 10 has the primary audio interface
07-05 14:32:51.849 224 243 I AudioFlinger: AudioFlinger’s thread 0xf62034c0 ready to run
07-05 14:32:51.849 224 243 W BatteryNotifier: batterystats service unavailable!
07-05 14:32:51.850 224 243 W BatteryNotifier: batterystats service unavailable!
07-05 14:32:51.851 224 224 E audio_hw_generic: Error opening input stream format 1, channel_mask 0010, sample_rate 16000
07-05 14:32:51.863 224 243 W BatteryNotifier: batterystats service unavailable!
07-05 14:32:51.863 224 243 W AudioFlinger: no wake lock to update, system not ready yet
07-05 14:32:51.863 224 243 E cutils-trace: Error opening trace file: No such file or directory (2)
07-05 14:32:51.863 224 224 E audio_hw_generic: Successfully connected Anbox audio server
07-05 14:32:51.864 224 244 I AudioFlinger: AudioFlinger’s thread 0xf60037c0 ready to run
07-05 14:32:51.864 224 224 E AudioFlinger: int android::load_audio_interface(const char *, audio_hw_device_t **) couldn’t load audio hw module audio.r_submix (No such file or directory)
07-05 14:32:51.864 224 224 E AudioFlinger: loadHwModule() error -2 loading module r_submix
07-05 14:32:51.864 224 224 W APM_AudioPolicyManager: could not open HW module r_submix
07-05 14:32:51.864 224 224 W APM_AudioPolicyManager: Input device 80000100 unreachable
07-05 14:32:51.864 224 224 I RadioService: RadioService
07-05 14:32:51.864 224 224 I RadioService: onFirstRef
07-05 14:32:51.871 226 226 I mediaserver: ServiceManager: 0xf741afa0
07-05 14:32:51.871 226 226 W BatteryNotifier: batterystats service unavailable!
07-05 14:32:52.033 223 223 D AndroidRuntime: >>>>>> START com.android.internal.os.ZygoteInit uid 0 <<<<<<
07-05 14:32:52.034 222 222 D AndroidRuntime: >>>>>> START com.android.internal.os.ZygoteInit uid 0 <<<<<<
07-05 14:32:52.036 222 222 D AndroidRuntime: CheckJNI is OFF
07-05 14:32:52.036 222 222 E cutils-trace: Error opening trace file: No such file or directory (2)
07-05 14:32:52.036 223 223 D AndroidRuntime: CheckJNI is OFF
07-05 14:32:52.036 222 222 I art : option[0]=-Xzygote
07-05 14:32:52.036 222 222 I art : option[1]=-Xstacktracefile:/data/anr/traces.txt
07-05 14:32:52.036 222 222 I art : option[2]=exit
07-05 14:32:52.036 222 222 I art : option[3]=vfprintf
07-05 14:32:52.036 222 222 I art : option[4]=sensitiveThread
07-05 14:32:52.036 222 222 I art : option[5]=-verbose:gc
07-05 14:32:52.036 222 222 I art : option[6]=-Xms16m
07-05 14:32:52.036 222 222 I art : option[7]=-Xmx512m
07-05 14:32:52.036 222 222 I art : option[8]=-XX:HeapGrowthLimit=192m
07-05 14:32:52.037 222 222 I art : option[43]=–instruction-set-features=default
07-05 14:32:52.037 223 223 I art : option[12]=-Xusejit:true
07-05 14:32:52.049 222 222 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7ffe0f1e4000 in tid 222 (zygote64)
07-05 14:32:52.049 223 223 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xffe19000 in tid 223 (zygote)
07-05 14:32:52.049 14 14 W : debuggerd: handling request: pid=223 uid=0 gid=0 tid=223
07-05 14:32:52.049 15 15 W : debuggerd: handling request: pid=222 uid=0 gid=0 tid=222
07-05 14:32:52.054 247 247 E : debuggerd: Unable to connect to activity manager (connect failed: No such file or directory)
07-05 14:32:52.058 248 248 E : debuggerd: Unable to connect to activity manager (connect failed: No such file or directory)
07-05 14:32:52.104 247 247 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-05 14:32:52.104 247 247 F DEBUG : Build fingerprint: 'Android/anbox_desktop_x86_64/x86_64:7.1.1/N6F26Q/ubuntu04081249:userdebug/test-keys’
07-05 14:32:52.104 247 247 F DEBUG : Revision: '0’
07-05 14:32:52.104 247 247 F DEBUG : ABI: 'x86’
07-05 14:32:52.104 247 247 F DEBUG : pid: 223, tid: 223, name: zygote >>> zygote <<<
07-05 14:32:52.104 247 247 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xffe19000
07-05 14:32:52.104 247 247 F DEBUG : eax ffe1a000 ebx f721eb84 ecx 5b19b500 edx f7220440
07-05 14:32:52.104 247 247 F DEBUG : esi ffe36000 edi ff63c000
07-05 14:32:52.105 247 247 F DEBUG : xcs 00000023 xds 0000002b xes 0000002b xfs 00000003 xss 0000002b
07-05 14:32:52.105 247 247 F DEBUG : eip f701e720 ebp ffe36d68 esp ffe36d00 flags 00010206
07-05 14:32:52.107 247 247 F DEBUG :
07-05 14:32:52.107 247 247 F DEBUG : backtrace:
07-05 14:32:52.107 247 247 F DEBUG : #00 pc 00535720 /system/lib/libart.so (_ZN3art6Thread25InstallImplicitProtectionEv+192)
07-05 14:32:52.107 247 247 F DEBUG : #01 pc 00537519 /system/lib/libart.so (_ZN3art6Thread12InitStackHwmEv+281)
07-05 14:32:52.107 247 247 F DEBUG : #02 pc 005353a9 /system/lib/libart.so (_ZN3art6Thread4InitEPNS_10ThreadListEPNS_9JavaVMExtEPNS_9JNIEnvExtE+297)
07-05 14:32:52.107 247 247 F DEBUG : #03 pc 00537aee /system/lib/libart.so (_ZN3art6Thread6AttachEPKcbP8_jobjectb+494)
07-05 14:32:52.107 247 247 F DEBUG : #04 pc 00516f4c /system/lib/libart.so (_ZN3art7Runtime4InitEONS_18RuntimeArgumentMapE+11884)
07-05 14:32:52.107 247 247 F DEBUG : #05 pc 0051a58d /system/lib/libart.so (_ZN3art7Runtime6CreateERKNSt3__16vectorINS1_4pairINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKvEENS7_ISC_EEEEb+157)
07-05 14:32:52.107 247 247 F DEBUG : #06 pc 003952d9 /system/lib/libart.so (JNI_CreateJavaVM+585)
07-05 14:32:52.107 247 247 F DEBUG : #07 pc 00004df9 /system/lib/libnativehelper.so (JNI_CreateJavaVM+57)
07-05 14:32:52.107 247 247 F DEBUG : #08 pc 00073af8 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime7startVmEPP7_JavaVMPP7_JNIEnvb+3078)
07-05 14:32:52.107 247 247 F DEBUG : #09 pc 00074140 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcRKNS_6VectorINS_7String8EEEb+400)
07-05 14:32:52.107 247 247 F DEBUG : #10 pc 00001b55 /system/bin/app_process32
07-05 14:32:52.107 247 247 F DEBUG : #11 pc 00016bd6 /system/lib/libc.so (__libc_init+100)
07-05 14:32:52.107 247 247 F DEBUG : #12 pc 0000144c /system/bin/app_process32
07-05 14:32:52.107 247 247 F DEBUG : #13 pc 00000004
07-05 14:32:52.108 248 248 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-05 14:32:52.108 248 248 F DEBUG : Build fingerprint: 'Android/anbox_desktop_x86_64/x86_64:7.1.1/N6F26Q/ubuntu04081249:userdebug/test-keys’
07-05 14:32:52.108 248 248 F DEBUG : Revision: '0’
07-05 14:32:52.108 248 248 F DEBUG : ABI: 'x86_64’
07-05 14:32:52.108 248 248 F DEBUG : pid: 222, tid: 222, name: zygote64 >>> zygote64 <<<
07-05 14:32:52.108 248 248 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7ffe0f1e4000
07-05 14:32:52.108 248 248 F DEBUG : rax 00007ffe0f1e5000 rbx 00007ffe0ea07000 rcx 90fade5dddcd5f00 rdx 0000000000000003
07-05 14:32:52.108 248 248 F DEBUG : rsi 0000000000001000 rdi 000000000000000c
07-05 14:32:52.108 248 248 F DEBUG : r8 00000000000000de r9 00007f497a514b40 r10 0000000000000000 r11 0000000000000246
07-05 14:32:52.108 248 248 F DEBUG : r12 00007ffe0f201000 r13 00000000fffff000 r14 00007ffe0ea06000 r15 00007f4979e95a00
07-05 14:32:52.108 248 248 F DEBUG : cs 0000000000000033 ss 000000000000002b
07-05 14:32:52.108 248 248 F DEBUG : rip 00007f497588d6a0 rbp 00007f4975a847d8 rsp 00007ffe0f201b50 eflags 0000000000010206
07-05 14:32:52.111 248 248 F DEBUG :
07-05 14:32:52.111 248 248 F DEBUG : backtrace:
07-05 14:32:52.111 248 248 F DEBUG : #00 pc 00000000004fe6a0 /system/lib64/libart.so (_ZN3art6Thread25InstallImplicitProtectionEv+144)
07-05 14:32:52.111 248 248 F DEBUG : #01 pc 000000000050010a /system/lib64/libart.so (_ZN3art6Thread12InitStackHwmEv+282)
07-05 14:32:52.111 248 248 F DEBUG : #02 pc 00000000004fe3df /system/lib64/libart.so (_ZN3art6Thread4InitEPNS_10ThreadListEPNS_9JavaVMExtEPNS_9JNIEnvExtE+255)
07-05 14:32:52.111 248 248 F DEBUG : #03 pc 0000000000500602 /system/lib64/libart.so (_ZN3art6Thread6AttachEPKcbP8_jobjectb+434)
07-05 14:32:52.111 248 248 F DEBUG : #04 pc 00000000004e52cd /system/lib64/libart.so (_ZN3art7Runtime4InitEONS_18RuntimeArgumentMapE+10797)
07-05 14:32:52.111 248 248 F DEBUG : #05 pc 00000000004e811e /system/lib64/libart.so (_ZN3art7Runtime6CreateERKNSt3__16vectorINS1_4pairINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKvEENS7_ISC_EEEEb+110)
07-05 14:32:52.111 248 248 F DEBUG : #06 pc 00000000003873d6 /system/lib64/libart.so (JNI_CreateJavaVM+614)
07-05 14:32:52.111 248 248 F DEBUG : #07 pc 00000000000ad8e2 /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime7startVmEPP7_JavaVMPP7_JNIEnvb+2466)
07-05 14:32:52.111 248 248 F DEBUG : #08 pc 00000000000adeda /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcRKNS_6VectorINS_7String8EEEb+314)
07-05 14:32:52.111 248 248 F DEBUG : #09 pc 0000000000002318 /system/bin/app_process64
07-05 14:32:52.111 248 248 F DEBUG : #10 pc 000000000001c954 /system/lib64/libc.so (__libc_init+84)
07-05 14:32:52.111 248 248 F DEBUG : #11 pc 0000000000001cf4 /system/bin/app_process64
07-05 14:32:52.111 248 248 F DEBUG : #12 pc 0000000000000005
07-05 14:32:52.126 14 14 W : debuggerd: resuming target 223
07-05 14:32:52.128 15 15 W : debuggerd: resuming target 222
07-05 14:32:52.343 33 33 I ServiceManager: service ‘media.audio_flinger’ died
07-05 14:32:52.343 33 33 I ServiceManager: service ‘media.audio_policy’ died
07-05 14:32:52.343 33 33 I ServiceManager: service ‘media.radio’ died
07-05 14:32:52.343 33 33 I ServiceManager: service ‘media.sound_trigger_hw’ died
07-05 14:32:52.347 33 33 I ServiceManager: service ‘netd’ died
07-05 14:32:52.347 33 33 I ServiceManager: service ‘media.player’ died
07-05 14:32:52.347 33 33 I ServiceManager: service ‘media.resource_manager’ died


anbox system-info
version: 3
snap-revision: 33
os:
name: Ubuntu
version: 16.04.2 LTS (Xenial Xerus)
snap-based: true
kernel:
version: Linux version 4.8.0-58-generic (buildd@lgw01-21) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017
binder: true
ashmem: true
graphics:
egl:
vendor: Mesa Project
version: 1.5 (DRI2)
extensions:
- EGL_CHROMIUM_sync_control
- EGL_EXT_create_context_robustness
- EGL_EXT_image_dma_buf_import
- EGL_KHR_cl_event2
- EGL_KHR_create_context
- EGL_KHR_fence_sync
- EGL_KHR_get_all_proc_addresses
- EGL_KHR_gl_colorspace
- EGL_KHR_gl_renderbuffer_image
- EGL_KHR_gl_texture_2D_image
- EGL_KHR_gl_texture_3D_image
- EGL_KHR_gl_texture_cubemap_image
- EGL_KHR_image
- EGL_KHR_image_base
- EGL_KHR_image_pixmap
- EGL_KHR_reusable_sync
- EGL_KHR_surfaceless_context
- EGL_KHR_wait_sync
- EGL_MESA_configless_context
- EGL_MESA_drm_image
- EGL_MESA_image_dma_buf_export
- EGL_NOK_swap_region
- EGL_NOK_texture_from_pixmap
- EGL_NV_post_sub_buffer
- EGL_WL_bind_wayland_display
gles2:
vendor: X.Org
vendor: OpenGL ES-CM 1.1 Mesa 12.0.6
extensions:
- GL_EXT_blend_minmax
- GL_EXT_multi_draw_arrays
- GL_EXT_texture_filter_anisotropic
- GL_EXT_texture_lod_bias
- GL_OES_byte_coordinates
- GL_OES_fixed_point
- GL_OES_stencil_wrap
- GL_OES_compressed_paletted_texture
- GL_OES_query_matrix
- GL_OES_read_format
- GL_OES_single_precision
- GL_OES_draw_texture
- GL_OES_point_size_array
- GL_OES_point_sprite
- GL_EXT_texture_format_BGRA8888
- GL_OES_compressed_ETC1_RGB8_texture
- GL_OES_depth24
- GL_OES_element_index_uint
- GL_OES_fbo_render_mipmap
- GL_OES_framebuffer_object
- GL_OES_mapbuffer
- GL_OES_rgb8_rgba8
- GL_OES_stencil8
- GL_OES_texture_env_crossbar
- GL_OES_texture_mirrored_repeat
- GL_OES_texture_npot
- GL_OES_EGL_image
- GL_OES_packed_depth_stencil
- GL_OES_texture_cube_map
- GL_APPLE_texture_max_level
- GL_EXT_discard_framebuffer
- GL_EXT_read_format_bgra
- GL_OES_blend_equation_separate
- GL_OES_blend_func_separate
- GL_OES_blend_subtract
- GL_OES_EGL_image_external
- GL_OES_EGL_sync
- GL_OES_vertex_array_object
- GL_EXT_map_buffer_range
- GL_KHR_debug
- GL_OES_surfaceless_context
- GL_EXT_polygon_offset_clamp


ifconfig anbox0
anbox0 Link encap:Ethernet HWaddr fe:bb:41:a4:ac:a5
inet addr:192.168.250.1 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::1ce5:3fff:fe36:b508/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:536 (536.0 B) TX bytes:648 (648.0 B)


#2

Please see https://github.com/anbox/anbox/issues/337 for more details.


#3

There is a new snap in the edge channel. Refresh with snap refresh --devmode --edge anbox.


#4

Excellent follow up responses!
I have new insight on using gdb in this manner, and so far the update seems to work!

NIce job!