Mac app crashes using library built with Xcode4.3+, which used to work with Xcode4.2
Mac app crashes using library built with Xcode4.3+, which used to work with Xcode4.2
- Subject: Mac app crashes using library built with Xcode4.3+, which used to work with Xcode4.2
- From: Beinan Li <email@hidden>
- Date: Thu, 09 Aug 2012 16:08:03 -0400
Hello Xcode,
I was using Xcode4.2 to develop C++ plugin for an external Mono-based app.
After upgrading to Xcode4.3, the app starts to crash using my plugin.
I traced down and found that this was related to one of my plugin libs for audio decoding (PCM/AAC/OggVorbis).
I wonder if there are any compiler changes that I need to pay attention to.
Here are some clues:
- The lib built with Xcode4.2 works fine.
- If rebuilt using Xcode4.3 or 4.4, using the same xcodeproj, it crashes when working with OggVorbis or AAC.
- PCM always works when the lib is built with either Xcode4.2 or 4.3+.
I'm in a difficult situation where the external app is copy-right protected and I cannot attach Xcode debugger to it.
Printf/fwrite based debug led me to the finding that the crash happens at a memcpy call in my lib.
What it does is basically like this (pseudo code):
void MyBuffer::Write(void* in_data, uint32_t in_size)
{
uint8_t* buf_data = (uint8_t*) m_dataBlocks.pData + m_writeOffset;
memcpy(buf_data, in_data, in_size);
m_writeOffset += in_size;
}
I also found that if I hack the in_size, e.g., use in_size/2 instead of in_size. Then the crash stopped from happening
with Xcode4.3+, although my plugin would not work as expected apparently.
I would appreciate it if anybody can share some ideas about any subtle compiler changes in Xcode4.3+.
Thanks!!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden