Android, SIGSEGV, LogManager

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
User avatar
adlergfx
Gnoblar
Posts: 9
Joined: Tue Nov 13, 2012 4:36 pm
Location: Germany

Android, SIGSEGV, LogManager

Post by adlergfx »

Hello,

i already tried to solve my problem reading older posts about Android SIGSEGVs but i found no solution.
I try to run ogre on my galaxy s3 and got an SIGSEV during creation of OgreRoot.

Code: Select all

F/libc    (29113): Fatal signal 11 (SIGSEGV) at 0x0000001c (code=1), thread 29113 (rg.cgeffects.de)
I/ClipboardServiceEx( 2259): Send intent for dismiss clipboard dialog inside hideCurrentInputLocked() !
I/power   ( 2259): *** release_dvfs_lock : lockType : 1 
D/KeyguardViewMediator( 2259): setHidden false
D/PowerManagerService( 2259): releaseDVFSLockLocked : all DVFS_MIN_LIMIT are released 
W/ActivityManager( 2259): mDVFSLock.release()
I/SurfaceFlinger( 1898): id=2136(1174) createSurf (1440x1280),-1 flag=20000, ClackSurface
I/SurfaceFlinger( 1898): id=2137(1175) createSurf (720x2560),-1 flag=20000, ClackSurface
I/SurfaceFlinger( 1898): id=2138(1176) createSurf (1440x1280),-1 flag=20000, ClackSurface
I/SurfaceFlinger( 1898): id=2139(1177) createSurf (720x2560),-1 flag=20000, ClackSurface
I/DEBUG   ( 7953): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 7953): Build fingerprint: 'samsung/m0xx/m0:4.1.1/JRO03C/I9300XXDLIH:user/release-keys'
I/DEBUG   ( 7953): pid: 29113, tid: 29113, name: rg.cgeffects.de  >>> org.cgeffects.de <<<
I/DEBUG   ( 7953): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000001c
I/DEBUG   ( 7953):     r0 00000000  r1 00000000  r2 5d980c30  r3 5d98e084
I/DEBUG   ( 7953):     r4 5ef17868  r5 be85c534  r6 5d98e084  r7 5d164fd8
I/DEBUG   ( 7953):     r8 be85c524  r9 5ef17880  sl be85c50c  fp be85c510
I/DEBUG   ( 7953):     ip 00000000  sp be85c4b0  lr 5d4cac17  pc 5d46da70  cpsr 00000030
I/DEBUG   ( 7953):     d0  0000000000000000  d1  0000000044342000
I/DEBUG   ( 7953):     d2  0000000000000000  d3  4434000000000000
I/DEBUG   ( 7953):     d4  0000008200000000  d5  4434000044a00000
I/DEBUG   ( 7953):     d6  4433c000449fe000  d7  0000000000000000
I/DEBUG   ( 7953):     d8  0000000000000000  d9  0000000000000000
I/DEBUG   ( 7953):     d10 0000000000000000  d11 0000000000000000
I/DEBUG   ( 7953):     d12 0000000000000000  d13 0000000000000000
I/DEBUG   ( 7953):     d14 0000000000000000  d15 0000000000000000
I/DEBUG   ( 7953):     d16 000000c142a4f3a0  d17 000000c141da5508
I/DEBUG   ( 7953):     d18 00000000037ea6a8  d19 2000000840071840
I/DEBUG   ( 7953):     d20 0000000000000000  d21 3fe5555560000000
I/DEBUG   ( 7953):     d22 0000000000000000  d23 3fe5555560000000
I/DEBUG   ( 7953):     d24 3ff0000000000000  d25 0000000000000000
I/DEBUG   ( 7953):     d26 0000000000000000  d27 0000000000000000
I/DEBUG   ( 7953):     d28 0000000000000000  d29 0000000000000000
I/DEBUG   ( 7953):     d30 0000000000000000  d31 0000000000000000
I/DEBUG   ( 7953):     scr 60000011
I/DEBUG   ( 7953): 
I/DEBUG   ( 7953): backtrace:
I/DEBUG   ( 7953):     #00  pc 00303a70  /data/data/org.cgeffects.de/lib/libguess.so (Ogre::LogManager::LogManager()+51)
I/DEBUG   ( 7953):     #01  pc 00360c13  /data/data/org.cgeffects.de/lib/libguess.so (Ogre::Root::Root(std::string const&, std::string const&, std::string const&)+750)
I am using the ogrewrapper where initOgreRoot is created like this:

Code: Select all

  /*
        LOGI("create LogManager");
		Ogre::LogManager *lm = OGRE_NEW Ogre::LogManager();
        LOGI("create a log");
        Ogre::Log *l = lm->createLog("AndroidLog", true, false, true);
        lm->setDefaultLog(l);
        LOGI("create listener");
		g_ll = OGRE_NEW AndroidLogListener();
        LOGI("add listener to log");
		l->addListener(g_ll);
*/
        LOGI("create Root");
		// Create a root object
		g_root = OGRE_NEW Ogre::Root("", "", "");
		
as you can see i commented out the creation of the log, because i also got the sigsegv here too.
If i do not create the log the app runs a little bit more but crashes. In the dump you see that
it seems to be the Constructor of the Manager which seems not possible to me..

I used the OgreSampleBrowser as starting point to implement my own application but i simplified
it - f.e. removing the browser itself. All I want is a rendering canvas where i can add my own
geometries.

Has someone a hint where i can start my search?
User avatar
adlergfx
Gnoblar
Posts: 9
Joined: Tue Nov 13, 2012 4:36 pm
Location: Germany

Re: Android, SIGSEGV, LogManager

Post by adlergfx »

If i have the creation of the log manager included the application crashes before any resources
are loaded. If i remove the lines - as in the example - the app loads the resources from the
assets (thumbnails, SdkTrays, RTShaderLib) successfully and crashes than.

I am using the 1.8 from sinbad/ogre. ... I hope somebody has seens such an behaviour
dudeabot
Gnome
Posts: 334
Joined: Thu Jun 28, 2007 2:12 pm
Location: Brazil
x 5

Re: Android, SIGSEGV, LogManager

Post by dudeabot »

try with 1.9

thats what the docs suggest. dont use r8b also
User avatar
adlergfx
Gnoblar
Posts: 9
Joined: Tue Nov 13, 2012 4:36 pm
Location: Germany

Re: Android, SIGSEGV, LogManager

Post by adlergfx »

Hey,

i have now ogre 1.9 in use with ndk-r8. This was realy my fault and i just did not see it.

Code: Select all

I/OGRE    (28125): GLES2RenderSystem::_createRenderWindow "OgreAndroidPrimary", 1280x590 fullscreen  miscParams: externalGLContext=0 externalWindowHandle=0
F/libc    (28125): Fatal signal 11 (SIGSEGV) at 0x00000058 (code=1), thread 28125 (rg.cgeffects.de)
I/DEBUG   ( 1889): Build fingerprint: 'samsung/m0xx/m0:4.1.1/JRO03C/I9300XXDLIH:user/release-keys'
I/DEBUG   ( 1889): pid: 28125, tid: 28125, name: rg.cgeffects.de  >>> org.cgeffects.de <<<
I/DEBUG   ( 1889): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000058
D/dalvikvm(28060): GC_CONCURRENT freed 305K, 9% free 12775K/14023K, paused 13ms+3ms, total 42ms

[..] some mem-dump [..]

I/DEBUG   ( 1889): backtrace:
I/DEBUG   ( 1889):     #00  pc 0000906e  /system/lib/libandroid.so (ANativeWindow_setBuffersGeometry+5)
I/DEBUG   ( 1889):     #01  pc 0028d711  /data/data/org.cgeffects.de/lib/libguess.so (Ogre::AndroidEGLWindow::_createInternalResources(ANativeWindow*, AConfiguration*)+168)
Currently i am addind no archives - just creating to ressource groups.

Code: Select all

bool initOgreRoot()
{
    try
    {
        g_root = OGRE_NEW Ogre::Root("", "", "");
        g_gles2Plugin = OGRE_NEW Ogre::GLES2Plugin();
        Ogre::Root::getSingleton().installPlugin(g_gles2Plugin);
        g_pfxPlugin = OGRE_NEW Ogre::ParticleFXPlugin();
        Ogre::Root::getSingleton().installPlugin(g_pfxPlugin);

        // Grab the available render systems
        const Ogre::RenderSystemList &renderSystemList = g_root->getAvailableRenderers();
        if(renderSystemList.empty()) return false;

        Ogre::RenderSystem *system = renderSystemList.front();
        g_root->setRenderSystem(system);
        g_root->initialise(false);

        g_lastTime = g_timer.getMilliseconds();

        return true;
    }
    catch(Ogre::Exception &e)
    {
    }

    return false;
}

Ogre::RenderWindow *initRenderWindow(unsigned int windowHandle, unsigned int width, unsigned int height, unsigned int contextHandle)
{
    if(g_root != 0 && g_renderWindow == 0)
    {
        Ogre::NameValuePairList params;
        params["externalWindowHandle"] = Ogre::StringConverter::toString(windowHandle);
        params["externalGLContext"]    = Ogre::StringConverter::toString(contextHandle);

        g_renderWindow = g_root->createRenderWindow("OgreAndroidPrimary", width, height, true, &params);
    }

    return g_renderWindow;
}

User avatar
adlergfx
Gnoblar
Posts: 9
Joined: Tue Nov 13, 2012 4:36 pm
Location: Germany

Re: Android, SIGSEGV, LogManager

Post by adlergfx »

this is now solved - but dont know realy how. sorry.

New for nor ist the message "application initialization failed"
Searching for that currently. The GL Render Context is okay.
I just created context and disabled initialization of ogre, thus
something is wrong again...

Again: I would be greatful for ideas. Older posts to application
initialization failed were windows realted ..

Greetings and thanks for advices. Sorry if my questions maybe
noob.
dudeabot
Gnome
Posts: 334
Joined: Thu Jun 28, 2007 2:12 pm
Location: Brazil
x 5

Re: Android, SIGSEGV, LogManager

Post by dudeabot »

to be honest i havent tried a separeted sample yet, so samplebrowser works well?

you can try debugging with one from the following options, from the most recent to the old school =p:

1) the new NDK plugin for ecplise: http://tools.android.com/recent/usingthendkplugin
2) NDK-STACK https://gitorious.org/mingw-android-ndk ... STACK.html
3) something-toline: http://www.codexperiments.com/android/2 ... ck-traces/
4) GDB (never got this one to work)
User avatar
adlergfx
Gnoblar
Posts: 9
Joined: Tue Nov 13, 2012 4:36 pm
Location: Germany

Re: Android, SIGSEGV, LogManager

Post by adlergfx »

I understand my problem more and more.

I had started with a example of an older sdk where the context and so on is created
at the java level using NvActivity from com.nvidia.devtech. This context is used
in the ndk to initialize ogre and start ogre initialization and rendering.

The new SampleBrowser is a stand alone native activity without java stuff. This
is quite a nice way - which was new to me - but i am more interessted to have
additional java code around ... difficult to explain.

Therefore the Java part is like this:

Code: Select all


public class OgreTest extends NvGLES2Activity 
{
	@Override
	public void onCreate( Bundle savedInstance )
	{	
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		super.onCreate(savedInstance);
		setAssetManager(getAssets(), new String("packs/"));	
		addResourceLocation("SdkTrays.mp3", "Essential");	
	}
	
	public native void addResourceLocation( String name, String loc);
	public native void setAssetManager( Object mgr, String prefix );

	@Override
	public native boolean init();
	
	@Override
	public native void cleanup();
	
	@Override
	public native boolean render(int drawWidth, int drawHeight, boolean forceRedraw);

	@Override
	public native boolean inputEvent(int action, float x, float y, MotionEvent event);

	@Override
	public native boolean keyEvent(int action, int unicodeChar, int keyCode, KeyEvent event);
}
under NDK there is my main Interface:

Code: Select all

#include <jni.h>
#include <stdlib.h>
#include <iostream>
#include <stdexcept>
#include <string>

#include "ogrewrapper.h"
#include <OIS.h>

#include <android/log.h>
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>

#include "multitouch.h"
#include "keyboard.h"

#include "Android/OgreAPKFileSystemArchive.h"
#include "Android/OgreAPKZipArchive.h"

#define  LOG_TAG    "NDK-Ogre"
#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define  LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)


extern "C"
{

static AndroidMultiTouch * g_multiTouch = NULL;
static AndroidKeyboard   * g_keyboard   = NULL;
static bool g_rootInit  = false;
static int g_xOffset    = 0;
static int g_yOffset    = 0;
static Ogre::map<Ogre::String,Ogre::String>::type g_resourceMap;
static AAssetManager * assetManager = NULL;
static std::string prefix = ""; // per default no prefix at all

void Java_org_cgeffects_de_OgreTest_setAssetManager( JNIEnv* env, jobject thiz, jobject mgr, jstring j_prefix )
{
    assetManager = AAssetManager_fromJava( env, mgr );
	const char *str = env->GetStringUTFChars(j_prefix, 0);
    prefix = str;   // convert to std::string

    if (!prefix.empty())    // the prefix is given - assert that it is terminated with "/" or "\"
    {
        size_t last = prefix.size() - 1;
        unsigned char sign = prefix[last];
        if ( (sign != '/') && (sign != '\\') )
        {
            prefix += '/';
        }
        LOGI("Got prefix %s", prefix.c_str());
    }


	env->ReleaseStringUTFChars(j_prefix, str);
}

jboolean Java_org_cgeffects_de_OgreTest_init(JNIEnv* env, jobject thiz)
{

    LOGI("************* init ******************");
/*    if (g_rootInit) return true;
	g_rootInit = initOgreRoot();
	return g_rootInit; */

    if (g_rootInit) return true;    // if initialized return true

    LOGI(" init Ogre Root");

    bool g_rootInit = initOgreRoot();
	if(!g_rootInit) 
    {
        LOGI(" failed to create ogre root");
        return false;
    }

    LOGI(" success to create ogre root");

    //LOGI(" create and Add ArchiveFactory");
	//g_archiveFactory = OGRE_NEW Ogre::AndroidArchiveFactory(env);
	//Ogre::ArchiveManager:p:getSingleton().addArchiveFactory(g_archiveFactory);

    Ogre::ArchiveManager & amgr = Ogre::ArchiveManager::getSingleton();

    amgr.addArchiveFactory( new Ogre::APKFileSystemArchiveFactory(assetManager) );
    amgr.addArchiveFactory( new Ogre::APKZipArchiveFactory(assetManager) );

	LOGI("Adding resource locations");
    Ogre::ResourceGroupManager & rgmgr = Ogre::ResourceGroupManager::getSingleton();
	rgmgr.createResourceGroup("Popular");
	rgmgr.createResourceGroup("Essential");

	for(Ogre::map<Ogre::String,Ogre::String>::type::iterator i = g_resourceMap.begin();
                                                             i != g_resourceMap.end(); 
                                                             ++i)
	{
		rgmgr.addResourceLocation(i->first, "APKZip", i->second);  
	}
}

jboolean Java_org_cgeffects_de_OgreTest_render(JNIEnv* env, jobject thiz, jint drawWidth, jint drawHeight, jboolean forceRedraw)
{
    LOGI("************* render ******************");
	// Check that a render window even exists
	if(getRenderWindow() == 0)
    {
        LOGI("init Render Window");
		initRenderWindow(0, drawWidth, drawHeight, 0);
	}

	// Initialize the sample browser
    /*
	if(g_multiTouch == 0)
    {
		g_multiTouch = new AndroidMultiTouch();
	}
	
	if(g_keyboard == 0)
    {
		g_keyboard = new AndroidKeyboard();
	}*/

    return true;


    LOGI("renderOneFrame");
    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    LOGI("Resource Groups initialized");
	renderOneFrame();
	
    return JNI_TRUE;
}

void Java_org_cgeffects_de_OgreTest_addResourceLocation(JNIEnv *env, jobject thiz, jstring name, jstring group)
{
	LOGI("Adding resource location");
	
	const char *str1 = env->GetStringUTFChars(name, 0);
	const char *str2 = env->GetStringUTFChars(group, 0);

    std::string pstr = str1;
    pstr = prefix + pstr;
    LOGI("Add Resource %s to group %s", pstr.c_str(), str2);

	g_resourceMap[pstr] = str2;
	env->ReleaseStringUTFChars(name, str1);
	env->ReleaseStringUTFChars(group, str2);
}

void Java_org_cgeffects_de_OgreTest_setOffset(JNIEnv* env, jobject thiz, jint x, jint y)
{
    LOGI("setOffset %d %d", x,y);
    g_xOffset = x;
	g_yOffset = y;
}

void Java_org_cgeffects_de_OgreTest_cleanup(JNIEnv* env)
{
    LOGI("cleanup");
    delete g_multiTouch; g_multiTouch = NULL;
    delete g_keyboard;   g_keyboard   = NULL;


	if(getRenderWindow())
    {
		destroyRenderWindow();
	}
		
	LOGI("deleting ogre root");
	if(g_rootInit)
    {
		destroyOgreRoot();
		g_rootInit = false;
	}
}

jboolean Java_org_cgeffects_de_OgreTest_inputEvent(JNIEnv* env, jobject thiz, jint action, jfloat mx, jfloat my)
{
    LOGI("inputEvent");
	return false;
}

jboolean Java_org_cgeffects_de_OgreTest_keyEvent(JNIEnv* env, jobject thiz, jint action, jint unicodeChar, jint keyCode, jobject keyEvent)
{
    LOGI("keyEvent");
    return false;  
}
}
and the ogrewrapper which i got from an older SampleBrowser. I removed everything here which was just related to interaction
or samples.

Code: Select all

#include "ogrewrapper.h"

#include <RenderSystems/GLES2/OgreGLES2Plugin.h>
#include <Plugins/ParticleFX/OgreParticleFXPlugin.h>

#include <Android/OgreAndroidLogListener.h>

#include <android/log.h>

extern "C"
{


// Store global variables here
static Ogre::Root               * g_root         = NULL;
static Ogre::GLES2Plugin        * g_gles2Plugin  = NULL;
static Ogre::ParticleFXPlugin   * g_pfxPlugin    = NULL;
static Ogre::RenderWindow       * g_renderWindow = NULL; // The main render window
static Ogre::AndroidLogListener * g_ll           = NULL;

static Ogre::Timer g_timer;
static unsigned long g_lastTime = 0;

#define  LOG_TAG    "NDK-Ogre"
#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define  LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)

bool initOgreRoot()
{
	try
    {
        LOGI("create Root");
		// Create a root object
		g_root = OGRE_NEW Ogre::Root("", "", "");
		
        LOGI("register GLES2");
		// Register the ES2 plugin
		g_gles2Plugin = OGRE_NEW Ogre::GLES2Plugin();
		Ogre::Root::getSingleton().installPlugin(g_gles2Plugin);
		
        LOGI("register PluginFx");
		// Register particle plugin
		g_pfxPlugin = OGRE_NEW Ogre::ParticleFXPlugin();
		Ogre::Root::getSingleton().installPlugin(g_pfxPlugin);
		
		// Grab the available render systems
		const Ogre::RenderSystemList &renderSystemList = g_root->getAvailableRenderers();
		if(renderSystemList.empty()) return false;
		
        LOGI("initialize RenderSystem (%d elements)", renderSystemList.size());
		// Set the render system and init
		Ogre::RenderSystem *system = renderSystemList.front();
		g_root->setRenderSystem(system);
        LOGI("initialize root");
		g_root->initialise(false);
		
		g_lastTime = g_timer.getMilliseconds();
		
		return true;
	}
    catch(Ogre::Exception &e)
    {
	}

	return false;
}

Ogre::RenderWindow *initRenderWindow(unsigned int windowHandle, unsigned int width, unsigned int height, unsigned int contextHandle)
{
	if(g_root != 0 && g_renderWindow == 0)
    {
		Ogre::NameValuePairList params;
		params["externalWindowHandle"] = Ogre::StringConverter::toString(windowHandle);
		params["externalGLContext"]    = Ogre::StringConverter::toString(contextHandle);
		
        LOGI("initRenderWindow - createRenderWindow");
		g_renderWindow = g_root->createRenderWindow("Ogre Android Primary", width, height, true, &params);
	}

    LOGI("initRenderWindow - okay");
	
	return g_renderWindow;
}

void destroyOgreRoot()
{
	if(g_root)         OGRE_DELETE g_root;
	if(g_gles2Plugin) OGRE_DELETE g_gles2Plugin;
	if(g_pfxPlugin)   OGRE_DELETE g_pfxPlugin;
	
	g_root = NULL;
	g_gles2Plugin = NULL;
	g_pfxPlugin = NULL;
}

void destroyRenderWindow()
{
	if(g_renderWindow)
    {
		g_renderWindow->destroy();
		Ogre::Root::getSingleton().detachRenderTarget(g_renderWindow);
		g_renderWindow = 0; 
	}
}

Ogre::RenderWindow *getRenderWindow()
{
	return g_renderWindow;
}

void renderOneFrame()
{
    if(!g_root ||  !g_renderWindow) return;
	g_root->renderOneFrame();
}

}
This crashes with one of the also presented errors. SigSegv or Application Initialization error

Indeed i made my problem because i am based on an older browser. I will try to use the new one but
i hoped that i can render later to a canvas or a surfaceview instead of the whole activity ...
dudeabot
Gnome
Posts: 334
Joined: Thu Jun 28, 2007 2:12 pm
Location: Brazil
x 5

Re: Android, SIGSEGV, LogManager

Post by dudeabot »

Well id suggest trying with surface view instead of the nvidia .

i based mine on : https://github.com/asantee/ethanon/blob ... IView.java for my 2D opengl es games. I was having some problems with the nvidia wrappers (would show nothing on some devices, slow perfomance, etc..)

i only had to change cause im working with 1v1, if you are aiming for 2.0 i think its just a matter of copy paste :D
User avatar
adlergfx
Gnoblar
Posts: 9
Joined: Tue Nov 13, 2012 4:36 pm
Location: Germany

Re: Android, SIGSEGV, LogManager

Post by adlergfx »

Thanks to you i could surround my problem :)

But it stays and stays...

I modified your code like this:

Code: Select all

public class OgreView extends GLSurfaceView
{
	private FrameHandler frameHandler;
	
	private OgreTest ot;
	
	public OgreView(Context context)
	{
		super(context);
		
		ot = (OgreTest)context;
		ot.init();
		setEGLContextFactory(new ContextFactory());
		setRenderer(new Renderer(ot));
		frameHandler = new FrameHandler(this, 100);
		frameHandler.start();
	}
	
	private static class ContextFactory implements GLSurfaceView.EGLContextFactory
	{
		private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;

		public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) 
		{
			Log.w("Ogre-Android", "creating OpenGL ES 2.0 context");
			int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
			EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
			return context;
		}

		public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) 
		{
			egl.eglDestroyContext(display, context);
		}
	}

	static class Renderer implements GLSurfaceView.Renderer
	{
		public OgreTest main;
		public Renderer(OgreTest v) 
		{
			main = v;
		}

		public void onDrawFrame(GL10 gl) 
		{
			gl.glClearColor(1, 0,0,1);
			gl.glClear( gl.GL_COLOR_BUFFER_BIT );
		//	main.render(640, 480, true);
			
		}

		public void onSurfaceChanged(GL10 gl, int width, int height)
		{
			// TODO Auto-generated method stub
			
		}

		public void onSurfaceCreated(GL10 gl, EGLConfig config)
		{
			// TODO Auto-generated method stub
			
		}
	}
}
As you can see - main.render is disabled.
The clear call works as expected - therefore i have a context.
Because of int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
i also expect a gles2 context - not sure but maybe

The init runs fine - implemented native as in one of my previous posts.
I found a small bug which made thinks better, but the error still exists.

During render initRenderWindow is called initRenderWindow(0, drawWidth, drawHeight, 0);
forwared to GLESRenderSystem --> GLESSupport --> OgreAndroidEGLSupport.cpp (GLES/src/EGL/Android)
and finaly touch down at "void AndroidEGLWindow::create" there

Code: Select all

 if (!mEglConfig)
        {

            _createInternalResources(mWindow, config);
            mHwGamma = false;
        }
is called which will break in
ANativeWindow_setBuffersGeometry(mWindow, 0, 0, format);

I added additional log messages but got only output till the call to OgreAndroidEGLSupport.cpp
This could be that i lost trace :) or that crash happens before Output is available ...
IMHO the trace should be fine - i see no other way.

The mem-dump also says that ANativeWindow_setBuffersGeometr crashed.

This is the same with your View (i like more than nvidia oversized stuff) and the nvidia stuff, too.

I realy need help - i have no clue. I try this weekend to reduce my code to the minimum so i can
offer this for download. Maybe someone could help - i have no idea what that thing does!
User avatar
adlergfx
Gnoblar
Posts: 9
Joined: Tue Nov 13, 2012 4:36 pm
Location: Germany

Re: Android, SIGSEGV, LogManager

Post by adlergfx »

Does ANativeManager require that the responsible Activity is native?
If so - is it even possible to use ogre with a SurfaceView or an View
that only uses a portion of the Activity?
dudeabot
Gnome
Posts: 334
Joined: Thu Jun 28, 2007 2:12 pm
Location: Brazil
x 5

Re: Android, SIGSEGV, LogManager

Post by dudeabot »

To be honest im not sure what you are doing ehehhe my suggetsion is to stick with the official method, i dont see any advantage in the poposed way you are doing things. you still have access to both sides java/cpp (http://www.ogre3d.org/tikiwiki/tiki-ind ... on=Android), so you can put a lot of java code still ;p

chances are is even if it runs there will be some sort of erro, just because there have been a lot of fixed issues since the first tries.

anyway try hosting somewhere maybe more experienced people can shed a light ^^
User avatar
adlergfx
Gnoblar
Posts: 9
Joined: Tue Nov 13, 2012 4:36 pm
Location: Germany

Re: Android, SIGSEGV, LogManager

Post by adlergfx »

I agree with you.

I change currently to the design with a NativeActivity. That is more direct forward.
My "mistake" was, that i got a quite old ducumentation of the Android usage of
Ogre which utilized Java Activity where the Rendercontext was fetched by the NDK.
I started with that and saw (a little to) late, that i had to update to 1.9 - where 1.8
is the current default checkout.
After that i tried to adapt my code - but rewrite was required and the right way.

I expect that my problems will be solved because ANativeManager will not break
again. I hope this may help others in the future.

The ideas helped a lot and sometime a forum post helps just because you may
write your problem down.