4

I got an EXC_BAD_ACCESS in my iOS program, and I suspect that the cause is in one of my anonymous blocks, but there are quite a few of those, and I need to narrow down the candidate list a bit.

The stack trace shows the current frame as __lldb_unnamed_function4866$$ProjectName. There are no line numbers or source file names that I can see. No local variables visible either. The debugger shows machine code instructions. This was running on a background event queue, so there is none of my code anywhere else on the stack.

How do I go about finding out what function this is?

Thilo
  • 257,207
  • 101
  • 511
  • 656
  • 1
    __lldb_unnamed_function... is what re-symbolication gives when the symbols are not available due to having been stripped. – OrangeDog Feb 12 '14 at 17:09

2 Answers2

0

I came across a similar situation, and while I can't help (yet) with your problem, I think I know a man who can.

Check out http://www.realmacsoftware.com/blog/block-debugging, for an exposition of how to find out a lot more about the evil block in question.

It doesn't help me much, because I'm working from a crash log, but if you're still interested, this is going to give you just about as much as you can get about the unnamed block.

Warning, the above link exposes you to a lot of arcane knowledge, and may make you feel a little inadequate :)

[Editted to add] Not good enough yet?

After searching through disassembly and doing some manual symbolication, I came to the conclusion that the ___lldb_unnamed_function is a red herring.

I followed How to manually symbolicate a crash log with atos, and it pointed the finger at a completely different function, which came from a 3rd party library, and was a very good candidate for the crash reason (killed by angry watchdog with badf00d.)

In the course of this enquiry, I also came across hopper, a great disassembler; I used the demo version to confirm what the suspicious code was doing, so I'm giving them a namecheck.

Community
  • 1
  • 1
Gordon Dove
  • 2,537
  • 1
  • 22
  • 23
-1

Try to set an exception breakpoint by clicking on the plus symbol within the breakpoint navigator cmd + 6. For getting an overview of debugging best practices if found it useful to consider a Stanford Lecture on iTunes U

btype
  • 1,593
  • 19
  • 32
  • I did that, and it stopped at the EXC_BAD_ACCESS, but still only machine code there and raw machine registers. But I have now found out that the code is not one of my blocks, but somewhere in the guts of a closed-source library that I use. I get the same error with their sample app (and none of my code). Filed a bug report with them. Still, I'd like to know what `__lldb_unnamed_function` is and how to debug them. – Thilo Sep 10 '12 at 06:22