Denis Tkachov skrev: > I am building crossplatform library with test application for it. All works > great under Windows, but I have problems under Mac OS X: > Sometimes program terminates unexpectedly due to EXC_BAD_ACCESS exception. > Those exceptions are risen in std libraries code. That is very strange > situation because: > 1. Under windows same code works correct. > 2. Exception rises in different places after minor changes in code. > And what is very suspicious is that often code that were actually changed > does not affect code where exception is thrown. For instance – there were > situations when I added some tracing using cout end EXC_BAD_ACCESS began to > raise in other place. Some times same code works, sometimes not! > 3. If I separate class/classes where I get EXC_BAD_ACCESS exception in > runtime to a separate application, I never get such exceptions in that > application. > > I build my application using Xcode v3.0. Due to suggestion on one forum I > have turned optimization off. > No more info about crash is available, just 'Program receives signal: > "EXC_BAD_ACCESS" ' > > Does anybody have an idea? Sounds like some kind of buffer overflow. It is possible you trash some memory somewhere which might affect some other part of the application. If you just overwrite a few bytes (one byte is enough!) the error might not always be detected. -- //*David Sveningsson [eXt]* Freelance coder | Game Development Student http://sidvind.com Thou shalt make thy program's purpose and structure clear to thy fellow man by using the One True Brace Style, even if thou likest it not, for thy creativity is better used in solving problems than in creating beautiful new impediments to understanding.