hey,
i’m having some weird crashes on startup running XCode (3.1, OSX 10.5, GCC 4.0). they’re to do with using arrays defined within classes. basically, if i declare an array of ints like this:
int colouroffs_r[8];
int colouroffs_g[8];
int colouroffs_b[8];
i get a crash on init with a stack trace that looks like this:
(gdb) bt
#0 0x95b437d8 in small_malloc_from_free_list ()
#1 0x95b3b4c6 in szone_malloc ()
#2 0x95b3b2f8 in malloc_zone_malloc ()
#3 0x906660ba in _CFPropertyListCreateFromXMLData ()
#4 0x9066662b in CFPropertyListCreateFromXMLData ()
#5 0x95d5320e in _NSParseObjectFromASCIIPropertyListOrSerialization ()
#6 0x95d53096 in +[NSDictionary(NSDictionary) newWithContentsOf:immutable:] ()
#7 0x906e161f in -[__NSPlaceholderDictionary initWithContentsOfFile:] ()
#8 0x95d52fd8 in +[NSDictionary(NSDictionary) dictionaryWithContentsOfFile:] ()
#9 0x90ea2a22 in -[NSInputManager initWithName:host:] ()
#10 0x909fbb95 in +[NSInputManager initialize] ()
#11 0x92d0d8b8 in _class_initialize ()
#12 0x92d0c239 in _class_lookupMethodAndLoadCache ()
#13 0x92d1c6d6 in objc_msgSend ()
#14 0x3e011c01 in -[GLUTApplication run] ()
#15 0x3e023313 in glutMainLoop ()
#16 0x00018c73 in ofUT::MainLoop () at /code/of0.05/apps/vis/damotron/../../../../of0.05_iphone/libs/openFrameworks/app/ofUTGlut.cpp:257
#17 0x00003291 in ofRunApp (OFSA=0x83b000) at /code/of0.05/apps/vis/damotron/../../../libs/openFrameworks/app/ofAppRunner.cpp:162
#18 0x00002709 in main () at /code/of0.05/apps/vis/damotron/src/main.cpp:12
(gdb)
(there’s a couple of wtfs in there: namely, CFPropertyListCreateFromXMLData ? what XML data? huh?)
the strange thing is that i already have a float[] array that i’m declaring inside the class as well, and that’s not causing any problems…
the workaround is to declare the arrays as pointers, and then call new[] on construction. but this is not always ideal, and besides it’s just plain bugging me that things are broken like this.
so. any thoughts? anyone else noticed this problem?