what does "err = Resource busy" mean?

  • I've been trying to track down a bug that crashes a document-based cocoa application which seems to be caused by referring to an object that no longer exists, but thus far haven't succeeded in determining what that object is.  Yes, I've tried using the Zombies tool in Instruments but to no avail (perhaps because of my inexperience using Instruments).  The crash occurs very inconsistently at the end of scanning a set of data in a completely ordinary text file; i.e. sometimes I can scan the same set of data 10 or 15 times before crashing, sometimes the crash occurs when the data are scanned for the first or second time, but (almost?) always it occurs somewhere after the data have been scanned (which is indicated by the line from the console shown below that reads "the state at end of scanning is 4").  And I'm really clueless about what the following lines from the console are telling me; any suggestions that you can offer would be greatly appreciated.

    I'm using Xcode 4.6 4H127 and OS X 10.7.5.

    Boyd

    5/25/13 9:59:21.381 AM SuperSpagedi: looks like there's a distance matrix
    5/25/13 9:59:21.381 AM SuperSpagedi: the label is pop1
    5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop2
    5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop3
    5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop4
    5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop5
    5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop6
    5/25/13 9:59:21.383 AM SuperSpagedi: the state at end of scanning is 4
    5/25/13 9:59:35.465 AM com.apple.debugserver-199: 2 +63.911824 sec [0322/0303]: error: ::ptrace (request = PT_THUPDATE, pid = 0x0323, tid = 0x2007, signal = 0) err = Resource busy (0x00000010)
    5/25/13 9:59:35.465 AM com.apple.debugserver-199: 3 +0.000197 sec [0322/0303]: error: ::task_info ( target_task = 0x1b03, flavor = TASK_BASIC_INFO, task_info_out => 0x7fff6a6d5fb0, task_info_outCnt => 10 ) err = (os/kern) invalid argument (0x00000004)
    5/25/13 9:59:35.468 AM Xcode: [MT] DVTAssertions: Warning in /SourceCache/IDEKit/IDEKit-2109/Framework/Classes/Editor/IDEEditorContext.m:617
    Details:  Lost history for x-xcode-disassembly://stack_frame?processID€3&threadID=1&frameID=0
    Object:  <IDEEditorContext: 0x402d72a40>
    Method:  -_greatestDocumentAncestorWasForgotten
    Thread:  <NSThread: 0x40010a220>{name = (null), num = 1}
    Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
  • Whatever situation your variables references are in, it seems to be crashing the debugger. File a bug report like it says, and providing the code in the report so it can be repeated would probably be helpful.

    As for your problem, if you have a crash occurring because of a bad reference to a deallocated object, Instruments isn't helpful, turning on zombies in the scheme, adding a breakpoint on all exceptions, and running your code until it triggers a zombie error will be most helpful. In the console it'll tell you the class of object that was messaged, and in the stack you will see where the message occurred. You should be able to track it down from there.

    --
    Seth Willits

    On May 25, 2013, at 10:25 AM, Boyd Collier wrote:

    > I've been trying to track down a bug that crashes a document-based cocoa application which seems to be caused by referring to an object that no longer exists, but thus far haven't succeeded in determining what that object is.  Yes, I've tried using the Zombies tool in Instruments but to no avail (perhaps because of my inexperience using Instruments).  The crash occurs very inconsistently at the end of scanning a set of data in a completely ordinary text file; i.e. sometimes I can scan the same set of data 10 or 15 times before crashing, sometimes the crash occurs when the data are scanned for the first or second time, but (almost?) always it occurs somewhere after the data have been scanned (which is indicated by the line from the console shown below that reads "the state at end of scanning is 4").  And I'm really clueless about what the following lines from the console are telling me; any suggestions that you can offer would be greatly appreciated.
    >
    > I'm using Xcode 4.6 4H127 and OS X 10.7.5.
    >
    > Boyd
    >
    >
    >
    >
    > 5/25/13 9:59:21.381 AM SuperSpagedi: looks like there's a distance matrix
    > 5/25/13 9:59:21.381 AM SuperSpagedi: the label is pop1
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop2
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop3
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop4
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop5
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop6
    > 5/25/13 9:59:21.383 AM SuperSpagedi: the state at end of scanning is 4
    > 5/25/13 9:59:35.465 AM com.apple.debugserver-199: 2 +63.911824 sec [0322/0303]: error: ::ptrace (request = PT_THUPDATE, pid = 0x0323, tid = 0x2007, signal = 0) err = Resource busy (0x00000010)
    > 5/25/13 9:59:35.465 AM com.apple.debugserver-199: 3 +0.000197 sec [0322/0303]: error: ::task_info ( target_task = 0x1b03, flavor = TASK_BASIC_INFO, task_info_out => 0x7fff6a6d5fb0, task_info_outCnt => 10 ) err = (os/kern) invalid argument (0x00000004)
    > 5/25/13 9:59:35.468 AM Xcode: [MT] DVTAssertions: Warning in /SourceCache/IDEKit/IDEKit-2109/Framework/Classes/Editor/IDEEditorContext.m:617
    > Details:  Lost history for x-xcode-disassembly://stack_frame?processID€3&threadID=1&frameID=0
    > Object:  <IDEEditorContext: 0x402d72a40>
    > Method:  -_greatestDocumentAncestorWasForgotten
    > Thread:  <NSThread: 0x40010a220>{name = (null), num = 1}
    > Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
  • Argh!  I found my error, and, as is usually the case, it was the result of being careless when hurrying.  I did a copy-and-paste from code written for ints when writing an analogous method for doubles, so that there was a line that read _offDiagPtr = (double*)calloc( (size_t)numberOfElements, (size_t)sizeof(int));  when it should have read
    _offDiagPtr = (double*)calloc( (size_t)numberOfElements, (size_t)sizeof(double));

    I still don't understand the lengthy message that admonishes me to file a bug report, but I will comply.

    Thanks, Seth, for taking a few minutes to reply to my original query.

    Boyd

    On May 25, 2013, at 10:25 AM, Boyd Collier wrote:

    > I've been trying to track down a bug that crashes a document-based cocoa application which seems to be caused by referring to an object that no longer exists, but thus far haven't succeeded in determining what that object is.  Yes, I've tried using the Zombies tool in Instruments but to no avail (perhaps because of my inexperience using Instruments).  The crash occurs very inconsistently at the end of scanning a set of data in a completely ordinary text file; i.e. sometimes I can scan the same set of data 10 or 15 times before crashing, sometimes the crash occurs when the data are scanned for the first or second time, but (almost?) always it occurs somewhere after the data have been scanned (which is indicated by the line from the console shown below that reads "the state at end of scanning is 4").  And I'm really clueless about what the following lines from the console are telling me; any suggestions that you can offer would be greatly appreciated.
    >
    > I'm using Xcode 4.6 4H127 and OS X 10.7.5.
    >
    > Boyd
    >
    >
    >
    >
    > 5/25/13 9:59:21.381 AM SuperSpagedi: looks like there's a distance matrix
    > 5/25/13 9:59:21.381 AM SuperSpagedi: the label is pop1
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop2
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop3
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop4
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop5
    > 5/25/13 9:59:21.382 AM SuperSpagedi: the label is pop6
    > 5/25/13 9:59:21.383 AM SuperSpagedi: the state at end of scanning is 4
    > 5/25/13 9:59:35.465 AM com.apple.debugserver-199: 2 +63.911824 sec [0322/0303]: error: ::ptrace (request = PT_THUPDATE, pid = 0x0323, tid = 0x2007, signal = 0) err = Resource busy (0x00000010)
    > 5/25/13 9:59:35.465 AM com.apple.debugserver-199: 3 +0.000197 sec [0322/0303]: error: ::task_info ( target_task = 0x1b03, flavor = TASK_BASIC_INFO, task_info_out => 0x7fff6a6d5fb0, task_info_outCnt => 10 ) err = (os/kern) invalid argument (0x00000004)
    > 5/25/13 9:59:35.468 AM Xcode: [MT] DVTAssertions: Warning in /SourceCache/IDEKit/IDEKit-2109/Framework/Classes/Editor/IDEEditorContext.m:617
    > Details:  Lost history for x-xcode-disassembly://stack_frame?processID€3&threadID=1&frameID=0
    > Object:  <IDEEditorContext: 0x402d72a40>
    > Method:  -_greatestDocumentAncestorWasForgotten
    > Thread:  <NSThread: 0x40010a220>{name = (null), num = 1}
    > Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
  • On May 26, 2013, at 3:39 PM, Boyd Collier <bcollier2...> wrote:

    >
    > I still don't understand the lengthy message that admonishes me to file a bug report, but I will comply.

    That’s unrelated to your issue (though perhaps triggered by it).

    Xcode is complaining that its debugger’s internal state got corrupted.

    --Kyle Sluder
previous month may 2013 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today