bennugd crash on android with simple script.

Started by herve_02, April 28, 2013, 06:30:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

herve_02

@pixel..

no i do not use mod debug... just the adb debug thing.... "adb logcat" with the device connected..

panreyes

Send me your code and I'll try to run it

herve_02

everything i write is working now with the new sdlactivity.java, that was the error with the apk they send me to test.

thanks a lot for the proposition

josebita

Quote from: herve_02 on April 29, 2013, 10:48:29 PM
ok.. the problem is solved, much more worked around, in fact

i download the last packager... bennu crash on android :
============================== some debug infos ===================================
V/SDL     ( 5125): Creating new EGL Surface
I/SDL     ( 5125): [STUB] GL_SetSwapInterval
I/SDL     ( 5125): [STUB] GL_GetSwapInterval
I/SDL     ( 5125): [STUB] GL_DeleteContext
V/SDL     ( 5125): Creating new EGL Surface
E/SDL     ( 5125): Couldn't create surface
I/SDL     ( 5125): [STUB] GL_SetSwapInterval
I/SDL     ( 5125): [STUB] GL_GetSwapInterval
F/libc    ( 5125): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
========================================================================
so it appears that bennu ask twice for the EGL Surface and crash on the second ask..
so..... after some tries... i modified SDLActivity.java

    public static boolean createEGLSurface() {
        if (SDLActivity.mEGLDisplay != null && SDLActivity.mEGLConfig != null) {
            EGL10 egl = (EGL10)EGLContext.getEGL();
            if (SDLActivity.mEGLContext == null) createEGLContext();
            if (SDLActivity.mEGLSurface == null) { // <<<<<<<<<<<<<<<<<<<<<<  line added =========================
            Log.v("SDL", "Creating new EGL Surface");
            EGLSurface surface = egl.eglCreateWindowSurface(SDLActivity.mEGLDisplay, SDLActivity.mEGLConfig, SDLActivity.mSurface, null);
            if (surface == EGL10.EGL_NO_SURFACE) {
                Log.e("SDL", "Couldn't create surface");
                return false;
            }

            if (egl.eglGetCurrentContext() != SDLActivity.mEGLContext) {
                if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, surface, surface, SDLActivity.mEGLContext)) {
                    Log.e("SDL", "Old EGL Context doesnt work, trying with a new one");
                    // TODO: Notify the user via a message that the old context could not be restored, and that textures need to be manually restored.
                    createEGLContext();
                    if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, surface, surface, SDLActivity.mEGLContext)) {
                        Log.e("SDL", "Failed making EGL Context current");
                        return false;
                    }
                }
            }
            SDLActivity.mEGLSurface = surface;
              } // <<<<<<<<<<<<<<<<<<<<<<<<< line added =============================
            return true;
        }
        return false;
    }

and the problem is gone...............
Hi herve_02,

Thanks a lot for having a look at this.
Right now I'm updating my packager code to include this fix and a few others. It'll include the JDK for Windows, too.
The Linux version should be updated in a matter of minutes in my PPA, windows should be up in a matter of hours.