Problem with my own .framework?
Hi,
I have a 2D game framework for a variety of platforms, now I'm trying to create a osx ".framework". I think I was successful, but there is a weird problem that I need help and I think can be related to the .framework configuration/building.
First, the code was created to be static linked only, now we are in the process of open-sourcing it and I would like to generate dynamic linked objects (.framework for osx, .so for linux, .dll for windows).
I created a test case to use this .framework, and with the first case it worked. Then I added more things in the test case class and then I receive weird crashes.
Basically, my test case is a main and a class with some attributes (none pointer - only objects). When I added 2-3 new attributes, it stop working (sizeof this MyClass is about 14xx bytes).
The main is like this:
Using the second test case MyClass If I add something at the position marked with 1 and add breakpoint it runs to the breakpoint but when trying to step over 2 it will crash, it really looks like some kind of stack corruption when trying to create class object (maybe inside the framework?).
Anybody has any clue of what I'm facing here?
I will try to collect more information about the process running and post as I get at my work.
Thank you
I have a 2D game framework for a variety of platforms, now I'm trying to create a osx ".framework". I think I was successful, but there is a weird problem that I need help and I think can be related to the .framework configuration/building.
First, the code was created to be static linked only, now we are in the process of open-sourcing it and I would like to generate dynamic linked objects (.framework for osx, .so for linux, .dll for windows).
I created a test case to use this .framework, and with the first case it worked. Then I added more things in the test case class and then I receive weird crashes.
Basically, my test case is a main and a class with some attributes (none pointer - only objects). When I added 2-3 new attributes, it stop working (sizeof this MyClass is about 14xx bytes).
The main is like this:
Code:
int main(int argc, char **argv)
{
// 1
MyClass class; // 2
return 0;
}Using the second test case MyClass If I add something at the position marked with 1 and add breakpoint it runs to the breakpoint but when trying to step over 2 it will crash, it really looks like some kind of stack corruption when trying to create class object (maybe inside the framework?).
Anybody has any clue of what I'm facing here?
I will try to collect more information about the process running and post as I get at my work.
Thank you
Not much to go on. What does the crash report look like?
Code:
Date/Time: 2010-03-23 10:22:35.778 -0300
OS Version: Mac OS X 10.5.8 (9L31a)
Report Version: 6
Anonymous UUID: D5FC64DD-F71F-4C2A-A37C-1BE33FDEBB16
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c0000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0xffff0680 __bzero + 128 (cpu_capabilities.h:244)
1 org.framework 0x00b5a9e1 SDK::Timeline::Timeline() + 251
2 ...framework.sprite_movie2 0x000030d8 MyGame::MyGame() + 152
3 ...framework.sprite_movie2 0x00004cb5 SDL_main + 37 (main.cpp:7)
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000000 ebx: 0x00b5a8f8 ecx: 0xffff98c0 edx: 0x00000000
edi: 0xc0006740 esi: 0x00320120 ebp: 0xbfffe2f8 esp: 0xbfffe2f4
ss: 0x0000001f efl: 0x00010286 eip: 0xffff0680 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0xc0000000
Binary Images:
0x1000 - 0x5ffb +org.framework.sprite_movie2 ??? (1.0) <1bf636c3b5fb7e140c862ca9d262cde1> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/MacOS/sprite_movie2
0xe000 - 0x12fff +org.xiph.ogg 1.1.4 (1.1.4) <503472612321c5f0090e3ac9a4a277a8> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/Frameworks/Ogg.framework/Versions/A/Ogg
0x18000 - 0x2afeb +org.xiph.oggplay 0.2.0 (0.2.0) <a97fe9ce6b44e24e73eb0631e773225a> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/Frameworks/Oggplay.framework/Versions/A/Oggplay
0x35000 - 0x41fef com.apple.oggz 1.01 (1.0) <2ec3ece6247cec7f8bb5c7237d19c718> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/Frameworks/oggz.framework/Versions/A/oggz
0x4c000 - 0x50ff7 +SDL_image 1.2.10 (1.2.10) <7bc12ad9295e1930dc86d218d7a9be7a> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/Frameworks/SDL_image.framework/Versions/A/SDL_image
0x78000 - 0xdefc3 +SDL 1.2.13 (1.2.13) <7d73799e7426d43c89d3ebcbf65520de> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/Frameworks/SDL.framework/Versions/A/SDL
0xf0000 - 0x124fff +org.xiph.theora 1.1alpha1svn (1.0d6) <b3ca4d927309519eb63e9a9277c819e4> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/Frameworks/Theora.framework/Versions/A/Theora
0x133000 - 0x249ffb +org.xiph.vorbis 1.2.3 (1.2.3) <814b0943b00a753ccdb1c6f2660bac54> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/Frameworks/Vorbis.framework/Versions/A/Vorbis
0x2a5000 - 0x2c8fed com.apple.audio.OpenAL 1.2 (1.2) <dc38faba8e97c51597580a19740afe65> /System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL
0xb09000 - 0xb7dff6 +org.framework 1.01 (1.0) <e5562f6790b32b8f5207eb8f2b92b191> /techfront/SDK/demos/Demos/build/Debug/sprite_movie2.app/Contents/Frameworks/SDK.framework/Versions/A/SDK
0x8fe00000 - 0x8fe2db43 dyld 97.1 (???) <458eed38a009e5658a79579e7bc26603> /usr/lib/dyld
0x90003000 - 0x9000dfeb com.apple.audio.SoundManager 3.9.2 (3.9.2) <caa41909dcb5a18a94bc68cd13999bd5> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x9000f000 - 0x9000fffb com.apple.installserver.framework 1.0 (8) /System/Library/PrivateFrameworks/InstallServer.framework/Versions/A/InstallServer
0x90010000 - 0x9003bfe7 libauto.dylib ??? (???) <42d8422dc23a18071869fdf7b5d8fab5> /usr/lib/libauto.dylib
0x90088000 - 0x900a6fff libresolv.9.dylib ??? (???) <a8018c42930596593ddf27f7c20fe7af> /usr/lib/libresolv.9.dylib
0x900e8000 - 0x900effe9 libgcc_s.1.dylib ??? (???) <28a7cbc3a5ca2982d124668306f422d9> /usr/lib/libgcc_s.1.dylib
0x90125000 - 0x9019fff8 com.apple.print.framework.PrintCore 5.5.4 (245.6) <03d0585059c20cb0bde5e000438c49e1> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x9020e000 - 0x90245fff com.apple.SystemConfiguration 1.9.2 (1.9.2) <8b26ebf26a009a098484f1ed01ec499c> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x9024e000 - 0x9028dfef libTIFF.dylib ??? (???) <801873cbd85ba7bdfe7646fe97a54ca3> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x9028e000 - 0x9029affe libGL.dylib ??? (???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x9029b000 - 0x902d9fff libGLImage.dylib ??? (???) <a6425aeb77f4da13212ac75df57b056d> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
0x9046b000 - 0x90498feb libvDSP.dylib ??? (???) <b232c018ddd040ec4e2c2af632dd497f> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x90499000 - 0x90540feb com.apple.QD 3.11.57 (???) <35f058678972d42b88ebdf652df79956> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x90566000 - 0x90631fef com.apple.ColorSync 4.5.3 (4.5.3) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x90642000 - 0x906f2fff edu.mit.Kerberos 6.0.13 (6.0.13) <804bd1b3f08fb57396781f012006367c> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x906f3000 - 0x906f7fff libGIF.dylib ??? (???) <3c7100e80b7f7ca8809cf9512c1a6004> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x906f8000 - 0x906ffffe libbsm.dylib ??? (???) <5582985a86ea36504cca31788bccf963> /usr/lib/libbsm.dylib
0x90700000 - 0x90a26fe2 com.apple.QuickTime 7.6.4 (1327.73) <96515f6a2d628cd2105c7082295199b5> /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
0x90a27000 - 0x91225fef com.apple.AppKit 6.5.9 (949.54) <4df5d2e2271175452103f789b4f4d8a8> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x91226000 - 0x91226fff com.apple.Carbon 136 (136) <ec1d4184925e652dbe1b9200a5a552ec> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x91227000 - 0x9122dfff com.apple.print.framework.Print 218.0.3 (220.2) <5b7f4ef7c2df36aff9605377775781e4> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x9136b000 - 0x9136bffd com.apple.Accelerate.vecLib 3.4.2 (vecLib 3.4.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x91448000 - 0x9150fff2 com.apple.vImage 3.0 (3.0) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x91510000 - 0x91525ffb com.apple.ImageCapture 5.0.2 (5.0.2) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x9153e000 - 0x9155dffa libJPEG.dylib ??? (???) <50b881dd5a5795d38405c9c88c2806fa> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x9155e000 - 0x915e8fe3 com.apple.DesktopServices 1.4.8 (1.4.8) <a6edef2d49ffdee3b01010b7e6edac1f> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x915e9000 - 0x91618fe3 com.apple.AE 402.3 (402.3) <b13bfda0ad9314922ee37c0d018d7de9> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x91628000 - 0x916a5fef libvMisc.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x916a6000 - 0x916befff com.apple.openscripting 1.2.8 (???) <572c7452d7e740e8948a5ad07a99602b> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x916bf000 - 0x916d7ff7 com.apple.CoreVideo 1.6.0 (20.0) <587c9c8966070a7d50276db35e1c76aa> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
0x916d8000 - 0x91765ff7 com.apple.LaunchServices 292 (292) <a41286c7c1eb20ffd5cc796f791070f0> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x9177a000 - 0x9177bffc libffi.dylib ??? (???) <596e0dbf626b211741cecaa9698f271b> /usr/lib/libffi.dylib
0x917a6000 - 0x9190dff3 libSystem.B.dylib ??? (???) <ae47ca9b1686b065f8ac4d2de09cc432> /usr/lib/libSystem.B.dylib
0x91975000 - 0x91983ffd libz.1.dylib ??? (???) <545ca09467025f77131cfac09d8b9375> /usr/lib/libz.1.dylib
0x91984000 - 0x9199afff com.apple.DictionaryServices 1.0.0 (1.0.0) <7e9ff586b5c9d02b09e2a5527d98524f> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
0x91a3f000 - 0x91a88fef com.apple.Metadata 10.5.8 (398.26) <e4d268ea45379200f03cdc7c8bedae6f> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x91abc000 - 0x91d38fe7 com.apple.Foundation 6.5.9 (677.26) <c68b3cff7864959becfc7fd1a384f925> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x91d39000 - 0x91d49fff com.apple.speech.synthesis.framework 3.7.1 (3.7.1) <06d8fc0307314f8ffc16f206ad3dbf44> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x91d4a000 - 0x91dd7ff7 com.apple.framework.IOKit 1.5.2 (???) <7a3cc24f78f93931731203854ae0d891> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x91dd8000 - 0x91df4ff3 libPng.dylib ??? (???) <271373dd41f56369a3dfca0ed2be579a> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x91e30000 - 0x91e71fe7 libRIP.A.dylib ??? (???) <e9c5df8bd574b71e55ac60c910b929ce> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
0x91e72000 - 0x91e7dfe7 libCSync.A.dylib ??? (???) <d88c20c9a2fd0676dec62fddfa74979f> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
0x91e7e000 - 0x91ed7ff7 libGLU.dylib ??? (???) <a3b9be30100a25a6cd3ad109892f52b7> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x91ed8000 - 0x9202aff3 com.apple.audio.toolbox.AudioToolbox 1.5.2 (1.5.2) /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x9202b000 - 0x923c8fef com.apple.QuartzCore 1.5.8 (1.5.8) <a28fa54346a9f9d5b3bef076a1ee0fcf> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
0x923e8000 - 0x923f0fff com.apple.DiskArbitration 2.2.1 (2.2.1) <75b0c8d8940a8a27816961dddcac8e0f> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x923f1000 - 0x92433fef com.apple.NavigationServices 3.5.2 (163) <91844980804067b07a0b6124310d3f31> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices
0x92439000 - 0x92439ffc com.apple.audio.units.AudioUnit 1.5 (1.5) /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x92940000 - 0x92d50fef libBLAS.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x92d51000 - 0x92e32ff7 libxml2.2.dylib ??? (???) <b3bc0b280c36aa17ac477b4da56cd038> /usr/lib/libxml2.2.dylib
0x92e51000 - 0x92e8bfe7 com.apple.coreui 1.2 (62) /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
0x92e8c000 - 0x92e99fe7 com.apple.opengl 1.5.10 (1.5.10) <5a2813f80c9441170cc1ab8a3dac5038> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x92e9a000 - 0x92eaaffc com.apple.LangAnalysis 1.6.5 (1.6.5) <d057feb38163121ffd871c564c692804> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x92eab000 - 0x92eabff8 com.apple.Cocoa 6.5 (???) <e9318c93615b27231498bbe585b8da98> /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x92eac000 - 0x92f3fff3 com.apple.ApplicationServices.ATS 3.8 (???) <eda9db16110de6b7fd9436cd0daa787d> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x92f40000 - 0x92fbdfeb com.apple.audio.CoreAudio 3.1.2 (3.1.2) <782a08c44be4698597f4bbd79cac21c6> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x92fbe000 - 0x93106ff7 com.apple.ImageIO.framework 2.0.6 (2.0.6) <7f73ef328c8e8566f3f204b5a540a7f0> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x93107000 - 0x9310bfff libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib
0x9310c000 - 0x93168ff7 com.apple.htmlrendering 68 (1.1.3) <a9f65fa1c4668dc7c49af5bf7d5287ad> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering
0x93169000 - 0x931c3ff7 com.apple.CoreText 2.0.4 (???) <f0b6c1d4f40bd21505097f0255abfead> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x931c4000 - 0x93276ffb libcrypto.0.9.7.dylib ??? (???) <9d714c92872a93dd127ea8556b2c8945> /usr/lib/libcrypto.0.9.7.dylib
0x93277000 - 0x932feff7 libsqlite3.0.dylib ??? (???) <3334ea5af7a911637413334154bb4100> /usr/lib/libsqlite3.0.dylib
0x932ff000 - 0x93438ff7 libicucore.A.dylib ??? (???) <f2819243b278259b9a622ea111ea5fd6> /usr/lib/libicucore.A.dylib
0x9344b000 - 0x9344bff8 com.apple.ApplicationServices 34 (34) <e9cd7c823062c4382d89e3c9997f4739> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x9442c000 - 0x947eafea libLAPACK.dylib ??? (???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x947f1000 - 0x94819ff7 com.apple.shortcut 1.0.1 (1.0) <131202e7766e327d02d55c0f5fc44ad7> /System/Library/PrivateFrameworks/Shortcut.framework/Versions/A/Shortcut
0x9481a000 - 0x9483efff libxslt.1.dylib ??? (???) <0a9778d6368ae668826f446878deb99b> /usr/lib/libxslt.1.dylib
0x94b03000 - 0x94b03ffd com.apple.vecLib 3.4.2 (vecLib 3.4.2) /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
0x94b04000 - 0x94b61ffb libstdc++.6.dylib ??? (???) <6106b1f2b0b303b06ae476253dbb5f3f> /usr/lib/libstdc++.6.dylib
0x94c1a000 - 0x94c43fff libcups.2.dylib ??? (???) <ee771753dd1111b656a2daa234a9e971> /usr/lib/libcups.2.dylib
0x94cb7000 - 0x94cb9fff com.apple.securityhi 3.0 (30817) <020419ad33b8638b174e1a472728a894> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
0x94cba000 - 0x94d9afff libobjc.A.dylib ??? (???) <7b92613fdf804fd9a0a3733a0674c30b> /usr/lib/libobjc.A.dylib
0x94ec2000 - 0x94faaff3 com.apple.CoreData 100.2 (186.2) <44df326fea0236718f5ed64084e82270> /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
0x950ea000 - 0x9578afeb com.apple.CoreGraphics 1.409.5 (???) <a40644ccdbdc76e3a0ab4d468b2f9bdd> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x9578b000 - 0x95790fff com.apple.CommonPanels 1.2.4 (85) <3b64ef0de184d09c6f99a1a7e77e42be> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x957a1000 - 0x957a1ffd com.apple.Accelerate 1.4.2 (Accelerate 1.4.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x957a2000 - 0x957a5fff com.apple.help 1.1 (36) <175489f8adf287b3ebd259362b0292c0> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x957e4000 - 0x9588bfec com.apple.CFNetwork 438.14 (438.14) <5f9ee0430b5f6319f18d9b23e777e0d2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x95a50000 - 0x95d2aff3 com.apple.CoreServices.CarbonCore 786.11 (786.14) <d5cceb2fe9551d345d40dd1ecf409ec2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x95d2b000 - 0x95de5fe3 com.apple.CoreServices.OSServices 228 (228) <bc83e97f6888673c33f86652677c09cb> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x966c2000 - 0x969cafe7 com.apple.HIToolbox 1.5.6 (???) <eece3cb8aa0a4e6843fcc1500aca61c5> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x969d1000 - 0x96a64fff com.apple.ink.framework 101.3 (86) <dfa9debcd7537849d228021d1d9c0f63> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x96a65000 - 0x96b98fe7 com.apple.CoreFoundation 6.5.7 (476.19) <a332c8f45529ee26d2e9c36d0c723bad> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x96b99000 - 0x96b99ffa com.apple.CoreServices 32 (32) <2760719f7a81e8c2bdfd15b0939abc29> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x96ba2000 - 0x96ba4ff5 libRadiance.dylib ??? (???) <aefd52482869bb5010672679d151167e> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x96bd5000 - 0x96be1ff9 com.apple.helpdata 1.0.1 (14.2) /System/Library/PrivateFrameworks/HelpData.framework/Versions/A/HelpData
0x96bff000 - 0x96c08fff com.apple.speech.recognition.framework 3.7.24 (3.7.24) <6a6518b392d3d41ace3dcea69d6809d9> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x96c4e000 - 0x96c9fff7 com.apple.HIServices 1.7.1 (???) <ba7fd0ede540a0da08db027f87efbd60> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x96ca0000 - 0x96e71ff3 com.apple.security 5.0.5 (36371) <c7f5d1b89c9891d332c81d1c5fe925e3> /System/Library/Frameworks/Security.framework/Versions/A/Security
0x96e72000 - 0x97343fbe libGLProgrammability.dylib ??? (???) <7f18294a7bd0b6afe4319f29187fc70d> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib
0x974d4000 - 0x974dbff7 libCGATS.A.dylib ??? (???) <1339abfb67318d65c0130f76bc8c4da6> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGATS.A.dylib
0x974dc000 - 0x9755bff5 com.apple.SearchKit 1.2.2 (1.2.2) <3b5f3ab6a363a4d8a2bbbf74213ab0e5> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0xfffe8000 - 0xfffebfff libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib
0xffff0000 - 0xffff1780 libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylibConsole output when using Debugger:
Code:
[Session started at 2010-03-23 10:27:49 -0300.]
GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 76609.
warning: Unable to read symbols from "Debug" (not yet mapped into memory).
warning: Unable to read symbols from "Debug" (not yet mapped into memory).
gdb stack crawl at point of internal error:
[ 0 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (align_down+0x0) [0x1222d8]
[ 1 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (objfile_data+0x69) [0xa783f]
[ 2 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (dwarf2_frame_find_fde+0x33) [0xe032d]
[ 3 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (dwarf2_frame_sniffer+0x2e) [0xe0ddd]
[ 4 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (frame_unwind_find_by_frame+0x3b) [0x129c25]
[ 5 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (get_prev_frame+0x63) [0x129038]
[ 6 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (do_check_is_thread_unsafe+0x195) [0x3eaea]
[ 7 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (catch_errors+0x4d) [0x7abba]
[ 8 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (safe_check_is_thread_unsafe+0x69) [0x3eb7a]
[ 9 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (iterate_over_threads+0x24) [0x78c2a]
[ 10 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (check_safe_call+0xe4) [0x3ec73]
[ 11 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (mi_cmd_stack_check_threads+0x292) [0x1262b]
[ 12 ] /Developer/usr/libexec/gdb/gdb-i386-apple-darwin (captured_mi_execute_command+0x16d) [0x17427]
/SourceCache/gdb/gdb-967/src/gdb/objfiles.c:2218: internal-error: objfile_data: Assertion `data->index < objfile->num_data' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
The Debugger has exited with status 1.The Debugger has exited with status 1.
The Debugger has exited with status 1.The Debugger has exited with status 1.
(gdb)This class works:
Code:
class MyGame : public DemoBase
{
public:
MyGame();
~MyGame();
virtual BOOL Update(f32 dt);
private:
u8 buff[2556];
Sprite spt; // 324 bytes
};This class crash:
Code:
class MyGame : public DemoBase
{
public:
MyGame();
~MyGame();
virtual BOOL Update(f32 dt);
private:
u8 buff[2557]; // 1 byte more
Sprite spt; // 324 bytes
};And here, another sample that does not crash:
Code:
class MyGame : public DemoBase
{
public:
MyGame();
~MyGame();
virtual BOOL Update(f32 dt);
private:
Sprite spt; // 324 bytes
u8 buff[1000000];
};Facts:
1. The framework reimplement new/delete. But In my sample code I does not do explicit calls to new/delete - still this is a possible cause.
2. The total value to cause a crash when using some .framework class (eg. Sprite in the above class) is 2881+ - that is, If the size of class is (until the creation of any framework object) 2880 or less it doesn't crash.
I will create now a statically linked project with the framework code and see what happens.
Thanks
I have tried using a libSDK.a created using CMake and it works, I have also tried to add cpp/h from library directly inside sample application project and the crash persist.
I will do some more testing with different project structures and configuration.
But, I still prefer creating a Framework, as it will respect my LGPL licensing and is easier to MacOSX developers.
I will do some more testing with different project structures and configuration.
But, I still prefer creating a Framework, as it will respect my LGPL licensing and is easier to MacOSX developers.
The only two things that jump out at me are:
1) Allocating 2900 bytes on the stack with a single object seems possibly a bad idea.
2) The stack trace shows MyGame() and SDK::Timeline::Timeline() being called and yet you didn't post that code.
My only guess so far is that you're simply blowing the stack space, but I wouldn't feel confident in trying to figure out what the problem is without knowing what that code is doing.
I have my doubts that this has anything to do with using a framework, but I'm not an expert on the dynamic linker and the limits of static allocations etc.
1) Allocating 2900 bytes on the stack with a single object seems possibly a bad idea.
2) The stack trace shows MyGame() and SDK::Timeline::Timeline() being called and yet you didn't post that code.
My only guess so far is that you're simply blowing the stack space, but I wouldn't feel confident in trying to figure out what the problem is without knowing what that code is doing.
I have my doubts that this has anything to do with using a framework, but I'm not an expert on the dynamic linker and the limits of static allocations etc.
On Linux and Windows, our stack consumption is not a problem. We have a lot more than that in the stack btw.
These two constructors does nothing special:
About the crash at Timeline::Timeline() constructor, that is totally random. If I change the class size to 2890 it will crash in another place, if 2900 then yet another place. It really looks to a .framework configuration problem, as I said, using a static lib linked all works fine.
These two constructors does nothing special:
Code:
MyGame::MyGame()
: DemoBase()
{
}
DemoBase::DemoBase()
: pRenderer(NULL)
{
}About the crash at Timeline::Timeline() constructor, that is totally random. If I change the class size to 2890 it will crash in another place, if 2900 then yet another place. It really looks to a .framework configuration problem, as I said, using a static lib linked all works fine.
AFAIK BSD limits the stack size to 8MB by default, up to a maximum of 64MB (http://homepage.mac.com/eric.c/hpc/conte...OS%20X.pdf). Linux allows the stack to grow to the total system memory space if you want it to. I'm not sure what it is on Windows, but given this behavior I'll bet that it can grow the stack to something larger.
If you were using a 64-bit program it'd have a larger stack size from what I've read. (Your debugging output indicates that it's in 32-bit mode).
So, heap allocate that object and keep references to it using smart pointers and you should be good to go. (Though you will have to remember to release it when you're done with it). http://www.boost.org/doc/libs/1_42_0/lib...rt_ptr.htm
If you were using a 64-bit program it'd have a larger stack size from what I've read. (Your debugging output indicates that it's in 32-bit mode).
So, heap allocate that object and keep references to it using smart pointers and you should be good to go. (Though you will have to remember to release it when you're done with it). http://www.boost.org/doc/libs/1_42_0/lib...rt_ptr.htm
Mac OS X uses an 8M stack for the main thread and 512K stacks for secondary threads IIRC. You can also request larger stacks (for your main thread, at link time, for pthreads, at pthread creation time).
It seems unlikely that static vs. dynamic linking could change that...
It seems unlikely that static vs. dynamic linking could change that...
I created again the project from nothing and now everything is working, I have no idea about what was happening.
Thanks
Thanks
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Framework Problem | silver9172 | 4 | 3,135 |
Dec 31, 2008 01:29 PM Last Post: Bachus |
|
| Framework and bundle problem | pointer | 2 | 2,459 |
Dec 8, 2006 04:29 AM Last Post: MacFiend |
|
| CPlusTest Problem With Framework in App Bundle | kingofsquirrels | 2 | 3,182 |
Jul 19, 2005 03:55 AM Last Post: kingofsquirrels |
|

