Mac M1 Android Emulator Screen Record Using ADB Error - android-emulator

I can't start a screen record command using ADB on Mac M1 using Pixel3 virtual device and Android-28 Arm system image.
Here is some command that I use and the log:
start emulator: emulator -no-boot-anim -wipe-data -no-snapshot-save -memory 2048 -partition-size 3072 -avd "Pixel3-28"
ERROR | bad color buffer handle 0
ERROR | bad color buffer handle 0
start screen record: adb -P 5037 -s emulator-5554 shell screenrecord --time-limit 10 /sdcard/f8713900.mp4 --verbose
Main display is 1080x2160 #60.00fps (orientation=0)
Configuring recorder for 1080x2160 video/avc at 20.00Mbps
Content area is 1080x2160 at offset x=0 y=0
Stopping encoder and muxer
Encoder failed (err=-38)
Here is the log captured from adb logcat
--------- beginning of main
05-31 15:01:49.486 3135 3362 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
05-31 15:01:49.489 3135 3135 W Binder:3135_5: type=1400 audit(0.0:74): avc: denied { call } for scontext=u:r:surfaceflinger:s0 tcontext=u:r:mediacodec:s0 tclass=binder permissive=0 b/77924251
05-31 15:01:49.492 6800 6805 D CCodec : allocate(c2.android.avc.encoder)
05-31 15:01:49.492 6800 6805 E cutils-trace: Error opening trace file: No such file or directory (2)
05-31 15:01:49.492 6800 6805 I CCodec : setting up 'default' as default (vendor) store
05-31 15:01:49.493 6791 6791 V C2Store : in init
05-31 15:01:49.493 6791 6791 V C2Store : loading dll
05-31 15:01:49.494 6800 6805 I CCodec : Created component [c2.android.avc.encoder]
05-31 15:01:49.494 6800 6805 D CCodecConfig: Query domain & kind failed => BAD_INDEX
05-31 15:01:49.494 6800 6805 D CCodecConfig: read media type: video/raw
05-31 15:01:49.494 6800 6805 D CCodecConfig: read media type: video/avc
05-31 15:01:49.496 6800 6805 I CCodecConfig: query failed after returning 9 values (BAD_INDEX)
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2 config is Dict {
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coded.bitrate.value = 64000
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::float coded.frame-rate.value = 30
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coded.pl.level = 20492
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coded.pl.profile = 20481
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coding.intra-refresh.mode = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::float coding.intra-refresh.period = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coding.request-sync-frame.value = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::i64 coding.sync-frame-interval.value = 1000000
05-31 15:01:49.496 6800 6805 D CCodecConfig: string input.media-type.value = "video/raw"
05-31 15:01:49.496 6800 6805 D CCodecConfig: string output.media-type.value = "video/avc"
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.color.matrix = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.color.primaries = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.color.range = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.color.transfer = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.size.height = 240
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.size.width = 320
05-31 15:01:49.496 6800 6805 D CCodecConfig: }
05-31 15:01:49.496 6800 6805 W ColorUtils: expected specified color aspects (0:0:0:0)
05-31 15:01:49.496 6800 6805 D CCodecConfig: no c2 equivalents for color-format
05-31 15:01:49.496 6800 6805 D CCodecConfig: no c2 equivalents for encoder
05-31 15:01:49.496 6791 6791 D C2SoftAvcEnc: Given level 500c does not cover current configuration: adjusting to 500e
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2 config is Dict {
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coded.bitrate.value = 20000000
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::float coded.frame-rate.value = 60
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coded.pl.level = 20492
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coded.pl.profile = 20481
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coding.intra-refresh.mode = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::float coding.intra-refresh.period = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 coding.request-sync-frame.value = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::i64 coding.sync-frame-interval.value = 10000000
05-31 15:01:49.496 6800 6805 D CCodecConfig: string input.media-type.value = "video/raw"
05-31 15:01:49.496 6800 6805 D CCodecConfig: string output.media-type.value = "video/avc"
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.color.matrix = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.color.primaries = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.color.range = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.color.transfer = 0
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.size.height = 2160
05-31 15:01:49.496 6800 6805 D CCodecConfig: c2::u32 raw.size.width = 1080
05-31 15:01:49.496 6800 6805 D CCodecConfig: }
05-31 15:01:49.496 6800 6805 W ColorUtils: expected specified color aspects (0:0:0:0)
05-31 15:01:49.497 6800 6805 D CCodec : setup formats input: AMessage(what = 0x00000000) = {
05-31 15:01:49.497 6800 6805 D CCodec : int32_t frame-rate = 60
05-31 15:01:49.497 6800 6805 D CCodec : int32_t height = 2160
05-31 15:01:49.497 6800 6805 D CCodec : int64_t i-frame-interval = 10000000
05-31 15:01:49.497 6800 6805 D CCodec : int32_t intra-refresh-period = 0
05-31 15:01:49.497 6800 6805 D CCodec : string mime = "video/raw"
05-31 15:01:49.497 6800 6805 D CCodec : int32_t width = 1080
05-31 15:01:49.497 6800 6805 D CCodec : Rect crop(0, 0, 1079, 2159)
05-31 15:01:49.497 6800 6805 D CCodec : int32_t android._dataspace = 0
05-31 15:01:49.497 6800 6805 D CCodec : int32_t using-sw-read-often = 1
05-31 15:01:49.497 6800 6805 D CCodec : int32_t color-format = 2130708361
05-31 15:01:49.497 6800 6805 D CCodec : } and output: AMessage(what = 0x00000000) = {
05-31 15:01:49.497 6800 6805 D CCodec : int32_t bitrate = 20000000
05-31 15:01:49.497 6800 6805 D CCodec : Rect crop(0, 0, 1079, 2159)
05-31 15:01:49.497 6800 6805 D CCodec : int32_t color-standard = 0
05-31 15:01:49.497 6800 6805 D CCodec : int32_t color-range = 0
05-31 15:01:49.497 6800 6805 D CCodec : int32_t color-transfer = 0
05-31 15:01:49.497 6800 6805 D CCodec : int32_t frame-rate = 60
05-31 15:01:49.497 6800 6805 D CCodec : int32_t height = 2160
05-31 15:01:49.497 6800 6805 D CCodec : int64_t i-frame-interval = 10000000
05-31 15:01:49.497 6800 6805 D CCodec : int32_t intra-refresh-period = 0
05-31 15:01:49.497 6800 6805 D CCodec : int32_t level = 4096
05-31 15:01:49.497 6800 6805 D CCodec : int32_t max-bitrate = 20000000
05-31 15:01:49.497 6800 6805 D CCodec : string mime = "video/avc"
05-31 15:01:49.497 6800 6805 D CCodec : int32_t profile = 65536
05-31 15:01:49.497 6800 6805 D CCodec : int32_t width = 1080
05-31 15:01:49.497 6800 6805 D CCodec : }
05-31 15:01:49.497 6800 6805 W Codec2Client: Could not create an input surface from any Codec2.0 services.
05-31 15:01:49.502 6791 6791 E GraphicBufferSource: Unable to set BQ default buffer size to 0x0: -22
05-31 15:01:49.502 6800 6805 D CCodec : ISConfig start at 0us resume at -1us
05-31 15:01:49.502 6800 6805 D CCodecBufferChannel: [c2.android.avc.encoder#842] Query input allocators returned 0 params => BAD_INDEX (6)
05-31 15:01:49.502 6800 6805 D CCodecBufferChannel: [c2.android.avc.encoder#842] Using basic input block pool with poolID 1 => got 1 - OK (0)
05-31 15:01:49.502 6800 6805 D CCodecBufferChannel: [c2.android.avc.encoder#842] Query input allocators returned 0 params => BAD_INDEX (6)
05-31 15:01:49.503 6800 6805 I CCodecBufferChannel: [c2.android.avc.encoder#842] Created output block pool with allocatorID 16 => poolID 17 - OK
05-31 15:01:49.503 6800 6805 D Codec2Client: config -- call failed. Error code = 6
05-31 15:01:49.503 6800 6805 D CCodecBufferChannel: [c2.android.avc.encoder#842] Configured output block pool ids 17 => OK
05-31 15:01:49.504 3135 3362 E : HpInterface: Wrong interface type.
05-31 15:01:49.506 3135 3135 E HWComposer: getHdrCapabilities failed for display -1: Invalid display
05-31 15:01:49.506 6791 6808 W GraphicBufferSource: released unpopulated slots: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]
05-31 15:01:49.508 3022 3072 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096
05-31 15:01:49.508 6791 6808 D HostConnection: createUnique: call
05-31 15:01:49.508 6791 6808 D HostConnection: HostConnection::get() New Host Connection established 0x7ee5a18820, tid 6808
05-31 15:01:49.509 6791 6808 D HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
05-31 15:01:49.510 6800 6802 D HostConnection: createUnique: call
05-31 15:01:49.510 6800 6802 D HostConnection: HostConnection::get() New Host Connection established 0x7156a18500, tid 6802
05-31 15:01:49.511 6800 6802 D HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
05-31 15:01:49.512 3135 3135 E HWComposer: getSupportedPerFrameMetadata failed for display -1: Invalid display
05-31 15:01:49.515 3135 3135 D EGL_emulation: eglMakeCurrent: 0x733ca46320: ver 3 0 (tinfo 0x733ca2d620)
05-31 15:01:49.517 6791 6809 D SimpleC2Component: Using output block pool with poolID 0 => got 0 - 0
05-31 15:01:49.517 6791 6809 D C2SoftAvcEnc: Params width 1080 height 2160 level 50 colorFormat 0
05-31 15:01:49.517 3022 3072 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096
05-31 15:01:49.517 6791 6809 E C2SoftAvcEnc: Unable to set air params = 0x1ad
05-31 15:01:49.517 6791 6809 E gralloc_ranchu: gralloc_lock usage mismatch usage=0x3 cb->usage=0x0
05-31 15:01:49.517 6791 6809 E ion : ioctl c0044901 failed with code -1: Invalid argument
05-31 15:01:49.518 6791 6809 F Codec2BufferUtils: Codec2BufferUtils.cpp:214] Check failed: (src.width() & 1) == 0
--------- beginning of crash
05-31 15:01:49.518 6791 6809 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 6809 (HwBinder:6791_3), pid 6791 (omx#1.0-service)
05-31 15:01:49.518 3135 3135 D EGL_emulation: eglMakeCurrent: 0x733ca46320: ver 3 0 (tinfo 0x733ca2d620)
05-31 15:01:49.518 3135 3135 D EGL_emulation: eglMakeCurrent: 0x733ca46320: ver 3 0 (tinfo 0x733ca2d620)
05-31 15:01:49.518 3135 3135 E HWComposer: getLayerReleaseFence failed for display -1: Invalid display
05-31 15:01:49.518 3135 3135 I chatty : uid=1000(system) /system/bin/surfaceflinger identical 1 line
05-31 15:01:49.518 3135 3135 E HWComposer: getLayerReleaseFence failed for display -1: Invalid display
05-31 15:01:49.521 6812 6812 E cutils-trace: Error opening trace file: No such file or directory (2)
05-31 15:01:49.523 6813 6813 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
05-31 15:01:49.523 3158 3158 I /system/bin/tombstoned: received crash request for pid 6809
05-31 15:01:49.523 6813 6813 I crash_dump64: performing dump of process 6791 (target tid = 6809)
05-31 15:01:49.523 6813 6813 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-31 15:01:49.523 6813 6813 F DEBUG : Build fingerprint: 'Android/sdk_gphone_arm64/generic_arm64:9/PSR1.210301.009.B1/7985424:userdebug/dev-keys'
05-31 15:01:49.523 6813 6813 F DEBUG : Revision: '0'
05-31 15:01:49.523 6813 6813 F DEBUG : ABI: 'arm64'
05-31 15:01:49.523 6813 6813 F DEBUG : pid: 6791, tid: 6809, name: HwBinder:6791_3 >>> media.codec <<<
05-31 15:01:49.523 6813 6813 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
05-31 15:01:49.523 6813 6813 F DEBUG : Abort message: 'Codec2BufferUtils.cpp:214] Check failed: (src.width() & 1) == 0 '
05-31 15:01:49.523 6813 6813 F DEBUG : x0 0000000000000000 x1 0000000000001a99 x2 0000000000000006 x3 0000000000000008
05-31 15:01:49.523 6813 6813 F DEBUG : x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 7f7f7f7f7f7fff7f
05-31 15:01:49.523 6813 6813 F DEBUG : x8 0000000000000083 x9 1a0650427db1c7c1 x10 0000000000000000 x11 fffffffc7fffffdf
05-31 15:01:49.523 6813 6813 F DEBUG : x12 0000000000000001 x13 ffffffffffffffff x14 ffffffffff000000 x15 ffffffffffffffff
05-31 15:01:49.523 6813 6813 F DEBUG : x16 0000007f6882f2c8 x17 0000007f6876d040 x18 0000007ee52d0bb0 x19 0000000000001a87
05-31 15:01:49.523 6813 6813 F DEBUG : x20 0000000000001a99 x21 0000007ee52d1468 x22 0000000000000870 x23 0000007ee52d2588
05-31 15:01:49.523 6813 6813 F DEBUG : x24 0000007ee52d2588 x25 0000000000000438 x26 0000007ee1239880 x27 0000007ee52d2588
05-31 15:01:49.523 6813 6813 F DEBUG : x28 000000000000021c x29 0000007ee52d1440
05-31 15:01:49.523 6813 6813 F DEBUG : sp 0000007ee52d1400 lr 0000007f68761cc0 pc 0000007f68761ce8
05-31 15:01:49.526 6813 6813 F DEBUG :
05-31 15:01:49.526 6813 6813 F DEBUG : backtrace:
05-31 15:01:49.526 6813 6813 F DEBUG : #00 pc 0000000000021ce8 /system/lib64/libc.so (abort+116)
05-31 15:01:49.526 6813 6813 F DEBUG : #01 pc 0000000000008160 /system/lib64/vndk-sp-28/libbase.so (android::base::DefaultAborter(char const*)+12)
05-31 15:01:49.526 6813 6813 F DEBUG : #02 pc 0000000000008cb0 /system/lib64/vndk-sp-28/libbase.so (android::base::LogMessage::~LogMessage()+724)
05-31 15:01:49.526 6813 6813 F DEBUG : #03 pc 0000000000005398 /vendor/lib64/libstagefright_ccodec_utils.so (android::ConvertRGBToPlanarYUV(unsigned char*, unsigned long, unsigned long, unsigned long, C2GraphicView const&) [clone .cfi]+828)
05-31 15:01:49.526 6813 6813 F DEBUG : #04 pc 00000000000172c4 /vendor/lib64/libstagefright_soft_c2avcenc.so (android::C2SoftAvcEnc::setEncodeArgs(ive_video_encode_ip_t*, ive_video_encode_op_t*, C2GraphicView const*, unsigned char*, unsigned int, unsigned long)+596)
05-31 15:01:49.526 6813 6813 F DEBUG : #05 pc 00000000000155d8 /vendor/lib64/libstagefright_soft_c2avcenc.so (android::C2SoftAvcEnc::process(std::__1::unique_ptr<C2Work, std::__1::default_delete<C2Work>> const&, std::__1::shared_ptr<C2BlockPool> const&)+2948)
05-31 15:01:49.526 6813 6813 F DEBUG : #06 pc 000000000000ad90 /vendor/lib64/libstagefright_soft_c2common.so (android::SimpleC2Component::processQueue()+972)
05-31 15:01:49.526 6813 6813 F DEBUG : #07 pc 000000000000a7f0 /vendor/lib64/libstagefright_soft_c2common.so (_ZNSt3__114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN7android17SimpleC2Component5startEvE3$_0NS_10shared_ptrIS8_EEEEEEEPvSD_.cfi+172)
05-31 15:01:49.526 6813 6813 F DEBUG : #08 pc 0000000000081080 /system/lib64/libc.so (__pthread_start(void*)+36)
05-31 15:01:49.526 6813 6813 F DEBUG : #09 pc 0000000000023510 /system/lib64/libc.so (__start_thread+68)
--------- beginning of system
05-31 15:01:49.533 3294 3432 W NativeCrashListener: Couldn't find ProcessRecord for pid 6791
05-31 15:01:49.533 3158 3158 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_03
05-31 15:01:49.546 6800 6807 E CCodec : Codec2 component "c2.android.avc.encoder" died.
05-31 15:01:49.546 6800 6804 E MediaCodec: Codec reported err 0xffffffe0, actionCode 0, while in state 6
05-31 15:01:49.546 6800 6800 W ScreenRecord: dequeueOutputBuffer returned INVALID_OPERATION
05-31 15:01:49.547 6800 6800 E MediaMuxer: stop() is called in invalid state 1
05-31 15:01:49.548 6800 6800 D ScreenRecord: failed
05-31 15:01:49.549 3135 3135 D EGL_emulation: eglMakeCurrent: 0x733ca46320: ver 3 0 (tinfo 0x733ca2d620)
05-31 15:01:49.549 3135 3135 W libEGL : EGLNativeWindowType 0x733ca5d010 disconnect failed
05-31 15:01:49.562 6820 6820 I media.codec: mediacodecservice starting
05-31 15:01:49.562 6820 6820 W media.codec: No seccomp policy defined for this architecture.
05-31 15:01:49.566 6820 6820 E cutils-trace: Error opening trace file: No such file or directory (2)
05-31 15:01:49.566 6820 6820 I C2SoftwareCodecServiceRegistrant: Codec2's IComponentStore software service created.
05-31 15:01:49.566 6820 6820 E vndksupport: Could not load libstagefrighthw.so from default namespace: dlopen failed: library "libstagefrighthw.so" not found.
05-31 15:01:49.566 6820 6820 W MediaCodecsXmlParser: unable to open media codecs configuration xml file: /data/misc/media/media_codecs_profiling_results.xml
05-31 15:01:49.566 6820 6820 W MediaCodecsXmlParser: parseTopLevelXMLFile(/data/misc/media/media_codecs_profiling_results.xml) failed
05-31 15:01:49.566 6820 6820 I ServiceManagement: Removing namespace from process name android.hardware.media.omx#1.0-service to omx#1.0-service.
I need screen record to run using appium which will use ADB to perform screen recording
Update
adb screenrecord works when using android 11/12
still need to know why it doesn't work on android 9/10

Related

Pymodbus Asynchronous Server with RTU framer not working

I'm trying to implement a modbus asynchronous serial server with the library Pymodbus. I'm using a ModbusRtuFramer as a frame template. Unfortunately, when I send a command, it looks like the bytes are splitted and the frame is not recognized. I post both the code and the log.
StartSerialServer(context, identity=identity,
framer=ModbusRtuFramer,
port='/dev/ttyS2',
timeout=0.1,
baudrate=9600,
bytesize=8,
parity='N',
stopbits=1)
I send the command 03102c0002 (read 2 holding registers starting from address 102c. The log says:
DEBUG:pymodbus.server.asynchronous:Data Received: 0x1
DEBUG:pymodbus.framer.rtu_framer:Frame - [b'\x01'] not ready
DEBUG:pymodbus.server.asynchronous:Data Received: 0x3 0x10 0x2c
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x1 0x3 0x10 0x2c
DEBUG:pymodbus.server.asynchronous:Data Received: 0x0 0x2 0x1 0x2
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x0 0x2 0x1 0x2
DEBUG:pymodbus.server.asynchronous:Data Received: 0x1
DEBUG:pymodbus.framer.rtu_framer:Frame - [b'\x01'] not ready
DEBUG:pymodbus.server.asynchronous:Data Received: 0x3 0x10 0x2c
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x1 0x3 0x10 0x2c
DEBUG:pymodbus.server.asynchronous:Data Received: 0x0 0x2 0x1
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x0 0x2 0x1
DEBUG:pymodbus.server.asynchronous:Data Received: 0x2
DEBUG:pymodbus.framer.rtu_framer:Frame - [b'\x02'] not ready
DEBUG:pymodbus.server.asynchronous:Data Received: 0x1
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x2 0x1
DEBUG:pymodbus.server.asynchronous:Data Received: 0x3 0x10 0x2c 0x0
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x3 0x10 0x2c 0x0
DEBUG:pymodbus.server.asynchronous:Data Received: 0x2 0x1 0x2
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x2 0x1 0x2
DEBUG:pymodbus.server.asynchronous:Data Received: 0x1
DEBUG:pymodbus.framer.rtu_framer:Frame - [b'\x01'] not ready
DEBUG:pymodbus.server.asynchronous:Data Received: 0x3 0x10 0x2c
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x1 0x3 0x10 0x2c
DEBUG:pymodbus.server.asynchronous:Data Received: 0x0 0x2 0x1 0x2
DEBUG:pymodbus.framer.rtu_framer:Frame check failed, ignoring!!
DEBUG:pymodbus.framer.rtu_framer:Resetting frame - Current Frame in buffer - 0x0 0x2 0x1 0x2

flutter crush when plugin create new threads in java

I have a flutter projet, and I have created a plugin which will create new threads to do a task and return channel result (run a few seconds normal which can exec, ping or cmd for example).
In dart, when I call the plugin a few times (5, 10, 20..) at the same time recursively (each time will create few new threads in java), the app will crash after a random amount of time and output an error. I don't know where the problem is.
The method channel response is returned in the new thread, I print the Thread.activeNumber, it stays between 21 and 25 when I call the plugin 5 times each loop, therefore the thread number has not grown.
Here is an excerpt from my plugin code:
try {
Thread thread = new Thread(new Runnable() {
#Override
public void run() {
res.success(doCURLRequest(input));
return;
}
});
thread.start();
} catch (Exception e) {
e.printStackTrace();
result.error(e.toString(), "", null);
}
This is what the console outputs:
F/libc (25280): Fatal signal 11 (SIGSEGV), code 1, fault addr
0x1f0ffed65f03d0 in tid 25280 (nieben.yiqice)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'HONOR/LLD-AL30/HWLLD-H2:8.0.0/HONORLLD-
AL30/133(C00):user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 25280, tid: 25280, name: nieben.yiqice >>> nieben.yiqice <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1f0ffed65f03d0
x0 0000000000000060 x1 0000007c8f437dc0 x2 0000007c8f400000 x3 0000000000000006
x4 0000000000000037 x5 0000007fc10ce078 x6 0000007cb8f23000 x7 0000000022794276
x8 0000007c96de9898 x9 0000000000000016 x10 0000000000000016 x11 0000000000000009
x12 0000007c965a0c40 x13 0000000000000010 x14 0000007c965a0c40 x15 f81f0ffed65f03c0
x16 000000009109c108 x17 0000007cb7ce7948 x18 000000001a5a3a48 x19 0000007cb417f388
x20 0000000000000017 x21 0000000000000017 x22 000000000000000b x23 0000000000000044
x24 000000000000000b x25 0000007cb417f398 x26 0000007cb40ade70 x27 0000007ca9a0e818
x28 0000000000000040 x29 0000007ca9a0e818 x30 0000007c965b4810
sp 0000007fc10ce0f0 pc 0000007c96cee860 pstate 0000000020000000
backtrace:
#00 pc 00000000013e6860 /data/app/nieben.yiqice-kHJTi3gGe9hMTdLsxaaXXQ==/lib/arm64/libflutter.so (offset 0xc90000)
#01 pc 0000000000cac80c /data/app/nieben.yiqice-kHJTi3gGe9hMTdLsxaaXXQ==/lib/arm64/libflutter.so (offset 0xc90000)
#02 pc 0000000000cac540 /data/app/nieben.yiqice-kHJTi3gGe9hMTdLsxaaXXQ==/lib/arm64/libflutter.so (offset 0xc90000)
#03 pc 0000000000cac260 /data/app/nieben.yiqice-kHJTi3gGe9hMTdLsxaaXXQ==/lib/arm64/libflutter.so (offset 0xc90000)
#04 pc 0000000000ce6154 /data/app/nieben.yiqice-kHJTi3gGe9hMTdLsxaaXXQ==/lib/arm64/libflutter.so (offset 0xc90000)
#05 pc 0000000000cb9d60 /data/app/nieben.yiqice-kHJTi3gGe9hMTdLsxaaXXQ==/lib/arm64/libflutter.so (offset 0xc90000)
#06 pc 0000000000cbba94 /data/app/nieben.yiqice-kHJTi3gGe9hMTdLsxaaXXQ==/lib/arm64/libflutter.so (offset 0xc90000)
#07 pc 0000000000015f18 /system/lib64/libutils.so (_ZN7android6Looper9pollInnerEi+808)
#08 pc 0000000000015b68 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+108)
#09 pc 000000000011b31c /system/lib64/libandroid_runtime.so (_ZN7androidL38android_os_MessageQueue_nativePollOnceEP7_JNIEnvP8_jobjectli+44)
#10 pc 000000000082769c /system/framework/arm64/boot-framework.oat (offset 0x626000) (android.app.NativeActivity.onWindowFocusChangedNative [DEDUPED]+140)
#11 pc 0000000000015c50 /dev/ashmem/dalvik-jit-code-cache (deleted)
Another output from a similar test:
F/libc (23487): Fatal signal 7 (SIGBUS), code 1, fault addr 0x63656600000029 in t
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'HONOR/LLD-AL30/HWLLD-H2:8.0.0/HONORLLD-AL30/133(C00):user/releas
Revision: '0'
ABI: 'arm64'
pid: 23487, tid: 23533, name: Thread-16 >>> nieben.yiqice <<<
signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x63656600000029
x0 0000007c8ebeb6e0 x1 0000007cb7ce6c00 x2 0000000000000000 x3 000000
x4 0000000000000099 x5 0000000000000000 x6 0000007cb8f23000 x7 000000
x8 7463656600000029 x9 0000000000000002 x10 0000000000000001 x11 000000
x12 0000000000000000 x13 ffffffffffffffb0 x14 000026254eac6a09 x15 00000f
x16 0000007c96f166a0 x17 0000007cb7ce7948 x18 0000000000000179 x19 000000
x20 0000007c92fc3248 x21 0000007c8ebeb6e0 x22 0000007c92fc3240 x23 000000
x24 0000007c874a5a00 x25 0000000000000050 x26 0000007c874a6000 x27 000000
x28 0000000000000002 x29 0000007cb402db78 x30 0000007c96694aa8
sp 0000007c959bf000 pc 0063656600000029 pstate 0000000060000000
backtrace:
#00 pc 0063656600000029 <unknown>
#01 pc 0000000000cd4aa4 /data/app/nieben.yiqice-kCfddpl3R270LR1KEPCNIw==/lib/ar
#02 pc 0000000000cb9d60 /data/app/nieben.yiqice-kCfddpl3R270LR1KEPCNIw==/lib/ar
#03 pc 0000000000cbba94 /data/app/nieben.yiqice-kCfddpl3R270LR1KEPCNIw==/lib/ar
#04 pc 0000000000015f18 /system/lib64/libutils.so (_ZN7android6Looper9pollInner
#05 pc 0000000000015b68 /system/lib64/libutils.so (_ZN7android6Looper8pollOnceE
#06 pc 0000000000013944 /system/lib64/libandroid.so (ALooper_pollOnce+92)
#07 pc 0000000000cbbb64 /data/app/nieben.yiqice-kCfddpl3R270LR1KEPCNIw==/lib/ar
#08 pc 0000000000cb8d7c /data/app/nieben.yiqice-kCfddpl3R270LR1KEPCNIw==/lib/ar
#09 pc 0000000000cba2e4 /data/app/nieben.yiqice-kCfddpl3R270LR1KEPCNIw==/lib/ar
#10 pc 00000000000671b8 /system/lib64/libc.so (_ZL15__pthread_startPv+36)
#11 pc 000000000001eee4 /system/lib64/libc.so (__start_thread+68)

Perl errors while trying to replace words in a large file

I have a huge 1.1 GB File. It contains only 1 line and 1167889705 characters. I want to replace all the occurences of "LFENT" by "\nLFENT".
I am using
perl 5, version 18, subversion 1 (v5.18.1) built for x86_64-linux –
Perl Script
perl -ne 's/LFENT/\nLFENT/g; print;' queries.txt
Sample
22 serialization::archive 10 0 0 0 0 134477 0 0 0 9 LFENT_1_1 6 LFDOC1 20 documents/LFDOC1.xml 6 PERSON 12 barack obama 0 0 1 0 12 barack obama 0 0 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236 0.12948024 20390 0.12416928 20795 0.11188922 23777 0.13165452 23887 0.10065161 27644 0.1620737 73361 0.16295943 75521 0.17926371 9 LFENT_1_2 6 LFDOC1 20 documents/LFDOC1.xml 6 PERSON 5 obama 2 0 12 barack obama 5 obama 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236 0.12948024 20390 0.12416928 20795 0.11188922 23777 0.13165452 23887 0.10065161 27644 0.1620737 73361 0.16295943 75521 0.17926371 9 LFENT_1_3 6 LFDOC1 20 documents/LFDOC1.xml 4 MISC 8 american 1 0 8 american 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236
Problem
The script will work on the sample that I posted. But when I try it on the whole line I get the following error:
Substitution loop at -e line 1, <> line 1.
It is simplest to use LFENT as the record separator. That reduces the blocks to a more manageable size and ensures that there is no more than one LFENT to be replaced in each block
Command-line perl allows for setting the record separator with the -0 modifier, but the value of the parameter must be the code point in octal of a single character, and you can't specify a string. So here you have to set it once in a BEGIN block
Like this
perl -p -e'BEGIN{$/="LFENT"} s/LFENT/\nLFENT/'
output
22 serialization::archive 10 0 0 0 0 134477 0 0 0 9
LFENT_1_1 6 LFDOC1 20 documents/LFDOC1.xml 6 PERSON 12 barack obama 0 0 1 0 12 barack obama 0 0 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236 0.12948024 20390 0.12416928 20795 0.11188922 23777 0.13165452 23887 0.10065161 27644 0.1620737 73361 0.16295943 75521 0.17926371 9
LFENT_1_2 6 LFDOC1 20 documents/LFDOC1.xml 6 PERSON 5 obama 2 0 12 barack obama 5 obama 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236 0.12948024 20390 0.12416928 20795 0.11188922 23777 0.13165452 23887 0.10065161 27644 0.1620737 73361 0.16295943 75521 0.17926371 9
LFENT_1_3 6 LFDOC1 20 documents/LFDOC1.xml 4 MISC 8 american 1 0 8 american 6 LFDOC1 0 76 127 0.11599133 151 0.11042373 331 0.057491675 389 0.05621225 396 0.065223008 398 0.12416559 421 0.10331947 502 0.055213902 641 0.08908961 642 0.084330745 690 0.11456303 699 0.16876614 720 0.080576144 791 0.077269703 792 0.077503696 849 0.08224529 854 0.074629158 1028 0.11078026 1039 0.091981322 1300 0.070129424 1359 0.06072164 1390 0.05564769 1424 0.076605573 1461 0.15357952 1467 0.083702087 1583 0.069745384 1960 0.088143557 2118 0.064093992 2192 0.054430917 2304 0.089718938 2417 0.10173298 2436 0.069064997 2683 0.12296619 2700 0.068218805 2715 0.14005794 2786 0.084942013 3016 0.08474879 3113 0.083180025 3183 0.07413847 3202 0.081254445 3351 0.21241546 3587 0.061469007 3711 0.068944298 3949 0.10349752 5284 0.087500088 5775 0.092185706 5816 0.20625457 6320 0.11784423 6435 0.076852165 6794 0.094336778 6805 0.063363358 6946 0.11133534 7277 0.074097082 7588 0.12458359 7590 0.099151991 7629 0.28773388 7790 0.1194713 8137 0.11009126 8214 0.10754209 8889 0.12056628 9326 0.13841057 9701 0.25610805 9863 0.11877144 9908 0.11499001 10500 0.12205271 11917 0.11144774 12750 0.11285295 13453 0.13751692 19236[Finished in 0.2s]
By the way, it is unlikely to cause a problem but LFENT is always preceded by a space character in your example data. You may want to remove it by using s/\s*LFENT/\nLFENT for your substitution
And a look-ahead might be more appropriate too s/\s*(?=LFENT)/\n/ so that you don't have to remove and replace the unchanged part of the match
Try updating your perl to a more current version.
This was a known bug for a long time (fixed in v5.22.0): perl #123071: substitution loop issue with long strings
You can do so with the following commands (assuming you are on linux):
wget http://www.cpan.org/src/5.0/perl-5.22.1.tar.gz
tar -xzf perl-5.22.1.tar.gz
cd perl-5.22.1
./Configure -des -Dprefix=$HOME/localperl
make
make test
make install
Then test it by running $HOME/localperl/bin/perl -v and add it to your PATH using this: export PATH=$HOME/localperl/bin/:$PATH.

Unity3d and probably NGUI causing crash on nexus 6 (5.1)

I am getting following crash just on Nexus 6(5.1 OS) device. I am unable to make out what is causing this kind of crash and how to approach it. Will appreciate any help.
Unity3d version : 4.6.5f1
NGUI version: 2.6.4
Crashlog from device:
05-12 11:22:02.401: E/chromium(7468): ### WebView Version 42.0.2311.138 (code 2311138)
05-12 11:22:02.401: E/chromium(7468): --------- beginning of crash
05-12 11:22:02.401: A/libc(7468): Fatal signal 11 (SIGSEGV), code -6, fault addr 0x1d2c in tid 7489 (main)
05-12 11:22:02.474: I/DEBUG(353): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-12 11:22:02.474: I/DEBUG(353): Build fingerprint: 'google/shamu/shamu:5.1/LMY47I/1767468:user/release-keys'
05-12 11:22:02.474: I/DEBUG(353): Revision: '33696'
05-12 11:22:02.474: I/DEBUG(353): ABI: 'arm'
05-12 11:22:02.474: I/DEBUG(353): pid: 7468, tid: 7489, name: main >>> com.xxx.xxxx <<<
05-12 11:22:02.474: I/DEBUG(353): signal 11 (SIGSEGV), code -6 (SI_TKILL), fault addr 0xc
05-12 11:22:02.506: I/DEBUG(353): r0 858fe2b0 r1 00000052 r2 00000052 r3 00000000
05-12 11:22:02.506: I/DEBUG(353): r4 858fe2b0 r5 00000052 r6 00000052 r7 aad91da0
05-12 11:22:02.506: I/DEBUG(353): r8 af3e9150 r9 af3e9138 sl 00000003 fp aefb5a00
05-12 11:22:02.506: I/DEBUG(353): ip 00000000 sp af3e90c0 lr aac2a577 pc aacbe97c cpsr 200b0030
05-12 11:22:02.507: I/DEBUG(353): backtrace:
05-12 11:22:02.507: I/DEBUG(353): #00 pc 0017797c /system/vendor/lib/egl/libGLESv2_adreno.so (EsxCmdBuf::GetSpace(unsigned int)+15)
05-12 11:22:02.507: I/DEBUG(353): #01 pc 000e3573 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxFramebufferObject::LoadStoreCmdBufGetSpace(EsxCmdBufType, unsigned int)+42)
05-12 11:22:02.507: I/DEBUG(353): #02 pc 00174ba5 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxBltLib::StoreBin(EsxFramebufferObject*, EsxRenderingLayout const*, unsigned int)+108)
05-12 11:22:02.507: I/DEBUG(353): #03 pc 00116881 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::processAndSubmitRendering(EsxFlushReason)+3936)
05-12 11:22:02.507: I/DEBUG(353): #04 pc 00177435 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxCmdMgr::Flush(EsxFlushReason)+412)
05-12 11:22:02.508: I/DEBUG(353): #05 pc 0011693d /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::SwapBuffers(EsxRect const*, unsigned int, EglResourceAccessInfo*)+140)
05-12 11:22:02.508: I/DEBUG(353): #06 pc 0011dd43 /system/vendor/lib/egl/libGLESv2_adreno.so (EglContext::SwapBuffers(EsxRect const*, unsigned int, EglResourceAccessInfo*)+54)
05-12 11:22:02.508: I/DEBUG(353): #07 pc 0011ae89 /system/vendor/lib/egl/libGLESv2_adreno.so (EglApi::SwapBuffers(void*, void*)+140)
05-12 11:22:02.508: I/DEBUG(353): #08 pc 00005dc5 /system/vendor/lib/egl/libEGL_adreno.so (eglSwapBuffers+28)
05-12 11:22:02.508: I/DEBUG(353): #09 pc 0001237f /system/lib/libEGL.so (eglSwapBuffers+290)
05-12 11:22:02.508: I/DEBUG(353): #10 pc 003cee58 /data/app/com.xxx.xxxx-1/lib/arm/libunity.so
05-12 11:22:02.509: I/DEBUG(353): #11 pc 003d4374 /data/app/com.xxx.xxxx-1/lib/arm/libunity.so
05-12 11:22:02.509: I/DEBUG(353): #12 pc 0039ef74 /data/app/com.xxx.xxxx-1/lib/arm/libunity.so
05-12 11:22:02.509: I/DEBUG(353): #13 pc 001fc76c /data/app/com.xxx.xxxx-1/lib/arm/libunity.so
05-12 11:22:02.509: I/DEBUG(353): #14 pc 002a0124 /data/app/com.xxx.xxxx-1/lib/arm/libunity.so
05-12 11:22:02.509: I/DEBUG(353): #15 pc 003d24e4 /data/app/com.xxx.xxxx-1/lib/arm/libunity.so
05-12 11:22:02.509: I/DEBUG(353): #16 pc 003de1b0 /data/app/com.xxx.xxxx-1/lib/arm/libunity.so
05-12 11:22:02.509: I/DEBUG(353): #17 pc 0067a5af /data/dalvik-cache/arm/data#app#com.xxx.xxxx-1#base.apk#classes.dex
05-12 11:22:03.064: I/AudioFlinger(356): BUFFER TIMEOUT: remove(4097) from active list on thread 0xb59c4000
You got fault addr 0xc, r3 00000000, is not exactly the same as my case.
In my case, it happens when there are no objects rendered on camera, and camera.targetTexture has been set to aRenderTexture, Destroy(aRenderTexture) will crash.
Fix Code 1 (not recommend but works):
Destroy(aRenderTexture, 1.0f)
Fix Code 2 (maybe a better way, attach the follow script on your crashed camera):
using UnityEngine;
[RequireComponent (typeof (Camera))]
public class CrashFix : MonoBehaviour {
void Awake () {
Camera _cam = gameObject.GetComponent<Camera>();
GameObject _invisibleObj = GameObject.CreatePrimitive(PrimitiveType.Quad);
_invisibleObj.name = "CrashFix";
_invisibleObj.layer = GetFirstLayerNumberFromMask(_cam.cullingMask);
_invisibleObj.transform.parent = gameObject.transform;
_invisibleObj.transform.localScale = new Vector3(0.001f, 0.001f, 0.001f);
_invisibleObj.transform.position =
_cam.transform.position + _cam.transform.forward * (_cam.nearClipPlane+_cam.farClipPlane)/2f;
Material _mat = new Material(Shader.Find("UI/Default"));
_mat.color = new Color32(0,0,0,0);
var mr = _invisibleObj.GetComponent<MeshRenderer>();
mr.sharedMaterial = _mat;
Destroy(_invisibleObj.GetComponent<Collider>());
}
private int GetFirstLayerNumberFromMask(int mask)
{
if (mask == 0) return 0;
int result = 0;
while(true){
if ((mask & 1) == 1) return result;
mask >>= 1;
++result;
}
}
}

Getting exit code of a terminated process

I'm debugging a process in WinDbg, and the process exited:
0:009> g
(bunch of regs...)
ntdll!NtTerminateProcess+0xc:
770ad43c c20800 ret 8
0:009> g
^ No runnable debuggees error in 'g'
At this point, how do I get the process' exit code?
You could find it as the second argument of ZwTerminateProcess. NtTerminateProcess is just the kernel version of it, right?
0:000> kb
ChildEBP RetAddr Args to Child
003ff414 7774d5ac ffffffff 1234abcd 00000000 ntdll!ZwTerminateProcess+0x12
003ff430 759c79ec 00000000 77e8f3b0 ffffffff ntdll!RtlExitUserProcess+0x85
...
Or the fourth parameter of RtlExitUserProcess
0:000> kn
# ChildEBP RetAddr
00 003ff414 7774d5ac ntdll!ZwTerminateProcess+0x12
01 003ff430 759c79ec ntdll!RtlExitUserProcess+0x85
...
0:000> .frame 01
01 003ff430 759c79ec ntdll!RtlExitUserProcess+0x85
0:000> dd esp L4
003ff414 7771fcc2 7774d5ac ffffffff 1234abcd