GC and onTouch cause Fatal signal 11 (SIGSEGV) error in application using ffmpeg via ndk

I get an unpleasant but well-known error when working with FFmpeg and NDK:

A/libc(9845): Fatal signal 11 (SIGSEGV), code 1, fault addr 0xa0a9f000 in tid 9921 (AsyncTask #4)

UPDATE

After a couple of hours, I found out that there could be two sources of the problem. One of them was associated with a multi-threaded process. I checked it and I fixed it. Now the application crashes ONLY when you turn on video playback (ndk).

I put the counter event in touch

  surfaceSterowanieKamera.setOnTouchListener(new View.OnTouchListener() {
            int counter = 0;
            @Override
            public boolean onTouch(View v, MotionEvent event) {             
                if ((event.getAction() == MotionEvent.ACTION_MOVE)){
                    Log.i(TAG, "counter = " + counter);
                    //cameraMover.setPanTilt(some parameters);
                    counter++;
                 }

, . , - . , (cameraMover.setPanTilt() ) , 1600 - 1700.

logcat , GC. , GC ndk.

01-23 12:27:13.163: I/Display Activity(20633): n = 1649
01-23 12:27:13.178: I/art(20633): Background sticky concurrent mark sweep GC freed 158376(6MB) AllocSpace objects, 1(3MB) LOS objects, 17% free, 36MB/44MB, paused 689us total 140.284ms
01-23 12:27:13.169: A/libc(20633): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9bd6ec0c in tid 20734 (AsyncTask #3)

GC ndk?


?

, - . FFmpeg, NDK, .

FFMpeg . ndk , SurfaceView videoSurfaceView, ( java).

-, - public class CameraMover implements Runnable{/**/}. , , .

videoSurfaceView.setOnTouchListener(new View.OnTouchListener() {/**/
cameraMover.setPanTilt(some parameters);
/**/}

.

- , , , .. , (, , ). , .

. , , , . 15 , 10 . .

, ?

  • logcat, , .
  • , videoSurfaceView . .
  • , , , , , , .

, :

A/libc(11528): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9aa9f00c in tid 11637 (AsyncTask #4)

- libc, addr tid. AsyncTask - # 1 , .

? ?

+4
2

, , libc: Fatal signal 11 (SIGSEGV), , - , - ( , ) . C api, - - , , , ..

, , , - C, , .

, , - ., , , Android-? . , CheckJNI JNI, . NDK ndk-stack ndk-gdb, , .

, , , , .

, , , GC , , java- JNI - Java JNI. GC , , , .

. http://android-developers.blogspot.com/2011/07/debugging-android-jni-with-checkjni.html , .

+8

,

, . MAC. 0xa0a9f000 0x9aa9f00c

: , , .

, .

./arm-linux-androideabi-addr2line -C -f -e <Here is the Path of your .so file> <Here is the fault address>

, cocos2dX , libcocos2dcpp.so file

./arm-linux-androideabi-addr2line -C -f -e /Volumes/Data_HD/Android/cocos2d-x-2.2.2/projects/Rummy/proj.android/obj/local/armeabi-v7a/libcocos2dcpp.so 00000000

, , GC. JNI.

0

All Articles