English 中文(简体)
脊柱状分析指令?
原标题:Spindump analysis instructions?

我收集了一批花生酱,集中在一个需要分析的应用程序上,但我不确定该如何分析这些软件。 我见过其他一些开发商,他们能够快速地从精神上或软件上分析这些软件,然后回到我身边,详细了解绞刑将在哪里玩等等,我希望知道如何正确分析这些软件。

哪里能进行正确的分析?

最佳回答

一般而言:

  • with a crash report, you get a stack trace
  • with spindumps, you get multiple stack traces over a period of time together.

在两种情况下,你可能想要检查一个脊柱:

  1. an infinite loop, probably calling the same function over and over
  2. deadlock.

第一个案例可以被许多呼声反复重复地重复同样的功能所看到。 在这样的情况下,一个很好的方法就是“活动监测 ” — —在现场抽取一个悬吊过程的样本,你可以以几种有用的方式看待它,隐藏无关紧要的框架等等。

第二个案例可以同时用等待锁上的不同线索查看。

以下是一个小例子:

+ 2663 start  (in MyApp) + 52  [0x100001bb4]
+   2663 main  (in MyApp) + 39  [0x100001be7]  main.m:65
+     2663 NSApplicationMain  (in AppKit) + 869  [0x7fff8ea27cb6]
+       2663 -[NSApplication run]  (in AppKit) + 517  [0x7fff8ea83283]
+         2663 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]  (in AppKit) + 128  [0x7fff8ea8bed2]
+           2663 _DPSNextEvent  (in AppKit) + 685  [0x7fff8ea8c613]
+             2663 BlockUntilNextEventMatchingListInMode  (in HIToolbox) + 62  [0x7fff8dd53cd3]
+               2663 ReceiveNextEventCommon  (in HIToolbox) + 356  [0x7fff8dd53e42]
+                 2663 RunCurrentEventLoopInMode  (in HIToolbox) + 209  [0x7fff8dd540a4]
+                   2663 CFRunLoopRunSpecific  (in CoreFoundation) + 290  [0x7fff95dec6b2]
+                     2557 __CFRunLoopRun  (in CoreFoundation) + 1078  [0x7fff95decee6]
+                     ! 2556 __CFRunLoopServiceMachPort  (in CoreFoundation) + 195  [0x7fff95de7803]
+                     ! : 2556 mach_msg  (in libsystem_kernel.dylib) + 70  [0x7fff93630c42]
+                     ! :   2556 mach_msg_trap  (in libsystem_kernel.dylib) + 10  [0x7fff93631686]
+                     ! 1 __CFRunLoopServiceMachPort  (in CoreFoundation) + 199  [0x7fff95de7807]
+                     97 __CFRunLoopRun  (in CoreFoundation) + 728  [0x7fff95decd88]
+                     ! 97 __CFRunLoopDoObservers  (in CoreFoundation) + 369  [0x7fff95e11921]
+                     !   97 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__  (in CoreFoundation) + 23  [0x7fff95e119b7]
+                     !     97 __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke_01208  (in AppKit) + 46  [0x7fff8f05a971]
+                     !       90 _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints  (in AppKit) + 738  [0x7fff8ea8f2ac]
+                     !       : 89 -[NSView displayIfNeeded]  (in AppKit) + 1830  [0x7fff8ea8fd73]

这告诉我,MyApp通过主程序等,终于进入了一个函数 CFRunLoopSpecific ,然后从那里(2557年),它称为CFRunLoopRun ,叫做CFRunLoopServicesMachPort ,叫做> mach_msg ,在 (调用Syscall)进入一个陷阱 -- -- 当它回来时,堆放踪迹返回到 CFRunLoopRunSpecific ,这里叫,然后称为CFRFRunLoopDooppers ,等等。

请注意, 这不是任何绞挂过程的螺旋堆 。 您可以通过这种方式抽样任何运行过程, 并查看该样本中函数的名称 。 但是, 无限环将反复重复一些函数反复重复, 将会反复重复同一个调来树 。 当然, 这可以意味着一个简单的循环, 但是这里可以检查, 如果周期不是无限的, 如果周期不是无限的。 不幸的是, 这些旋转倾弃场通常很长, 取决于您正在调来什么函数, 所以可能需要一些时间来检查 。

行首的 + 符号 仅表示行的起始点 - 没有 + 符号的行表示新线条的起始点 。 和 : 符号使线条, 以便您更容易看到以后的调用- 即调用在同一级别。 此外, 字符也可以使用 \ 字符 。

数字表示应用程序在这个特定调用中花费了多长时间 - 是在样本数量中。 取样工作是, 抽样应用每几毫秒被暂停一次, 堆叠框对每串线索进行检查。 如果应用程序仍然处于同一个功能中, 则函数为+1 。

问题回答

I found this when searching the Mac Developer Resources for spindump . I ve never seen one, but this TechNote referred to in the ReportCrash(8) manual page seems to show you how to read crash logs:

https://developer.apill.com/library/mac/#technotes/tn2004/tn2113.html

And ReportCrash(8) referred to Spindump(8), my apologies. https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/ReportCrash.8.html

但显然这对你没帮助,我把它留在这

希望这能帮助别人





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...