Random "EXC_BAD_ACCESS"

Here is a mystery I could really use some help solving. I am building an AS ObjC replacement for a AS Studio “front end” to a complex batch of scripts that build a catalog from data contained in a database. Due to the complexity, it will be very difficult for me to share example code, etc. I am experiencing a LOT of random problems with code that used to be just fine (outside of AS Studio/ObjC) but am able to troubleshoot and work through that. This, however, is a total mystery.

I get an error on page 4 of the first catalog section:

“No result was returned from some part of this expression. (error -2763)
(gdb)”

the debug navigator is highlighted showing “23 Main” highlighted with this line highlighted:

return NSApplicationMain(argc, (const char **)argv);

A little icon arrow pointing at it says:

Thread 1: Program received signal: “EXC_BAD_ACCESS”

Thinking that I have a bug somewhere ” a subroutine causing an error and not returning a result or something ” I enable a setting that makes all my subroutine start logging when they begin running to help me identify the location of the problem in my code. Suddenly the script works well past page 4 building like it always does with NO PROBLEM. I disable my diagnostic code and the problem returns.

I should add that this problem seems to appear randomly. Sometimes, the script also works without my diagnostic code active as well.

Can anyone help point me in the right direction to 1) decode what this error is indicating or 2) figure out what to do to resolve it?

EXC_BAD_ACCESS means a message has been sent to an object that is no longer. You shouldn’t be getting it with garbage collection in your AS code. So it’s possibly a bug in some framework you’re calling. Whatever, it’s notoriously hard to track down.