saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
2.96k stars 1.19k forks source link

Frequent crash "libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7c0531e848 in tid 23405 (CameraThread), pid 23242 (.usbcameratest8)" #640

Open zipswich opened 2 years ago

zipswich commented 2 years ago

Preview frequently causes a crash: 2022-02-22 18:18:26.025 23242-23405/com.serenegiant.usbcameratest8 A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7c0531e848 in tid 23405 (CameraThread), pid 23242 (.usbcameratest8)

I wonder if anyone could shed some light on this crash.

Complete logcat:

2022-02-22 18:22:49.218 684-684/? I/chatty: uid=1000(system) /system/bin/surfaceflinger expire 1 line
2022-02-22 18:22:49.219 684-684/? I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2022-02-22 18:22:50.281 24349-24349/com.serenegiant.usbcameratest8 V/MainActivity: onDialogResult:canceled=false
2022-02-22 18:22:50.292 24349-24375/com.serenegiant.usbcameratest8 D/UsbDeviceConnectionJNI: close
2022-02-22 18:22:50.296 24349-24375/com.serenegiant.usbcameratest8 I/USBMonitor: name=/dev/bus/usb/001/094,desc=71,busnum=1,devnum=94,rawDesc=[B@ab3fca2
2022-02-22 18:22:50.296 24349-24375/com.serenegiant.usbcameratest8 V/MainActivity: onConnect:
2022-02-22 18:22:50.296 24349-24378/com.serenegiant.usbcameratest8 V/CameraThread: handleOpen:
2022-02-22 18:22:50.297 24349-24378/com.serenegiant.usbcameratest8 V/CameraThread: handleClose:
2022-02-22 18:22:50.297 24349-24378/com.serenegiant.usbcameratest8 V/CameraThread: handleStopRecording:mMuxer=null
2022-02-22 18:22:50.297 24349-24378/com.serenegiant.usbcameratest8 V/UVCCameraTextureView: setVideoEncoder:
2022-02-22 18:22:50.298 24349-24375/com.serenegiant.usbcameratest8 V/UVCCameraTextureView: getPreviewTexture:
2022-02-22 18:22:50.298 24349-24383/com.serenegiant.usbcameratest8 D/OpenGLRenderer: endAllActiveAnimators on 0x7c86513600 (RippleDrawable) with handle 0x7c8516a640
2022-02-22 18:22:50.298 24349-24384/com.serenegiant.usbcameratest8 V/UVCCameraTextureView: RenderThread#setEncoder:encoder=null
2022-02-22 18:22:50.299 24349-24384/com.serenegiant.usbcameratest8 I/UVCCameraTextureView: RenderThread#updatePreviewSurface:
2022-02-22 18:22:50.299 24349-24384/com.serenegiant.usbcameratest8 V/UVCCameraTextureView: updatePreviewSurface:tex_id=1
2022-02-22 18:22:50.341 24349-24378/com.serenegiant.usbcameratest8 D/UsbDeviceConnectionJNI: close
2022-02-22 18:22:50.341 24349-24378/com.serenegiant.usbcameratest8 I/libusb/core: [24378*core.c:2085:libusb_init2]:libusb v1.0.19.10903
2022-02-22 18:22:50.341 24349-24378/com.serenegiant.usbcameratest8 I/libusb/usbfs: [24378*android_usbfs.c:504:op_init2]:start up hotplug event handler
2022-02-22 18:22:50.341 24349-24378/com.serenegiant.usbcameratest8 I/libusb/usbfs: [24378*android_usbfs.c:512:op_init2]:call android_scan_devices
2022-02-22 18:22:50.344 969-1232/? I/CameraProviderManager: Camera device device@3.4/external//dev/video6 status is now NOT_PRESENT, was PRESENT
2022-02-22 18:22:50.344 969-1232/? I/CameraService: onDeviceStatusChanged: Status changed for cameraId=/dev/video6, newStatus=0
2022-02-22 18:22:50.345 969-1232/? W/CameraService: removeClientLocked: Could not evict client, no client for camera ID /dev/video6
2022-02-22 18:22:50.345 969-1232/? W/CameraFlashlight: hasFlashUnitLocked: camera /dev/video6 not present when findFlashUnits() was called
2022-02-22 18:22:50.345 1293-1390/? I/EventHub: Removing device '/dev/input/event10' due to inotify event
2022-02-22 18:22:50.345 1293-1390/? I/EventHub: Removed device: path=/dev/input/event10 name=USB 2.0 Camera id=671 fd=174 classes=0x80000001
2022-02-22 18:22:50.346 1293-1390/? I/InputReader: Device removed: id=671, name='USB 2.0 Camera', sources=0x00000101
2022-02-22 18:22:50.349 24349-24378/com.serenegiant.usbcameratest8 I/AbsUVCCameraHandler: supportedSize:{"formats":[{"index":1,"type":6,"default":1,"size":["2320x1744","4656x3496","4208x3120","4160x3120","4000x3000","3264x2448","2592x1944","2048x1536","1920x1080","1600x1200","1280x960","1280x720","1024x768","800x600","640x480","2320x1744"]},{"index":2,"type":4,"default":1,"size":["2320x1744","4656x3496","1920x1080","1280x720","1024x768","800x600","640x480","2320x1744"]}]}
2022-02-22 18:22:50.349 24349-24378/com.serenegiant.usbcameratest8 V/CameraThread: handleStartPreview:
2022-02-22 18:22:50.359 24349-24432/com.serenegiant.usbcameratest8 I/libUVCCamera: [24432*UVCPreview.cpp:519:prepare_preview]:frameSize=(4656,3496)@MJPEG
2022-02-22 18:22:50.362 24349-24434/com.serenegiant.usbcameratest8 I/libUVCCamera: [24434*UVCPreview.cpp:264:callbackPixelFormatChanged]:PIXEL_FORMAT_RAW:
2022-02-22 18:22:50.471 684-1743/? W/SurfaceFlinger: Attempting to set client state on removed layer: com.serenegiant.usbcameratest8/com.serenegiant.usbcameratest8.MainActivity#1
2022-02-22 18:22:50.471 684-1743/? W/SurfaceFlinger: Attempting to set client state on removed layer: Dim Layer for - Task=938#0
2022-02-22 18:22:50.471 684-1743/? W/SurfaceFlinger: Attempting to destroy on removed layer: com.serenegiant.usbcameratest8/com.serenegiant.usbcameratest8.MainActivity#1
2022-02-22 18:22:50.471 684-1743/? W/SurfaceFlinger: Attempting to destroy on removed layer: Dim Layer for - Task=938#0
2022-02-22 18:22:50.569 684-684/? I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2022-02-22 18:22:51.238 684-684/? I/chatty: uid=1000(system) /system/bin/surfaceflinger identical 2 lines
2022-02-22 18:22:51.239 684-684/? I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2022-02-22 18:22:51.383 24349-24433/com.serenegiant.usbcameratest8 W/libUVCCamera: [24433*UVCPreview.cpp:125:get_frame]:allocate new frame
2022-02-22 18:22:51.385 24349-24432/com.serenegiant.usbcameratest8 W/libUVCCamera: [24432*UVCPreview.cpp:125:get_frame]:allocate new frame
2022-02-22 18:22:51.466 950-950/? I/wmt_apkhideicon_service: wmt copy_wmt_ApkHideIcon 
2022-02-22 18:22:51.481 24349-24433/com.serenegiant.usbcameratest8 W/libUVCCamera: [24433*UVCPreview.cpp:125:get_frame]:allocate new frame
2022-02-22 18:22:51.530 24349-24432/com.serenegiant.usbcameratest8 I/libUVCCamera: [24432*UVCPreview.cpp:571:do_preview]:Before draw_preview_one...................................
2022-02-22 18:22:51.583 24349-24433/com.serenegiant.usbcameratest8 W/libUVCCamera: [24433*UVCPreview.cpp:125:get_frame]:allocate new frame
2022-02-22 18:22:51.687 24349-24433/com.serenegiant.usbcameratest8 A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 24433 (CameraThread), pid 24349 (.usbcameratest8)
2022-02-22 18:22:51.795 24439-24439/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2022-02-22 18:22:51.796 1112-1112/? I//system/bin/tombstoned: received crash request for pid 24433
2022-02-22 18:22:51.797 24439-24439/? I/crash_dump64: performing dump of process 24349 (target tid = 24433)
2022-02-22 18:22:51.801 24349-24432/com.serenegiant.usbcameratest8 I/libUVCCamera: [24432*UVCPreview.cpp:571:do_preview]:Before draw_preview_one...................................
2022-02-22 18:22:51.810 24439-24439/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-02-22 18:22:51.810 24439-24439/? A/DEBUG: Build fingerprint: 'Android/sdm660_64/sdm660_64:9/PKQ1.190319.001/sw09090959:user/release-keys'
2022-02-22 18:22:51.810 24439-24439/? A/DEBUG: Revision: '0'
2022-02-22 18:22:51.810 24439-24439/? A/DEBUG: ABI: 'arm64'
2022-02-22 18:22:51.810 24439-24439/? A/DEBUG: pid: 24349, tid: 24433, name: CameraThread  >>> com.serenegiant.usbcameratest8 <<<
2022-02-22 18:22:51.810 24439-24439/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
2022-02-22 18:22:51.810 24439-24439/? A/DEBUG: Cause: null pointer dereference
2022-02-22 18:22:51.810 24439-24439/? A/DEBUG:     x0  0000007ca2292358  x1  0000007c80604c70  x2  00000000000000ae  x3  0000000000000000
2022-02-22 18:22:51.811 24439-24439/? A/DEBUG:     x4  0000000000000000  x5  00000000000000a1  x6  0000000000000000  x7  0000007c97eaa800
2022-02-22 18:22:51.811 24439-24439/? A/DEBUG:     x8  0000000000000000  x9  0000000000000000  x10 0000000000000000  x11 7000000000000000
2022-02-22 18:22:51.811 24439-24439/? A/DEBUG:     x12 0000007c80605150  x13 0000007c80604c70  x14 0000007c80604c70  x15 004b3a0000000000
2022-02-22 18:22:51.811 24439-24439/? A/DEBUG:     x16 0000007d26cd01b8  x17 0000007d26c53b50  x18 0000000000000010  x19 0000007c80600000
2022-02-22 18:22:51.811 24439-24439/? A/DEBUG:     x20 0000000000000000  x21 0000007ca228fc00  x22 00000000000000ae  x23 00000000000000a1
2022-02-22 18:22:51.811 24439-24439/? A/DEBUG:     x24 0000000000000000  x25 0007f928f907f887  x26 0000007d26cdc000  x27 0000007d26cdc8d8
2022-02-22 18:22:51.811 24439-24439/? A/DEBUG:     x28 0007f928f907f928  x29 0000007c84b831e0
2022-02-22 18:22:51.811 24439-24439/? A/DEBUG:     sp  0000007c84b83190  lr  0000007d26c629e8  pc  0000007d26c62dd0
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG: backtrace:
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #00 pc 00000000000a1dd0  /system/lib64/libc.so (arena_run_heap_remove+600)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #01 pc 00000000000a19e4  /system/lib64/libc.so (arena_run_split_remove+376)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #02 pc 00000000000a1604  /system/lib64/libc.so (arena_run_split_large_helper+236)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #03 pc 000000000009a0d4  /system/lib64/libc.so (je_arena_malloc_large+156)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #04 pc 000000000009ce14  /system/lib64/libc.so (je_arena_ralloc+2216)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #05 pc 00000000000b4988  /system/lib64/libc.so (je_realloc+272)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #06 pc 000000000000b0e0  /data/app/com.serenegiant.usbcameratest8-H1FRgIkmFy9QiIYf2qNmKw==/base.apk (offset 0x143000) (uvc_duplicate_frame+388)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #07 pc 0000000000013650  /data/app/com.serenegiant.usbcameratest8-H1FRgIkmFy9QiIYf2qNmKw==/base.apk (offset 0x1000) (UVCPreview::uvc_preview_frame_callback(uvc_frame*, void*)+148)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #08 pc 00000000000138f4  /data/app/com.serenegiant.usbcameratest8-H1FRgIkmFy9QiIYf2qNmKw==/base.apk (offset 0x143000)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #09 pc 0000000000092090  /system/lib64/libc.so (__pthread_start(void*)+36)
2022-02-22 18:22:51.814 24439-24439/? A/DEBUG:     #10 pc 000000000002393c  /system/lib64/libc.so (__start_thread+68)
2022-02-22 18:22:52.042 945-945/? I/wmt_sn_service: wmt write sn for android doctor error 
2022-02-22 18:22:52.210 1112-1112/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_06
2022-02-22 18:22:52.224 684-684/? I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
riccardoPegaso commented 2 years ago

The issue doesn't match the logcat. Is it ACCERR o MAPERR? Because i solved ACCERR on my setup, but I don't know if that applies to your situation.

zipswich commented 2 years ago

@riccardoPegaso Thank you for catching that. I have corrected it. It is SEGV_MAPERR.

zipswich commented 2 years ago

@riccardoPegaso I have just realized that there are two types of crashes. The other one is related to SEGV_ACCERR. Could you tell me how you addressed the problem?

2022-02-25 13:13:44.736 684-2231/? W/SurfaceFlinger: Attempting to set client state on removed layer: com.serenegiant.usbcameratest8/com.serenegiant.usbcameratest8.MainActivity#1
2022-02-25 13:13:44.736 684-2231/? W/SurfaceFlinger: Attempting to destroy on removed layer: com.serenegiant.usbcameratest8/com.serenegiant.usbcameratest8.MainActivity#1
2022-02-25 13:13:44.753 684-2231/? W/SurfaceFlinger: Attempting to set client state on removed layer: Dim Layer for - Task=985#0
2022-02-25 13:13:44.753 684-2231/? W/SurfaceFlinger: Attempting to destroy on removed layer: Dim Layer for - Task=985#0
2022-02-25 13:13:44.795 15591-15653/com.serenegiant.usbcameratest8 W/libUVCCamera: [15653*UVCPreview.cpp:125:get_frame]:allocate new frame
2022-02-25 13:13:44.796 15591-15652/com.serenegiant.usbcameratest8 W/libUVCCamera: [15652*UVCPreview.cpp:125:get_frame]:allocate new frame
2022-02-25 13:13:44.805 950-950/? I/wmt_apkhideicon_service: wmt copy_wmt_ApkHideIcon 
2022-02-25 13:13:44.841 15591-15652/com.serenegiant.usbcameratest8 A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7cbf333334 in tid 15652 (CameraThread), pid 15591 (.usbcameratest8)
2022-02-25 13:13:44.851 684-684/? I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2022-02-25 13:13:44.852 684-684/? I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2022-02-25 13:13:44.898 15591-15653/com.serenegiant.usbcameratest8 W/libUVCCamera: [15653*UVCPreview.cpp:125:get_frame]:allocate new frame
2022-02-25 13:13:44.946 15659-15659/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2022-02-25 13:13:44.947 1112-1112/? I//system/bin/tombstoned: received crash request for pid 15652
2022-02-25 13:13:44.948 15659-15659/? I/crash_dump64: performing dump of process 15591 (target tid = 15652)
2022-02-25 13:13:44.963 15659-15659/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG: Build fingerprint: 'Android/sdm660_64/sdm660_64:9/PKQ1.190319.001/sw09090959:user/release-keys'
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG: Revision: '0'
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG: ABI: 'arm64'
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG: pid: 15591, tid: 15652, name: CameraThread  >>> com.serenegiant.usbcameratest8 <<<
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7cbf333334
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     x0  0000000000001230  x1  0000007c82b95290  x2  0000000000000001  x3  0000007c84dc6f10
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     x4  0000000000000001  x5  0000007c82b959c8  x6  0000007c82b95280  x7  0000007cbf333334
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     x8  0000007c82baa4b0  x9  0000007c8513b430  x10 0000007c8513c830  x11 0000007c84fc2804
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     x12 0000000000000008  x13 0000000000000180  x14 0000007c82bbb282  x15 0000000000001220
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     x16 0000000000000000  x17 0000007c8513da4e  x18 0000007c82bbbb97  x19 0000007c82b95994
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     x20 0000007c84dc70f0  x21 0000007c84dc6ec4  x22 0000007c82b951e8  x23 0000000000000001
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     x24 0000007c82b95940  x25 0000007c82b94bc0  x26 0000007c82b951b0  x27 0000007c82b95180
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     x28 0000000000000003  x29 0000007c84dc6e60
2022-02-25 13:13:44.964 15659-15659/? A/DEBUG:     sp  0000007c84dc6e00  lr  0000007c84fab1cc  pc  0000007c84fc4244
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG: backtrace:
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #00 pc 0000000000044244  /data/app/com.serenegiant.usbcameratest8-tt80PRN4jHJ4X-nMuwuteg==/base.apk (offset 0x3000)
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #01 pc 000000000002b1c8  /data/app/com.serenegiant.usbcameratest8-tt80PRN4jHJ4X-nMuwuteg==/base.apk (offset 0x3000)
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #02 pc 0000000000023810  /data/app/com.serenegiant.usbcameratest8-tt80PRN4jHJ4X-nMuwuteg==/base.apk (offset 0x3000)
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #03 pc 000000000001afcc  /data/app/com.serenegiant.usbcameratest8-tt80PRN4jHJ4X-nMuwuteg==/base.apk (offset 0x3000) (jpeg_read_scanlines+152)
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #04 pc 0000000000011324  /data/app/com.serenegiant.usbcameratest8-tt80PRN4jHJ4X-nMuwuteg==/base.apk (offset 0x6b000) (uvc_mjpeg2rgbx+736)
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #05 pc 0000000000013c40  /data/app/com.serenegiant.usbcameratest8-tt80PRN4jHJ4X-nMuwuteg==/base.apk (offset 0x2e9000) (UVCPreview::do_preview(uvc_stream_ctrl*)+324)
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #06 pc 0000000000013450  /data/app/com.serenegiant.usbcameratest8-tt80PRN4jHJ4X-nMuwuteg==/base.apk (offset 0x2e9000) (UVCPreview::preview_thread_func(void*)+48)
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #07 pc 0000000000092090  /system/lib64/libc.so (__pthread_start(void*)+36)
2022-02-25 13:13:44.966 15659-15659/? A/DEBUG:     #08 pc 000000000002393c  /system/lib64/libc.so (__start_thread+68)
2022-02-25 13:13:45.104 15591-15653/com.serenegiant.usbcameratest8 W/libUVCCamera: [15653*UVCPreview.cpp:125:get_frame]:allocate new frame
2022-02-25 13:13:45.262 1112-1112/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_04
2022-02-25 13:13:45.268 1293-15662/? W/ActivityManager:   Force finishing activity com.serenegiant.usbcameratest8/.MainActivity
2022-02-25 13:13:45.273 1293-15662/? D/ActivityTrigger: ActivityTrigger activityPauseTrigger 
riccardoPegaso commented 2 years ago

I don't know if it the same issue. There might a problem when targeting SDK > 28 due to an issue present from Android 10 and forward due to XOM. (this was NOT my issue)

My issue was that the height of the frame wasn't multiple of 8, so the copyFrame function overflows.

static void copyFrame(const uint8_t *src, uint8_t *dest, const int width, int height, const int stride_src, const int stride_dest) { const int h8 = height % 8; for (int i = 0; i < h8; i++) { memcpy(dest, src, width); dest += stride_dest; src += stride_src; } for (int i = 0; i < (height - h8); i += 8) { memcpy(dest, src, width); dest += stride_dest; src += stride_src; memcpy(dest, src, width); dest += stride_dest; src += stride_src; memcpy(dest, src, width); dest += stride_dest; src += stride_src; memcpy(dest, src, width); dest += stride_dest; src += stride_src; memcpy(dest, src, width); dest += stride_dest; src += stride_src; memcpy(dest, src, width); dest += stride_dest; src += stride_src; memcpy(dest, src, width); dest += stride_dest; src += stride_src; memcpy(dest, src, width); dest += stride_dest; src += stride_src; } }

Adding -h8 on the second for fixes the issue

zipswich commented 2 years ago

@riccardoPegaso That is an excellent tip. I used your code as following:

static void copyFrame(const uint8_t *src, uint8_t *dest, const int width, int height, const int stride_src, const int stride_dest) {
    const int h8 = height % 8;
    for (int i = 0; i < h8; i++) {
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
    }
    for (int i = 0; i < (height - h8); i += 8) {
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
        memcpy(dest, src, width);
        dest += stride_dest; src += stride_src;
    }
}

My current crash is caused clear_pool():

void AbstractBufferedPipeline::clear_pool() {
    ENTER();

    Mutex::Autolock lock(pool_mutex);

    for (auto iter = frame_pool.begin(); iter != frame_pool.end(); iter++) {
        total_frame_num--;
        uvc_free_frame(*iter);
    }
    frame_pool.clear();
    EXIT();
}

uvc_free_frame(*iter) throws the following: Abort message: 'Invalid address 0x7c8240de40 passed to free: value not allocated'