Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unknown crash when getting a double[] from a Mat

I have been working with the OpenCV library (version 3.30) with Android, and occasionally there has been a crash when trying to retrieve the color information from a HSV image Mat. I've copied the logcat log below:

 03-08 09:44:04.219 15759-15759/com.example.administrator.grapeyield A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7f588bc448 in tid 15759 (ator.grapeyield)
03-08 09:44:04.309 3165-3165/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-08 09:44:04.309 3165-3165/? A/DEBUG: Build fingerprint: 'samsung/hero2ltexx/hero2lte:6.0.1/MMB29K/G935FXXU1BPL3:user/release-keys'
03-08 09:44:04.309 3165-3165/? A/DEBUG: Revision: '9'
03-08 09:44:04.309 3165-3165/? A/DEBUG: ABI: 'arm64'
03-08 09:44:04.309 3165-3165/? A/DEBUG: pid: 15759, tid: 15759, name: ator.grapeyield  >>> com.example.administrator.grapeyield <<<
03-08 09:44:04.309 3165-3165/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7f588bc448
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x0   0000007f588bc448  x1   0000000000000001  x2   0000000000000000  x3   0000000000000003
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x4   0000007ff4343cc0  x5   0000000000000003  x6   0000007ff4343cd8  x7   0000000000430000
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x8   0000000000000000  x9   0000007f7443a000  x10  0000007f7443c9a0  x11  0000000000000036
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x12  0000000000000000  x13  a625948a7a449dd8  x14  0000000000000001  x15  0000000000000000
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x16  0000007f7445a98c  x17  0000000000000000  x18  0000007f7445a988  x19  0000007f543eed60
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x20  0000007f746bd180  x21  000000000000001d  x22  ffffffffffffc448  x23  ffffffffffffc44b
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x24  0000000000000000  x25  00000000704fceb0  x26  0000000000000000  x27  0000000012c02040
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x28  0000280300003d8f  x29  0000280300003d8f  x30  0000007f52f373b0
03-08 09:44:04.349 3165-3165/? A/DEBUG:     sp   0000007ff4343c80  pc   0000007f52f37eac  pstate 0000000080000000
03-08 09:44:04.359 3165-3165/? A/DEBUG: backtrace:
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #00 pc 0000000000152eac  /data/app/com.example.administrator.grapeyield-2/lib/arm64/libopencv_java3.so (Java_org_opencv_core_Mat_nGet+2904)
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #01 pc 0000000000aa1220  /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (double[] org.opencv.core.Mat.nGet(long, int, int)+148)
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #02 pc 0000000000aaa544  /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (double[] org.opencv.core.Mat.get(int, int)+88)
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #03 pc 000000000094565c  /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (java.util.List com.example.administrator.grapeyield.utilities.CSVContentFormatter.getHueListOfBerry(org.opencv.core.Mat, org.opencv.core.Mat, int, int)+1232)
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #04 pc 0000000000917888  /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (void com.example.administrator.grapeyield.activities.White_wine_analysis_Activity.houghcircle_fiveranges(android.graphics.Bitmap)+45276)
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #05 pc 0000000000926528  /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (void com.example.administrator.grapeyield.activities.White_wine_analysis_Activity.volumedistPressed()+412)
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #06 pc 00000000008fb118  /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (void com.example.administrator.grapeyield.activities.White_wine_analysis_Activity$volumeDistTask.onPostExecute(java.lang.Void)+76)
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #07 pc 00000000008fb068  /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (void com.example.administrator.grapeyield.activities.White_wine_analysis_Activity$volumeDistTask.onPostExecute(java.lang.Object)+108)
03-08 09:44:04.369 3165-3165/? A/DEBUG:     #08 pc 0000000003d97824  /system/framework/arm64/boot.oat (offset 0x2f50000)
03-08 09:44:04.869 3165-3165/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_04
03-08 09:44:04.869 3165-3165/? E/DEBUG: AM write failed: Broken pipe

                                        [ 03-08 09:44:04.869  3165: 3165 E/         ]
                                        ro.product_ship = true

                                        [ 03-08 09:44:04.869  3165: 3165 E/         ]
                                        ro.debug_level = 0x4f4c

                                        [ 03-08 09:44:04.869  3165: 3165 E/         ]
                                        sys.mobilecare.preload = false
03-08 09:44:04.879 4909-4909/? E/audit: type=1701 msg=audit(1520462644.869:266): auid=4294967295 uid=10243 gid=10243 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=15759 comm="ator.grapeyield" exe="/system/bin/app_process64" sig=11
03-08 09:44:05.059 3536-3701/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
03-08 09:44:05.109 19356-19356/? E/Zygote: v2
03-08 09:44:05.119 19356-19356/? E/Zygote: accessInfo : 0
03-08 09:44:05.279 19356-19356/com.example.administrator.grapeyield E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV

For the life of me I haven't been able to find out what's been going on with this error, it only happens on rare occasions. Any ideas about what's going on here?

Unknown crash when getting a double[] from a Mat

I have been working with the OpenCV library (version 3.30) with Android, and occasionally there has been a crash when trying to retrieve the color information from a HSV image Mat. I've copied the logcat log below:

 03-08 09:44:04.219 15759-15759/com.example.administrator.grapeyield A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7f588bc448 in tid 15759 (ator.grapeyield)
03-08 09:44:04.309 3165-3165/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-08 09:44:04.309 3165-3165/? A/DEBUG: Build fingerprint: 'samsung/hero2ltexx/hero2lte:6.0.1/MMB29K/G935FXXU1BPL3:user/release-keys'
03-08 09:44:04.309 3165-3165/? A/DEBUG: Revision: '9'
03-08 09:44:04.309 3165-3165/? A/DEBUG: ABI: 'arm64'
03-08 09:44:04.309 3165-3165/? A/DEBUG: pid: 15759, tid: 15759, name: ator.grapeyield  >>> com.example.administrator.grapeyield <<<
03-08 09:44:04.309 3165-3165/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7f588bc448
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x0   0000007f588bc448  x1   0000000000000001  x2   0000000000000000  x3   0000000000000003
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x4   0000007ff4343cc0  x5   0000000000000003  x6   0000007ff4343cd8  x7   0000000000430000
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x8   0000000000000000  x9   0000007f7443a000  x10  0000007f7443c9a0  x11  0000000000000036
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x12  0000000000000000  x13  a625948a7a449dd8  x14  0000000000000001  x15  0000000000000000
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x16  0000007f7445a98c  x17  0000000000000000  x18  0000007f7445a988  x19  0000007f543eed60
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x20  0000007f746bd180  x21  000000000000001d  x22  ffffffffffffc448  x23  ffffffffffffc44b
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x24  0000000000000000  x25  00000000704fceb0  x26  0000000000000000  x27  0000000012c02040
03-08 09:44:04.349 3165-3165/? A/DEBUG:     x28  0000280300003d8f  x29  0000280300003d8f  x30  0000007f52f373b0
03-08 09:44:04.349 3165-3165/? A/DEBUG:     sp   0000007ff4343c80  pc   0000007f52f37eac  pstate 0000000080000000
03-08 09:44:04.359 3165-3165/? A/DEBUG: backtrace:
03-08 09:44:04.359 3165-3165/? A/DEBUG:     #00 pc 0000000000152eac  

/data/app/com.example.administrator.grapeyield-2/lib/arm64/libopencv_java3.so (Java_org_opencv_core_Mat_nGet+2904) 03-08 09:44:04.359 3165-3165/? A/DEBUG: #01 pc 0000000000aa1220 /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (double[] org.opencv.core.Mat.nGet(long, int, int)+148) 03-08 09:44:04.359 3165-3165/? A/DEBUG: #02 pc 0000000000aaa544 /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (double[] org.opencv.core.Mat.get(int, int)+88) 03-08 09:44:04.359 3165-3165/? A/DEBUG: #03 pc 000000000094565c /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (java.util.List com.example.administrator.grapeyield.utilities.CSVContentFormatter.getHueListOfBerry(org.opencv.core.Mat, org.opencv.core.Mat, int, int)+1232) 03-08 09:44:04.359 3165-3165/? A/DEBUG: #04 pc 0000000000917888 /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (void com.example.administrator.grapeyield.activities.White_wine_analysis_Activity.houghcircle_fiveranges(android.graphics.Bitmap)+45276) 03-08 09:44:04.359 3165-3165/? A/DEBUG: #05 pc 0000000000926528 /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (void com.example.administrator.grapeyield.activities.White_wine_analysis_Activity.volumedistPressed()+412) 03-08 09:44:04.359 3165-3165/? A/DEBUG: #06 pc 00000000008fb118 /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (void com.example.administrator.grapeyield.activities.White_wine_analysis_Activity$volumeDistTask.onPostExecute(java.lang.Void)+76) 03-08 09:44:04.359 3165-3165/? A/DEBUG: #07 pc 00000000008fb068 /data/app/com.example.administrator.grapeyield-2/oat/arm64/base.odex (offset 0x62f000) (void com.example.administrator.grapeyield.activities.White_wine_analysis_Activity$volumeDistTask.onPostExecute(java.lang.Object)+108) 03-08 09:44:04.369 3165-3165/? A/DEBUG: #08 pc 0000000003d97824 /system/framework/arm64/boot.oat (offset 0x2f50000) 03-08 09:44:04.869 3165-3165/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_04 03-08 09:44:04.869 3165-3165/? E/DEBUG: AM write failed: Broken pipe [ 03-08 09:44:04.869 3165: 3165 E/ ] ro.product_ship = true [ 03-08 09:44:04.869 3165: 3165 E/ ] ro.debug_level = 0x4f4c [ 03-08 09:44:04.869 3165: 3165 E/ ] sys.mobilecare.preload = false 03-08 09:44:04.879 4909-4909/? E/audit: type=1701 msg=audit(1520462644.869:266): auid=4294967295 uid=10243 gid=10243 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=15759 comm="ator.grapeyield" exe="/system/bin/app_process64" sig=11 03-08 09:44:05.059 3536-3701/? E/InputDispatcher: channel ~ Channel com.example.administrator.grapeyield.activities.White_wine_analysis_Activity$volumeDistTask.onPostExecute(java.lang.Object)+108)

My understanding of the log is unrecoverably broken and will be disposed! 03-08 09:44:05.109 19356-19356/? E/Zygote: v2 03-08 09:44:05.119 19356-19356/? E/Zygote: accessInfo : 0 03-08 09:44:05.279 19356-19356/com.example.administrator.grapeyield E/OpenCV/StaticHelper: OpenCV error: Cannot load info library that the error is occurring in the "getHueListOfBerry" method, which is below:

public static List<Integer> getHueListOfBerry(Mat circles, Mat oriImage, int row, int col){
        List<Integer> hueList = new ArrayList<Integer>();
        try {
            Mat hsvImage = new Mat();
            Imgproc.cvtColor(oriImage, hsvImage, Imgproc.COLOR_BGR2HSV);


            int radius = MatUtils.getRadius(circles, row, col);
            Point point = MatUtils.getPoint(circles, row, col);

            int jStart = (int) (point.x - radius);
            int kStart = (int) (point.y - radius);
            int jEnd = (int) (point.x + radius);
            int kEnd = (int) (point.y + radius);

            if (jStart < 0) {
                kStart = 0;
            }

            if (kStart < 0) {
                jStart = 0;
            }

            if (jEnd > oriImage.rows()) {
                jEnd = oriImage.rows() - 1;
            }

            if (kEnd > oriImage.cols()) {
                kEnd = oriImage.cols() - 1;
            }

            for OpenCV
(int j = jStart; j < jEnd; j++) {
                for (int k = kStart; k < kEnd; k++) {
                    if (hsvImage.get(j, k) != null) {
                        double pixel_h = oriImage.get(j, k)[0];
                        double pixel_s = oriImage.get(j, k)[1];
                        double pixel_v = oriImage.get(j, k)[2];

                        if ((pixel_h != 0) || (pixel_s != 0) || pixel_v != 0) {

                            if (ColourUtils.isPointInCircle(point.x, point.y, radius, j, k)) {
                                if ((pixel_h != 0)) {
                                    int pixIndex = (int) pixel_h;
                                    hueList.add(pixIndex);
                                }
                            }
                        }
                    }
                }
            }
        } catch(Exception e){
            Log.e("errorCSVhuelist", e.toString());
        }

            return hueList;

    }

For the life of me I haven't been able to find out what's been going on with this error, it only happens on rare occasions. Any ideas about what's going on here?