EXC_BAD_ACCESS, but without zombies, and not in assembly debugging configuration

It drives me crazy. I just downloaded my first app on the App Store for the first time, and, of course, now my app explodes left and right. When I build with the release build configuration, I get randomly EXC_BAD_ACCESSafter I overlay the application for a certain amount of time. I turned Zombies on again, but the problem does not exceed the variable, since I do not receive a message about the message transmission of the released variable.

The error always appears in the same place in my code. It looks like I'm trying to save a variable that was not initialized properly. I have no idea how I can do this.

But here's the weird thing: if I create a debug version configuration, IT WILL NEVER MISS. I can fight on this subject all day and it is amazing. I am creating a Release configuration, and it becomes short-lived all the time.

Looking at the build settings in the two configurations, there are not many differences. When debugging, the GCC 4.0 optimization level is “None,” and in Release it is “Fastest, Smallest.” If I switch the optimization level in Release to "None", the application will behave. Does anyone know what I should look for to fix this? Alternatively, how many bad things happen if I distribute without optimization?

UPDATE:

Dang! . . exercise, , .

3--5- , . , , , . NSDecimalNumber 0-3, , NSDecimalNumber . , . , NSDecimalNumber -1 , .

, , , [[NSNumber numberWithDouble:num] decimalValue][[NSNumber numberWithInteger:num] decimalValue]

, , .

, , , "" - . , , , "" , - , . 8 ^ (

UPDATE:

, . , :

...

[... ...]

This GDB was configured as "i386-apple-darwin".warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).

warning: Unable to read symbols from "UIKit" (not yet mapped into memory).

warning: Unable to read symbols for "/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics" (file not found).

warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).
Program loaded.

sharedlibrary apply-load-rules all

Attaching to program: `/Users/...', process 10066.

Re-enabling shared library breakpoint 1

Cannot access memory at address 0x4

Cannot access memory at address 0x4

(gdb) 
+3
2

, Zombies, ... , Zombies . ; ( , , ).

, . , , ivar, , , . ; , .

, , .

, . . . .

. №1 , . , , , . .

+2

, -. "", . C -Wall -Wextra.

LOT , /, .., () . , , , , : , ( ). 100% , , , .

+1

Source: https://habr.com/ru/post/1709151/


All Articles