Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Bus error occured (Mac OSX + COLLADA DOM2.0)

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    6

    Bus error occured (Mac OSX + COLLADA DOM2.0)

    Hi,
    I'm getting an error on running my app.
    Only at debug build, Release build is OK.

    (I use Mac OSX Leopard, Xcode 3.0, COLLADA DOM 2.0, 2.1.)

    At
    Code :
    DAE dae; 
    colladaRoot = dae.open(fileName);

    Error message is :

    Code :
    The Debugger has exited due to signal 10 (SIGBUS).The Debugger has exited due to signal 10 (SIGBUS).


    When I debugging, “EXC_BAD_ACCESS” is occurred.
    and program stopped at this line :

    Code :
    #0	0x000023fb in std::_Rb_tree<daeSidRef, std::pair<daeSidRef const, daeSidRef::resolveData>, std::_Select1st<std::pair<daeSidRef const, daeSidRef::resolveData> >, std::less<daeSidRef>, std::allocator<std::pair<daeSidRef const, daeSidRef::resolveData> > >::_S_right at stl_tree.h:497 
    #1	0x00002bad in std::_Rb_tree<daeSidRef, std::pair<daeSidRef const, daeSidRef::resolveData>, std::_Select1st<std::pair<daeSidRef const, daeSidRef::resolveData> >, std::less<daeSidRef>, std::allocator<std::pair<daeSidRef const, daeSidRef::resolveData> > >::_M_erase at stl_tree.h:1056 
    #2	0x00869415 in std::_Rb_tree<daeSidRef, std::pair<daeSidRef const, daeSidRef::resolveData>, std::_Select1st<std::pair<daeSidRef const, daeSidRef::resolveData> >, std::less<daeSidRef>, std::allocator<std::pair<daeSidRef const, daeSidRef::resolveData> > >::clear at stl_tree.h:666 
    #3	0x0086947b in std::map<daeSidRef, daeSidRef::resolveData, std::less<daeSidRef>, std::allocator<std::pair<daeSidRef const, daeSidRef::resolveData> > >::clear at stl_map.h:465 
    #4	0x00867ebb in daeSidRefCache::clear at daeSIDResolver.cpp:497 
    #5	0x00874854 in daeSTLDatabase::insertElement at daeSTLDatabase.cpp:222 
    #6	0x00871db4 in daeSTLDatabase::insertChildren at daeSTLDatabase.cpp:232 
    #7	0x008743dd in daeSTLDatabase::insertElement at daeSTLDatabase.cpp:195 
    #8	0x00871db4 in daeSTLDatabase::insertChildren at daeSTLDatabase.cpp:232 
    #9	0x008743dd in daeSTLDatabase::insertElement at daeSTLDatabase.cpp:195 
    #10	0x0085629c in daeDocument::insertElement at daeDocument.cpp:25 
    #11	0x008587ff in daeElement::setDocument at daeElement.cpp:144 
    #12	0x0084bd78 in daeElement::setDocument at daeElement.h:332 
    #13	0x0084bef9 in daeDocument::setDomRoot at daeDocument.h:54 
    #14	0x00872a59 in daeSTLDatabase::createDocument at daeSTLDatabase.cpp:87 
    #15	0x00871a8f in daeSTLDatabase::insertDocument at daeSTLDatabase.cpp:72 
    #16	0x0085ddbc in daeIOPluginCommon::read at daeIOPluginCommon.cpp:82 
    #17	0x0084a283 in DAE::openCommon at dae.cpp:174 
    #18	0x0084a370 in DAE::open at dae.cpp:180


    Does anybody know what's wrong ?

    thanks!

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    That's a weird error. Looks like memory corruption. On Linux I use valgrind to check for memory errors. I'm not sure what you'd use on Mac.

    Does domTest run properly? "domTest -all" to run all the tests.

    Steve

  3. #3
    Junior Member
    Join Date
    May 2008
    Posts
    6
    Thank you very much!

    domTest runs properly.
    >All tests passed.
    Both Release build and Debug build.

    There are some tools for checking memory error in Mac OSX. ("MallocDebug" and "Instruments")
    But I couldn't find out any problems.
    (Usually, Debug build application terminated, and there were no information.. In fact, I don't know well about these tools.)

    Are there any errors in Xcode or my environment...?
    I have no idea...
    I'm busy today, but I will try reinstalling Xcode..

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    I'm busy today, but I will try reinstalling Xcode..
    Woah, you really shouldn't have to do that. I'm not sure what the error is though. Did you follow the setting up guide to get your Xcode project set up? There isn't really anything special you need to do for the Mac build so I kind of doubt you screwed something up there.

    It might help to build a test program manually on the command line, just to make sure there isn't an Xcode problem somewhere. Rebuild domTest with 'verbose=yes' to see how a DOM client app is built on the command line.

  5. #5
    Just based on your debugger dump, it appears that the DOM has already started reading the document when it dies. It's possible that your file has something strange in it that is triggering the crash. I would suggest trying to backtrack from the point of failure to see what it was reading at the time the crash occurred.

    You might also want to check your file with the Collada Coherency Checker or post the file here so we can have a look at it.

    Sadly, valgrind isn't available for the Mac yet...someone at apple has done a usable port but is having trouble getting Apple to approve releasing the code

  6. #6
    Junior Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    6

    Tutorial for Leopard

    tsurushuu, it is indeed a weird error, I have successfully compiled that under Mac OS X 10.5.2 with no errors, I wrote a tutorial specifically for Leopard, you can find it here: http://www.black-fluid.com/?p=4

    It might helps, there is more to come, read through it, there might be something you spot which could help.

  7. #7
    Junior Member
    Join Date
    May 2008
    Posts
    6
    I read "setting up guide" tutorial, and Toxinide's tutorial,
    (Thank you very much! Toxinide, )
    I did exactly same way as these.

    I tried building my app from terminal.
    This worked properly! no error.
    g++ -c main.cpp -Wall -g -D_DEBUG -arch i386 -Iinclude -Iinclude/1.4 -o test.o
    g++ -Wall -g -D_DEBUG -arch i386 -o testtest test.o -Fbuild/mac-1.4 -framework Collada14Dom

    But, Xcode still generates buggy app when Debug build...

    I uses Japanese version of Mac OSX Leopard.
    And I use Macports, installed many applications. (TeX, programming tool.....)
    Is this suspicious?


    This is my code:

    Code :
    #include <iostream>
    using namespace std;
     
    #include <dae.h>
    #include <dom/domCOLLADA.h>
     
    domCOLLADA* colladaRoot = 0;
     
    int main(int argc, char* argv[]) {
     
    	string fileName = "valid.dae";
    	if(argc > 1){
    		fileName = argv[1];
    	}
     
    	DAE dae;
    	colladaRoot = dae.open(fileName);
     
    	cout << "OK" << endl;
     
    	return 0;
    }

    .dae file:
    Code :
    <?xml version="1.0" encoding="UTF-8"?>
    <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
    	<asset>
    		<contributor/>
    		<created>2008-04-08T13:07:52-08:00</created>
    		<modified>2008-04-08T13:07:52-08:00</modified>
    	</asset>
    </COLLADA>

  8. #8
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    I uses Japanese version of Mac OSX Leopard.
    And I use Macports, installed many applications. (TeX, programming tool.....)
    Is this suspicious?
    To my knowledge that shouldn't be a problem.

    I'm stumped about what the issue could be. Here are a couple more things to try.

    - Comment out the dae.open line. Does the app run fine then?
    - Use otool -L on both the working exe produced via the command line and the broken exe produced via Xcode. Do they link against the same libs?

    otool -L ~/.../testapp

  9. #9
    Junior Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    6

    Buggy Code

    Hi tsurushuu
    I am glad you like the tutorial, your code seems fine, if you can compile from the Terminal then you have something not setup correctly with XCode. Have you added the Header path, the official guide states:

    In Xcode add the DOM framework to your project (Project->Add to Project). In the build configuration of your target, add <dom-path>/Collada14Dom.framework/Headers to Header Search Paths. For a debug build the framework name is Collada14Dom-d.framework, so adjust paths accordingly.

    It might as simple as that.

  10. #10
    Junior Member
    Join Date
    May 2008
    Posts
    6
    Sorry, in my previous comment,
    I linked Release version of COLLADA DOM....
    I compiled again, this time, link Debug version.

    g++ -Wall -g -D_DEBUG -arch i386 -o testtest test.o -Fbuild/mac-1.4-framework-d -framework Collada14Dom-d

    Then, this was broken..
    Bus error was occurred.


    I tried simplest code.
    This still has an error...


    #include <dae.h>
    #include <dom/domCOLLADA.h>

    domCOLLADA* colladaRoot = 0;

    int main(int argc, char* argv[])
    {

    DAE dae;
    // colladaRoot = dae.open(fileName);

    return 0;
    }
    This time, debugger stopped on this line,
    in destructor of DAE.
    More precisely, in daeSidRefCache::clear

    This is same to error message of my first post.

    Any bug? or My std library is broken?

    #0 0x00001df9 in std::_Rb_tree<daeSidRef, std:air<daeSidRef const, daeSidRef::resolveData>, std::_Select1st<std:air<daeSidRef const, daeSidRef::resolveData> >, std::less<daeSidRef>, std::allocator<std:air<daeSidRef const, daeSidRef::resolveData> > >::_S_right at stl_tree.h:497
    #1 0x000025ab in std::_Rb_tree<daeSidRef, std:air<daeSidRef const, daeSidRef::resolveData>, std::_Select1st<std:air<daeSidRef const, daeSidRef::resolveData> >, std::less<daeSidRef>, std::allocator<std:air<daeSidRef const, daeSidRef::resolveData> > >::_M_erase at stl_tree.h:1056
    #2 0x00868415 in std::_Rb_tree<daeSidRef, std:air<daeSidRef const, daeSidRef::resolveData>, std::_Select1st<std:air<daeSidRef const, daeSidRef::resolveData> >, std::less<daeSidRef>, std::allocator<std:air<daeSidRef const, daeSidRef::resolveData> > >::clear at stl_tree.h:666
    #3 0x0086847b in std::map<daeSidRef, daeSidRef::resolveData, std::less<daeSidRef>, std::allocator<std:air<daeSidRef const, daeSidRef::resolveData> > >::clear at stl_map.h:465
    #4 0x00866ebb in daeSidRefCache::clear at daeSIDResolver.cpp:497
    #5 0x00871120 in daeSTLDatabase::clear at daeSTLDatabase.cpp:373
    #6 0x0087114f in daeSTLDatabase::~daeSTLDatabase at daeSTLDatabase.cpp:24
    #7 0x0084aafd in DAE::~DAE at dae.cpp:76
    #8 0x0084ad33 in DAE::~DAE at dae.cpp:81
    #9 0x000018ab in main at main.cpp:13
    And I will try otool -L

Page 1 of 3 123 LastLast

Posting Permissions

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