GNOME Bugzilla – Bug 778348
Android: Native Crash after fast switching of Library Load
Last modified: 2018-05-06 13:10:31 UTC
Hey, in our App we have two different Activities with GStreamer Views. When i fast switch between these two Sites, the native part crashes and the app freezes. We had the same issue with Version 1.6.3!!! Here my Android Monitor Output! 02-08 16:25:10.230 14894-14994/com.supra_elektronik.ipcviewer E/GLib: gst_gl_window_set_window_handle: assertion 'handle != 0' failed 02-08 16:25:10.430 14894-14894/com.supra_elektronik.ipcviewer E/MotionRecognitionManager: mSContextService = null 02-08 16:25:10.430 14894-14894/com.supra_elektronik.ipcviewer E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@470890f 02-08 16:25:28.540 14894-15148/com.supra_elektronik.ipcviewer E/GLib: gst_gl_window_set_window_handle: assertion 'handle != 0' failed 02-08 16:25:45.650 14894-15310/com.supra_elektronik.ipcviewer E/GLib: gst_gl_window_set_window_handle: assertion 'handle != 0' failed 02-08 16:25:46.020 14894-14894/com.supra_elektronik.ipcviewer E/ViewSystem: ViewRootImpl #2 Surface is not valid. 02-08 16:25:49.450 14894-14894/com.supra_elektronik.ipcviewer E/ExtMediaPlayer-JNI: env->IsInstanceOf fails 02-08 16:25:49.450 14894-14894/com.supra_elektronik.ipcviewer E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0 02-08 16:25:49.450 14894-14894/com.supra_elektronik.ipcviewer E/ExtMediaPlayer-JNI: env->IsInstanceOf fails 02-08 16:25:49.450 14894-14894/com.supra_elektronik.ipcviewer E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0 02-08 16:25:51.890 14894-14894/com.supra_elektronik.ipcviewer E/MotionRecognitionManager: mSContextService = null 02-08 16:25:51.890 14894-14894/com.supra_elektronik.ipcviewer E/MotionRecognitionManager: motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@6366515 02-08 16:25:56.090 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:25:56.090 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:25:56.090 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:25:56.090 14894-14929/com.supra_elektronik.ipcviewer E/OpenGLRenderer: GL error: GL_INVALID_VALUE 02-08 16:25:56.100 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:25:56.100 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:25:56.100 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:25:56.110 14894-14929/com.supra_elektronik.ipcviewer E/OpenGLRenderer: GL error: GL_INVALID_VALUE 02-08 16:26:05.290 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: eglQuerySurface:805 error 300d (EGL_BAD_SURFACE) 02-08 16:26:05.290 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: eglQuerySurface:805 error 300d (EGL_BAD_SURFACE) 02-08 16:26:05.290 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: eglBeginFrame:823 error 300d (EGL_BAD_SURFACE) 02-08 16:26:05.290 14894-14929/com.supra_elektronik.ipcviewer E/OpenGLRenderer: GL error: GL_INVALID_VALUE 02-08 16:27:14.150 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:27:14.150 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:27:14.150 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:27:14.150 14894-14929/com.supra_elektronik.ipcviewer E/OpenGLRenderer: GL error: GL_INVALID_VALUE 02-08 16:27:14.200 14894-14929/com.supra_elektronik.ipcviewer E/libEGL: validate_display:257 error 3001 (EGL_NOT_INITIALIZED) 02-08 16:27:14.200 14894-14929/com.supra_elektronik.ipcviewer A/OpenGLRenderer: Failed to create EGLSurface for window 0xb83a88a8, eglErr = EGL_NOT_INITIALIZED 02-08 16:27:14.210 14894-14929/com.supra_elektronik.ipcviewer A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 14929 (RenderThread) 02-08 16:27:14.210 389-389/? A/DEBUG: pid: 14894, tid: 14929, name: RenderThread >>> com.supra_elektronik.ipcviewer <<<
Please get a backtrace of all threads when it crashes, and ideally also provide a testcase that allows to reproduce your problem. The log above suggests that there are some problems in your application about how you handle the window handle (i.e. the ANativeWindow) for the sink to render too.
We use your Tutorial 3 & 5 as the base of our Activities (including the C files). We add a Surface in runtime to our Layout. The base of this Surface is out of the Tutorial example. static { System.loadLibrary("gstreamer_android"); System.loadLibrary("tutorial-5"); nativeClassInit(); } and static { System.loadLibrary("gstreamer_android"); System.loadLibrary("tutorial-3"); nativeClassInit(); } for Loading and dispose function in ondestroy for destroying all. @Override public void dispose() { // TODO Auto-generated method stub nativePause(); nativeSurfaceFinalize(); nativeFinalize(); _viewContainer.removeAllViews(); }
Please provide a project that can be compiled and runs, and instructions about how to reproduce the problem.
https://we.tl/nW2TtqHCth Please check for the GSTreamer Root path! I hope you can compile it. The Problem on this Project snippet is, that everything runs properly. What i see in our App is that GStreamer gives me a callback, so the HLS Stream is running, but nothing is shown. When i change the Site to somewhere else, then the app freezes completely, with the same Logcat Output! The Problem appears with Version 1.6.3 and the newest one!
You mean with that project it works, but in your application it does not? That's not useful then :) We need a testcase that reproduces your exact problem.
Yeah, sounds stupid, but is the truth. The Problem appears only when GStreamer shows nothing. Maybe there is some Problem with the latency of the stream. When the Video is shown, everything will be destroyed properly. Maybe you have an advice for me how i should call the native finalize methods, to prevent that Crash!
Without a testcase or backtrace there's not much we can do here.