GCD should be easier to debug: backtrace
| Originator: | numist | ||
| Number: | rdar://12578679 | Date Originated: | 25-Oct-2012 05:29 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode Version 4.5.1 (4G1004)/LLDB-167.4 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary:
Debugging concurrency/mutexes in GCD gets harder the more you do it, especially as you make an effort to do things more asynchronously.
Example: "how did this block come to be scheduled?"
Steps to Reproduce:
- foo {
dispatch_async(dispatch_get_global_queue(0,0), ^{
[self bar];
});
}
- bar {
// breakpoint
}
Expected Results:
Some way to determine the history:
#0 0x00002005 in -[Foo bar] at /Users/.../Foo.m:28
#1 0x049ea53f in __59-[Foo foo]_block_invoke_0 at /Users/.../Foo.m:23
#2 0x049fc014 in -[Foo foo] at /Users/.../Foo.m:22
Actual Results:
#0 0x00002005 in -[Foo bar] at /Users/.../Foo.m:28
#1 0x00002105 in __59-[Foo foo]_block_invoke_0 at /Users/.../Foo.m:22
#2 0x049ea53f in _dispatch_call_block_and_release ()
#3 0x049fc014 in _dispatch_client_callout ()
#4 0x049ed2e8 in _dispatch_root_queue_drain ()
#5 0x049ed450 in _dispatch_worker_thread2 ()
#6 0x96267e12 in _pthread_wqthread ()
...what?
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!