0

I have this piece of code:

synchronized void checkFace(){
    /*some code ...*/

    FaceDetector detector =
                        new FaceDetector.Builder(this)
                        .setProminentFaceOnly(true)
                        .build();

    Frame frame = new Frame.Builder().setBitmap(bitmap).build();
    SparseArray<Face> faces = detector.detect(frame);
    detector.release();

    /*some other code...*/
}

and, according debugger, for some valid bitmaps it fault my app with error:

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xadbd in tid 32090 (Thread-5810)

This code is in the synchronized function which runs in the background thread. If replace FaceDetector provided by googlePlay services with native android FaceDetector, all works fine, but I need some functions of google's detector.

Shadasviar
  • 466
  • 5
  • 15
  • A segmentation fault normally points to a bug in the code in which it arises. It can also arise from an integration error, such as the code being used with an incompatible version of an underlying library. It may also be that bad parameters are passed into the code. In this case, I'm inclined to guess that it's an integration issue: the version of `FaceDetector` you want to use is not compatible with the device on which you are trying to run it. – John Bollinger Sep 15 '16 at 14:59
  • @JohnBollinger is it repaireble, or only resolving of this problem: change library? – Shadasviar Sep 15 '16 at 15:06
  • My comments are already speculative as it is, but if I have guessed the problem correctly then resolving it will probably require either a different version of FaceDetector or different version of one or more Android software components. Make sure to scrutinize the requirements for the FaceDetector you are trying to use -- that it's for Android is not necessarily specific enough. – John Bollinger Sep 15 '16 at 17:08

0 Answers0