SIGBUS at startup
I've written a little test program with XCode on OS X. I've included the SDL.framework framework so that I can use SDL from that program.
For testing I kept the main() function emtpy, just return 0. However, when I compile and run I get a 'SIGBUS' error and the program exits.
Any idea what could be wrong?
I have no previous experience with this debugger, but I started it with the debugger, and this is where it crashed. The line where the debugger pointed at is marked.
Any idea what could be wrong? Note that this program is nothing but two unused classes, a main function with return 0, linked with SDL.
0x00002620 <+0156> addis r2,r31,00x00002624 <+0160> lwz r2,27208(r2)0x00002628 <+0164> lwz r12,0(r2)0x0000262c <+0168> cmpwi cr7,r12,00x00002630 <+0172> beq- cr7,0x263c <start+184>0x00002634 <+0176> mtctr r120x00002638 <+0180> bctrl0x0000263c <+0184> bl 0x84e0 <dyld_stub___keymgr_dwarf2_register_sections>0x00002640 <+0188> addis r2,r31,00x00002644 <+0192> lwz r12,27192(r2)0x00002648 <+0196> lwz r0,0(r12)0x0000264c <+0200> cmpwi cr7,r0,00x00002650 <+0204> beq+ cr7,0x265c <start+216>0x00002654 <+0208> mtctr r120x00002658 <+0212> bctrl0x0000265c <+0216> bl 0x2840 <start+700>0x00002660 <+0220> bl 0x294c <start+968>0x00002664 <+0224> addis r3,r31,00x00002668 <+0228> addi r3,r3,250360x0000266c <+0232> addi r4,r1,560x00002670 <+0236> bl 0x2b60 <start+1500>0x00002674 <+0240> lwz r3,56(r1)0x00002678 <+0244> cmpwi cr7,r3,00x0000267c <+0248> beq- cr7,0x2684 <start+256>0x00002680 <+0252> bl 0x8500 <dyld_stub_atexit>0x00002684 <+0256> li r0,00x00002688 <+0260> addis r2,r31,00x0000268c <+0264> lwz r2,27204(r2)0x00002690 <+0268> stw r0,0(r2)0x00002694 <+0272> lwz r10,0(r29)0x00002698 <+0276> cmpwi cr7,r10,00x0000269c <+0280> bne+ cr7,0x2724 <start+416>0x000026a0 <+0284> b 0x26e8 <start+356>0x000026a4 <+0288> mr r11,r20x000026a8 <+0292> mr r2,r90x000026ac <+0296> cmpwi cr7,r0,470x000026b0 <+0300> bne+ cr7,0x26b8 <start+308>0x000026b4 <+0304> mr r8,r110x000026b8 <+0308> lbz r0,0(r2)0x000026bc <+0312> addi r9,r2,10x000026c0 <+0316> extsb. r0,r00x000026c4 <+0320> bne+ 0x26a4 <start+288>0x000026c8 <+0324> cmpwi cr7,r8,00x000026cc <+0328> beq- cr7,0x26e0 <start+348>0x000026d0 <+0332> addi r0,r8,10x000026d4 <+0336> addis r2,r31,00x000026d8 <+0340> stw r0,27188(r2)0x000026dc <+0344> b 0x26e8 <start+356>0x000026e0 <+0348> addis r2,r31,00x000026e4 <+0352> stw r10,27188(r2)0x000026e8 <+0356> lwz r0,0(r30)0x000026ec <+0360> cmpwi cr7,r0,00x000026f0 <+0364> bne+ cr7,0x26fc <start+376>0x000026f4 <+0368> mr r6,r300x000026f8 <+0372> b 0x270c <start+392>0x000026fc <+0376> mr r6,r300x00002700 <+0380> lwzu r0,4(r6)0x00002704 <+0384> cmpwi cr7,r0,00x00002708 <+0388> bne+ cr7,0x2700 <start+380>0x0000270c <+0392> mr r3,r280x00002710 <+0396> mr r4,r290x00002714 <+0400> mr r5,r300x00002718 <+0404> addi r6,r6,40x0000271c <+0408> bl 0x2ed4 <__darwin_gcc3_preregister_frame_info+220>0x00002720 <+0412> bl 0x84c0 <dyld_stub_exit> <== CRASH LINE0x00002724 <+0416> lbz r0,0(r10)0x00002728 <+0420> extsb. r0,r00x0000272c <+0424> beq- 0x26e0 <start+348>0x00002730 <+0428> addi r2,r10,10x00002734 <+0432> mr r11,r100x00002738 <+0436> li r8,00x0000273c <+0440> b 0x26ac <start+296>0x00002740 <+0444> mflr r00x00002744 <+0448> bcl- 20,4*cr7+so,0x2748 <start+452>0x00002748 <+0452> mflr r120x0000274c <+0456> addis r12,r12,00x00002750 <+0460> mtlr r00x00002754 <+0464> addi r12,r12,239280x00002758 <+0468> mtctr r120x0000275c <+0472> bctr0x00002760 <+0476> mflr r00x00002764 <+0480> bcl- 20,4*cr7+so,0x2768 <start+484>0x00002768 <+0484> mflr r120x0000276c <+0488> addis r12,r12,00x00002770 <+0492> mtlr r00x00002774 <+0496> addi r12,r12,19000x00002778 <+0500> mtctr r120x0000277c <+0504> bctr0x00002780 <+0508> mflr r00x00002784 <+0512> bcl- 20,4*cr7+so,0x2788 <start+516>0x00002788 <+0516> mflr r120x0000278c <+0520> addis r12,r12,00x00002790 <+0524> mtlr r00x00002794 <+0528> addi r12,r12,239280x00002798 <+0532> mtctr r120x0000279c <+0536> bctr0x000027a0 <+0540> mflr r00x000027a4 <+0544> bcl- 20,4*cr7+so,0x27a8 <start+548>0x000027a8 <+0548> mflr r120x000027ac <+0552> addis r12,r12,00x000027b0 <+0556> mtlr r00x000027b4 <+0560> addi r12,r12,9520x000027b8 <+0564> mtctr r120x000027bc <+0568> bctr0x000027c0 <+0572> mflr r00x000027c4 <+0576> bcl- 20,4*cr7+so,0x27c8 <start+580>0x000027c8 <+0580> mflr r120x000027cc <+0584> addis r12,r12,00x000027d0 <+0588> mtlr r00x000027d4 <+0592> addi r12,r12,3880x000027d8 <+0596> mtctr r120x000027dc <+0600> bctr0x000027e0 <+0604> mflr r00x000027e4 <+0608> bcl- 20,4*cr7+so,0x27e8 <start+612>0x000027e8 <+0612> mflr r120x000027ec <+0616> addis r12,r12,00x000027f0 <+0620> mtlr r00x000027f4 <+0624> addi r12,r12,880x000027f8 <+0628> mtctr r120x000027fc <+0632> bctr0x00002800 <+0636> mflr r00x00002804 <+0640> bcl- 20,4*cr7+so,0x2808 <start+644>0x00002808 <+0644> mflr r120x0000280c <+0648> addis r12,r12,00x00002810 <+0652> mtlr r00x00002814 <+0656> addi r12,r12,237680x00002818 <+0660> mtctr r120x0000281c <+0664> bctr
Any idea what could be wrong? Note that this program is nothing but two unused classes, a main function with return 0, linked with SDL.
SDl for mac requires you add the files SDL_main.h and SDL_main.m to your project - did you do it? in XCode to create a SDl project i just suggest you use file -> new project -> SDl applciation. sdl should have installed a XCode template on your computer - i recommand you use it!
good luck
good luck
Quote:Original post by Marianne
SDl for mac requires you add the files SDL_main.h and SDL_main.m to your project - did you do it? in XCode to create a SDl project i just suggest you use file -> new project -> SDl applciation. sdl should have installed a XCode template on your computer - i recommand you use it!
good luck
Now you say so, that template is there, including those files.
I wonder though, I'm using C++ - not Objective C. Why can't it work just like I'm used to it working? Include headers -> link with libs and go?
At least it works now, thanks a great deal
Because the build for SDL on macosx requires carbon (or cocoa, I can't remember which) -- and that is objective - c, hence the SDLMain.h and SDLMain.m being necessary.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement