Autor Tema: bennugd crash on android with simple script.  (Leído 4972 veces)

herve_02

  • Newbie
  • *
  • Mensajes: 13
  • Karma: 0
Re:bennugd crash on android with simple script.
« Respuesta #15 en: Mayo 04, 2013, 07:55:49 pm »
@pixel..

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

panreyes

  • Administrator
  • *****
  • Mensajes: 2086
  • Karma: 68
    • panreyes.com
Re:bennugd crash on android with simple script.
« Respuesta #16 en: Mayo 04, 2013, 07:59:46 pm »
Send me your code and I'll try to run it

herve_02

  • Newbie
  • *
  • Mensajes: 13
  • Karma: 0
Re:bennugd crash on android with simple script.
« Respuesta #17 en: Mayo 04, 2013, 08:07:27 pm »
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

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re:bennugd crash on android with simple script.
« Respuesta #18 en: Mayo 05, 2013, 12:29:29 am »
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.