views:

67

answers:

1

When my app starts up, I get 1 or more 4.00KB memory leaks with the frame being _stack_chk_fail and the library libSystem.B.dylib. Any suggestions on what this could be would be appreciated. Thank you.

+2  A: 

This website - http://blog.freimann.org/archives/16-__stack_chk_fail-when-compiling-filo.html

suggests you add

-fno-stack-protector

to your compile options.

jmont
Thanks, but it does not seem that the link you reference is related to Cocoa/Objective-C
Run Loop
gcc is the compiler that objc uses to compile (just like C), and this is a flag that gcc accepts. Under Xcode > Project > Edit Project Settings > Build you should be able to find a field to add this flag for gcc.
jmont
Fair enough, but fo you have any idea what this flag means? I would not like to add something to the compile options without understanding why or what it does
Run Loop
according to http://www.trl.ibm.com/projects/security/ssp/this flag disables the stack-smashing protector, which protects your program against a stack smashing attack. since i wasn't familiar with that term I looked it up:from http://searchsecurity.techtarget.com/sDefinition/0,,sid14_gci913633,00.html"Stack smashing is causing a stack in a computer application or operating system to overflow." Which is very fitting for this website....
jmont
Anyway, I don't think your computer will explode if you turn this flag on, I'd give it a try (maybe just like a temporary fix?) and if it doesn't work, then I would check if your gcc needs updating/patches.
jmont
Thank you very much.
Run Loop