Stack smashing protection isn't enabled

I was looking for a way to enable stack canaries for my ios application in swift but then i found that recent version of xcodes have the flag required to enable stack canaries is enabled by default. So then i was looking for a way to ensure the stack canaries are enabled and as the other sites say i tried with the otool command in terminal($ otool -Iv appName |grep stack_chk) to ensure it and expecting it to return 'stack_chk_guard and stack_chk_fail' flags but it did not return any value/flags. So I then tried setting manually the flag '-fstack-protector-all' under 'other C flags', still I could see no flags with otool command

Replies

im facing this same issue, did you find any solution to it?

I am also facing this issue! Please someone help 😀

Seen this recent thread same topic?


Re: In what versions of Xcode is stack protector enabled?

i experienced the same.


You have to ensure that you use binary file for testing (not ipa or archive). Binary file can be found inside ipa/archive after unzip.


BUT there is also another problem. So at that time I archived the project, exported to ipa using APPSTORE signing, use otool to check and nothing showed. I tried re-exported ipa but now using ADHOC signing, use otool to check and now the result shown.


*you can also try the binary in DerivedData folder when you build for debug.

**actually unchecking "include bitcode" when exporting also works.


And i found someone explain why appstore signing cause otool result check not shown. Its because bitcode something. https://forums.developer.apple.com/thread/106300