Re: XCode built project crash related to .o files and p_threads?
Re: XCode built project crash related to .o files and p_threads?
- Subject: Re: XCode built project crash related to .o files and p_threads?
- From: Stephen Northcott <email@hidden>
- Date: Wed, 4 Feb 2009 15:13:09 +0700
Thanks for your feedback..
I was actually pretty aware of what was going on with the threads
involved and their mutexes.
The issue with fresh builds vs. incremental builds is almost
certainly a red herring. Perhaps it's due to warm vs. cold disk
caches changing the timing of how the code runs. Who knows? My
point is, you don't have to rely on guessing. Deadlocks are very
easy to see from program state.
It was kind of a red herring... But I am confused by what I have found..
What was happening (and I have no idea how) was that a #define in
an .h file was in charge of making certain variables be defined.
However, the corresponding #ifdef with the same label in the .cpp file
were working the opposite way round, or simply ignoring the #define
from the .h file. It's almost as if the #define was not carrying
across from the .h file to the .cpp file.
Am I missing something there?
The variables affected by the #define in the .h file were either 44
bytes long or 40 bytes long.
This was offsetting the address of a mutex by 4 bytes depending on the
way I built the project.
I have no idea how or why, and I could even see the change happen
while stepping through the code in XCode.
i.e. When the class instance was created it was one way and the moment
I jumped into a member function it was addressing everything with a 4
byte offset.
This has to be a bug in XCode / gcc IMO, because the same variable at
different stages in a trace would still be in the same class instance,
but have a different address.
Somehow with an incremental build this was causing a crash.
With a clean build it was not. I can only think that padding of some
sort came into play.
Good luck,
Ken
Kind regards,
Stephen
_______________________________________________
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