Discussion Board

Results 1 to 9 of 9

Thread: Why data abort?

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    15

    Why data abort?

    Hey, i am trying to port box2d to symbian and am using edgelib as my graphics engine.. well i have setit up perfectly it compiles fine as soon as i run it on device it just turns on and immediately turns off..

    i have debugged the application and strangely, the first line calling the constructor of a vector class that takes 2 floats as parameters is giving the error.. the floats are defined in the vector class and there are no pointers, but for some reason when i try to set their values i get data abort exception.. any idea why this is happening?

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: Why data abort?

    Hi,

    1/ Is it running on emulator?
    2/ On Symbian therecrashes are eihter "Leaves" or "Panics" and you can get the error code. Plese do it and post ir here together with the affected C++ code snippet, so we can try to analyze it.

    Links:
    Panic: http://wiki.forum.nokia.com/index.php/Panic
    Leave: http://wiki.forum.nokia.com/index.php/Leave
    Get the error code: http://wiki.forum.nokia.com/index.ph...ded_panic_code

    BR
    STeN

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    15

    Re: Why data abort?

    Thanks for the reply.. the links were really helpful.. neways, i didnt realize it but till now i was running my app only via carbide->debug.. i ran it manually from the device today and i got the exception, KERN_EXEC 3.. that is basically for unhandled exceptions right.. the issue is that the first line of my code gives the error and its like this:

    Code:
    b2Vec2 gravity(0.0f, -10.0f);
    so basically calling the constructor of b2Vec2 class, and the code of b2vec2 struct is :

    Code:
    b2Vec2(float32 x, float32 y) : x(x), y(y) {}
    i have x and y defined in the struct..

    I think the issue lies in stack.. imo its not able to allocate enough memory for my program and hence isnt able to init the two floats.. i have my epocstack set at 0x5000 but i still get the error..

  4. #4
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Why data abort?

    Is this code in a DLL or an exe.
    Are you building with GCCE or ARM?
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  5. #5
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: Why data abort?

    Hi RapchikProgrammer,

    this unfortunatelly does not help us too much It might be something with the EDGELIB... Are you able to do a simple "HelloWorld" wiht the EDGELIB engine? If so, then you can try to add carefully box2d engine files one-by-one...

    It crashes on a place it should not crash as there is nothing wrong about the b2Vec2 class. The crash is not caused by the class itself, but there is probably some other reason. You are talking about the "first line of the code", but what it means? From which place the code is called? Is it E32Main()? Can you paste more code here?

    Can you paste .mmp file here?

    BR
    STeN

  6. #6
    Registered User
    Join Date
    Jun 2008
    Posts
    15

    Re: Why data abort?

    @Paul: Its an exe building via gcce toolkit for s60 3rd edition..

    @stenlik: Sorry for the consise information but the rest is edgelib specific so i thought it wouldnt be much help.. well heres my cpp file (I have only once cpp and one header file):

    Code:
    #define NULL 0
    
    //Include Edge
    #include "edgemain.h"
    #include "Box2d.h"
    #include "Box2DTry.h"
    
    #pragma comment(lib, "Edge.lib")
    
    /////////////////////////////////////////////////////////////////////
    // The program entry point                                         //
    /////////////////////////////////////////////////////////////////////
    
    ClassEdge *EdgeMain(EDGESTARTUP *data){ return(new ClassMain); }
    My header file:

    Code:
    /////////////////////////////////////////////////////////////////////
    // Class definition                                                //
    /////////////////////////////////////////////////////////////////////
    
    
    //The main class
    class ClassMain : public ClassEdge
    {
    	private:		
    		char toPrint[100][100];
    
    	public:
    		ClassMain(void);
    		~ClassMain(void);
    
    		ERESULT OnFrameworkConfig(EFRAMEWORKCONFIG *config);
    		ERESULT OnDisplayConfig(EDISPLAYCONFIG *config);
    		ERESULT OnInit(ENATIVETYPE instance);
    		ERESULT OnDisplayInit(ENATIVETYPE instance, ClassEDisplay *display);
    		ERESULT OnNextFrame(ClassEDisplay *display, unsigned long timedelta);
    		void OnButtonDown(unsigned long bnr, EBUTTONLIST *blist);
    		void OnButtonUp(unsigned long bnr, EBUTTONLIST *blist);
    		void OnExit(ENATIVETYPE instance);
    };
    
    /////////////////////////////////////////////////////////////////////
    // ClassMain: public                                               //
    /////////////////////////////////////////////////////////////////////
    
    //ClassMain: constructor
    ClassMain::ClassMain(void)
    {
    
    }
    
    //ClassMain: destructor
    ClassMain::~ClassMain(void)
    {
    
    }
    
    //Configure framework
    ERESULT ClassMain::OnFrameworkConfig(EFRAMEWORKCONFIG *config)
    {
    	config->maxfps          = 30;                 //Limit the maximum frames per second by 60
    	config->flags           = 0;                  //No extra flag options
    	config->numconnections  = 1;                  //Keep 1 active network connection
    	config->smartfps    = true;					  //Other devices: Enable smart fps lock managing
    
    	#if defined(DEVICE_DESKTOP)
    		config->focusminimize = false;            //Desktop PC: Don't minimize the application when the focus is lost
    	#else
    		config->focusminimize = true;             //Mobile devices: Minimize the application when the focus is lost
    	#endif
    	
    	config->jogtiltarrow    = true;               //Emulate the UIQ jog as left/right arrows
    	config->focussuspend    = true;               //Desktop PC: suspend the application when the window focus is lost
    	config->backlighton     = true;               //Keep backlight on
    	config->netlogging      = true;               //Enable logging of network events in the console
    	config->lockkeys        = true;               //Lock keys for use in this application
    	config->keysounds       = false;              //Disable key 'click' sounds for smartphones
    	return(E_OK);
    }
    
    //Configure display
    ERESULT ClassMain::OnDisplayConfig(EDISPLAYCONFIG *config)
    {
    	ClassEStd::StrCpy(config->caption, "Box2d Try");
    	config->icon            = 0;           //Application icon
    	config->menu            = 0;                  //Application contains no Windows Menu
    	config->dialogbox       = 0;                  //Don't start from dialogbox (Desktop only)
    	config->width           = 320;                //Desktop PC: Custom display width
    	config->height          = 240;                //Desktop PC: Custom display height
    	config->videotype       = EDSP_DEFAULT;       //Choose the default display mode
    	config->emulvideotype   = EDSP_DEFAULT;       //No color depth emulation
    	config->orientation     = DOR_LANDSCAPE;      //Change orientation to match the settings of the device
    	config->openmethod      = DOM_DEFAULT;        //Take recommended (fastest) display open method
    	config->surfacedefault  = EST_SYSMEMORY;      //Create surfaces in system memory by default, don't use DirectDraw or Symbian bitmap surfaces
    	#if defined(DEVICE_DESKTOP)
    		config->fullscreen  = false;              //Windowed application for Desktop
    		config->fullscreenmouse = true;           //Desktop PC: Enable the mouse cursor for fullscreen applications
    	#else
    		config->fullscreen  = true;               //Fullscreen application for mobile devices
    	#endif
    	config->dspnative       = true;               //If possible, try to use native blitters (like DirectDraw)
    	config->enginestatus    = true;               //Desktop PC: Enable the status bar and status information icon
    	config->engineconsole   = true;               //Desktop PC: Enable the edge console
    	config->surfprerotate   = true;               //Use pre-rotated surfaces to increase speed in other orientations
    	return(E_OK); 
    }
    
    
    //Callback: Called before the display mode changes
    ERESULT ClassMain::OnInit(ENATIVETYPE instance)
    {
    	return(E_OK);
    }
    
    //Callback: Called when the display mode has changed, use this to initialize your surfaces, etc.
    ERESULT ClassMain::OnDisplayInit(ENATIVETYPE instance, ClassEDisplay *display)
    {		
    	// Define the size of the world. Simulation will still work
    	// if bodies reach the end of the world, but it will be slower.
    	b2AABB worldAABB;
    	worldAABB.lowerBound.Set(-100.0f, -100.0f);
    	worldAABB.upperBound.Set(100.0f, 100.0f);
    	
    	// Define the gravity vector.
    	b2Vec2 gravity(0.0f, -10.0f);
    	
    	// Do we want to let bodies sleep?
    	bool doSleep = true;
    	
    	// Construct a world object, which will hold and simulate the rigid bodies.
    	b2World world(worldAABB, gravity, doSleep);
    	
    	// Define the ground body.
    	b2BodyDef groundBodyDef;
    	groundBodyDef.position.Set(0.0f, -10.0f);
    	
    	// Call the body factory which allocates memory for the ground body
    	// from a pool and creates the ground box shape (also from a pool).
    	// The body is also added to the world.
    	b2Body* groundBody = world.CreateBody(&groundBodyDef);
    	
    	// Define the ground box shape.
    	b2PolygonDef groundShapeDef;
    	
    	// The extents are the half-widths of the box.
    	groundShapeDef.SetAsBox(50.0f, 10.0f);
    	
    	// Add the ground shape to the ground body.
    	groundBody->CreateShape(&groundShapeDef);
    	
    	// Define the dynamic body. We set its position and call the body factory.
    	b2BodyDef bodyDef;
    	bodyDef.position.Set(0.0f, 4.0f);
    	b2Body* body = world.CreateBody(&bodyDef);
    	
    	// Define another box shape for our dynamic body.
    	b2PolygonDef shapeDef;
    	shapeDef.SetAsBox(1.0f, 1.0f);
    	
    	// Set the box density to be non-zero, so it will be dynamic.
    	shapeDef.density = 1.0f;
    	
    	// Override the default friction.
    	shapeDef.friction = 0.3f;
    	
    	// Add the shape to the body.
    	body->CreateShape(&shapeDef);
    	
    	// Now tell the dynamic body to compute it's mass properties base
    	// on its shape.
    	body->SetMassFromShapes();
    	
    	// Prepare for simulation. Typically we use a time step of 1/60 of a
    	// second (60Hz) and 10 iterations. This provides a high quality simulation
    	// in most game scenarios.
    	float32 timeStep = 1.0f / 60.0f;
    	int32 iterations = 10;
    	
    	// This is our little game loop.
    	for (int32 i = 0; i < 60; ++i)
    	{
    		// Instruct the world to perform a single step of simulation. It is
    		// generally best to keep the time step and iterations fixed.
    		world.Step(timeStep, iterations);
    	
    		// Now print the position and angle of the body.
    		b2Vec2 position = body->GetPosition();
    		float32 angle = body->GetAngle();
    	
    		//printf("%4.2f %4.2f %4.2f\n", position.x, position.y, angle);
    		char temp[10];
    		ClassEStd::StrCpy(toPrint[i], "X:");
    		ClassEStd::IntToStr(temp, position.x);
    		ClassEStd::StrCat(toPrint[i], temp);
    		ClassEStd::StrCat(toPrint[i], " Y:");
    		ClassEStd::IntToStr(temp, position.y);
    		ClassEStd::StrCat(toPrint[i], temp);
    		ClassEStd::StrCat(toPrint[i], " angle:");
    		ClassEStd::IntToStr(temp, angle);
    		ClassEStd::StrCat(toPrint[i], temp);
    	}
    	
    	// When the world destructor is called, all bodies and joints are freed. This can
    	// create orphaned pointers, so be careful about your world management.
    	return(E_OK);
    }
    	
    //Callback: Called every frame
    ERESULT ClassMain::OnNextFrame(ClassEDisplay *display, unsigned long timedelta)
    {
    	//Retrieve and show the current amount of frames per second
    	display->DrawFont(2, 2, &display->fontinternal, GetFPS());
    	
    	for (int i=0;i<60;i++)
    			display->DrawFont(2,10*i, &display->fontinternal, toPrint[i]);
    	return(E_OK);
    }
    
    //Callback: Called when the user pressed a key or button
    void ClassMain::OnButtonDown(unsigned long bnr, EBUTTONLIST *blist)
    {
    
    }
    
    void ClassMain::OnButtonUp(unsigned long bnr, EBUTTONLIST *blist)
    {
    
    }
    
    void ClassMain::OnExit(ENATIVETYPE instance)
    {
    
    }

  7. #7
    Registered User
    Join Date
    Jun 2008
    Posts
    15

    Re: Why data abort?

    Character limit reached, the reply continued:


    And yea i have made a lot of projects using edgelib and all work fine, this is the only one causing the error.. Ok now edgelib first initiates all devices then calls the onInit function then the onDisplayInit function.. and after that OnNextFrame for the main loop..

    Code:
    	// Define the size of the world. Simulation will still work
    	// if bodies reach the end of the world, but it will be slower.
    	b2AABB worldAABB;
    	worldAABB.lowerBound.Set(-100.0f, -100.0f);
    	worldAABB.upperBound.Set(100.0f, 100.0f);
    	
    	// Define the gravity vector.
    	b2Vec2 gravity(0.0f, -10.0f);
    	
    	// Do we want to let bodies sleep?
    	bool doSleep = true;
    	
    	// Construct a world object, which will hold and simulate the rigid bodies.
    	b2World world(worldAABB, gravity, doSleep);
    	
    	// Define the ground body.
    	b2BodyDef groundBodyDef;
    	groundBodyDef.position.Set(0.0f, -10.0f);
    	
    	// Call the body factory which allocates memory for the ground body
    	// from a pool and creates the ground box shape (also from a pool).
    	// The body is also added to the world.
    	b2Body* groundBody = world.CreateBody(&groundBodyDef);
    	
    	// Define the ground box shape.
    	b2PolygonDef groundShapeDef;
    	
    	// The extents are the half-widths of the box.
    	groundShapeDef.SetAsBox(50.0f, 10.0f);
    	
    	// Add the ground shape to the ground body.
    	groundBody->CreateShape(&groundShapeDef);
    	
    	// Define the dynamic body. We set its position and call the body factory.
    	b2BodyDef bodyDef;
    	bodyDef.position.Set(0.0f, 4.0f);
    	b2Body* body = world.CreateBody(&bodyDef);
    	
    	// Define another box shape for our dynamic body.
    	b2PolygonDef shapeDef;
    	shapeDef.SetAsBox(1.0f, 1.0f);
    	
    	// Set the box density to be non-zero, so it will be dynamic.
    	shapeDef.density = 1.0f;
    	
    	// Override the default friction.
    	shapeDef.friction = 0.3f;
    	
    	// Add the shape to the body.
    	body->CreateShape(&shapeDef);
    	
    	// Now tell the dynamic body to compute it's mass properties base
    	// on its shape.
    	body->SetMassFromShapes();
    	
    	// Prepare for simulation. Typically we use a time step of 1/60 of a
    	// second (60Hz) and 10 iterations. This provides a high quality simulation
    	// in most game scenarios.
    	float32 timeStep = 1.0f / 60.0f;
    	int32 iterations = 10;
    	
    	// This is our little game loop.
    	for (int32 i = 0; i < 60; ++i)
    	{
    		// Instruct the world to perform a single step of simulation. It is
    		// generally best to keep the time step and iterations fixed.
    		world.Step(timeStep, iterations);
    	
    		// Now print the position and angle of the body.
    		b2Vec2 position = body->GetPosition();
    		float32 angle = body->GetAngle();
    	
    		//printf("%4.2f %4.2f %4.2f\n", position.x, position.y, angle);
    		char temp[10];
    		ClassEStd::StrCpy(toPrint[i], "X:");
    		ClassEStd::IntToStr(temp, position.x);
    		ClassEStd::StrCat(toPrint[i], temp);
    		ClassEStd::StrCat(toPrint[i], " Y:");
    		ClassEStd::IntToStr(temp, position.y);
    		ClassEStd::StrCat(toPrint[i], temp);
    		ClassEStd::StrCat(toPrint[i], " angle:");
    		ClassEStd::IntToStr(temp, angle);
    		ClassEStd::StrCat(toPrint[i], temp);
    	}
    The first line of the above code gives the error, and if i remove this code it works fine.. So the problem definetly lies in the port.. well i call no other function and i have already told you how simple the call is..

    BTW i have 3 edgelib static libraries included and 4 stl port libraries.. i am also including the stdapis and stl includes of open c in my project but they shouldnt cause the error because i already have worked on something using the same dependencies and it worked fine.. my first guess for the error is stacksize which btw is set at 0x5000.. and Thanks for helping me stenlik..

  8. #8
    Registered User
    Join Date
    Jun 2008
    Posts
    15

    Re: Why data abort?

    Just noticed you were asking the mmp file too, here it is:

    Code:
    /*
    ============================================================================
     Name		: Box2dTry.mmp
     Author	  : Umar Mukhtiar
     Copyright   : Your copyright notice
     Description : This is the project specification file for Box2dTry.
    ============================================================================
    */
    
    TARGET		  Box2dTry.exe
    TARGETTYPE	  exe
    UID			 0x100039CE 0xF0205DA8
    
    MACRO         SERIES60
    MACRO         APP_UID=0xF0205DA8
    
    EPOCSTACKSIZE 0x4000
    
    START RESOURCE Box2DTry.rss
    HEADER
    TARGETPATH    \resource\apps
    END
    
    START RESOURCE Box2DTry_reg.rss
    #ifdef WINSCW
    TARGETPATH    \private\10003a3f\apps
    #else
    TARGETPATH    \private\10003a3f\import\apps
    #endif
    END
    
    
    USERINCLUDE	 ..\inc
    
    SYSTEMINCLUDE   \epoc32\include\stdapis
    SYSTEMINCLUDE   \epoc32\include\stdapis\stlport
    SYSTEMINCLUDE   \epoc32\include
    SYSTEMINCLUDE   \Edge\include
    
    SOURCEPATH	  ..\src
    SOURCE		  Box2dTry.cpp
    
    LIBRARY       euser.lib
    LIBRARY       apparc.lib
    LIBRARY       cone.lib
    LIBRARY       eikcore.lib
    LIBRARY       eikcoctl.lib
    LIBRARY       ws32.lib    
    LIBRARY       efsrv.lib
    LIBRARY       etel.lib
    LIBRARY       apgrfx.lib
    LIBRARY       estlib.lib
    LIBRARY       avkon.lib
    LIBRARY       etel3rdparty.lib
    LIBRARY       fbscli.lib
    LIBRARY       bitgdi.lib
    LIBRARY	      esock.lib
    LIBRARY	      insock.lib
    LIBRARY	      bluetooth.lib
    LIBRARY       btextnotifiers.lib
    LIBRARY       btmanclient.lib
    LIBRARY       sdpagent.lib
    LIBRARY       sdpdatabase.lib
    LIBRARY       hal.lib
    LIBRARY       ezlib.lib
    LIBRARY       libstdcpp.lib
    LIBRARY       libc.lib
    LIBRARY       libpthread.lib
    LIBRARY       libm.lib
    
    STATICLIBRARY   edge.lib
    STATICLIBRARY   edgerender.lib
    STATICLIBRARY   zlib.lib
    
    LANG SC
    VENDORID	  0
    CAPABILITY	  NONE
    
    
    #ifdef ENABLE_ABIV2_MODE
    DEBUGGABLE
    #endif
    
    SOURCEPATH ..\src\Collision\Shapes
    SOURCE b2CircleShape.cpp b2PolygonShape.cpp b2Shape.cpp
    SOURCEPATH ..\src\Collision
    SOURCE b2BroadPhase.cpp b2CollideCircle.cpp b2CollidePoly.cpp b2Collision.cpp b2Distance.cpp b2PairManager.cpp b2TimeOfImpact.cpp
    SOURCEPATH ..\src\Common
    SOURCE b2BlockAllocator.cpp b2Math.cpp b2Settings.cpp b2StackAllocator.cpp
    SOURCEPATH ..\src\Dynamics\Contacts
    SOURCE b2CircleContact.cpp b2Contact.cpp b2ContactSolver.cpp b2PolyAndCircleContact.cpp b2PolyContact.cpp
    SOURCEPATH ..\src\Dynamics\Joints
    SOURCE b2DistanceJoint.cpp b2GearJoint.cpp b2Joint.cpp b2MouseJoint.cpp b2PrismaticJoint.cpp b2PulleyJoint.cpp b2RevoluteJoint.cpp
    SOURCEPATH ..\src\Dynamics
    SOURCE b2Body.cpp b2ContactManager.cpp b2Island.cpp b2World.cpp b2WorldCallbacks.cpp
    I am getting very desperate to solve this error, as its just so stupid and not letting me even begin on the port.. if you need anything else do tell me.. btw if you want to see the bullet dynamics code its the latest download file available at their site.. its untouched as of yet cause i have the stl port to help it run.. btw the stl dependencies are installed on the device too.. my previous demo that also used the stl port is working fine so that means it shouldnt be linked to the dependencies..

  9. #9
    Registered User
    Join Date
    May 2010
    Posts
    1

    Re: Why data abort?

    Quote Originally Posted by stenlik View Post
    Hi RapchikProgrammer,

    this unfortunatelly does not help us too much It might be something with the EDGELIB... Are you able to do a simple "HelloWorld" wiht the EDGELIB engine? If so, then you can try to add carefully box2d engine files one-by-one...

    It crashes on a place it should not crash as there is nothing wrong about the b2Vec2 class. The crash is not caused by the class itself, but there is probably some other reason. You are talking about the "first line of the code", but what it means? From which place the code is called? Is it E32Main()? Can you paste more code here?

    Can you paste .mmp file here?

    BR
    STeN
    i am also using box2d for applying physics using edgelib but how can i apply box2d physics to sprite or image which i loaded through edgelib plz help me

Similar Threads

  1. Replies: 3
    Last Post: 2008-09-09, 04:53
  2. Replies: 2
    Last Post: 2008-07-03, 15:29
  3. Replies: 1
    Last Post: 2007-04-17, 10:47
  4. Replies: 4
    Last Post: 2006-08-30, 10:15
  5. Unicode Song Title In NSM Ringtone
    By mcai7db3 in forum Smart Messaging
    Replies: 3
    Last Post: 2002-08-28, 06:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×