Any useful information in this output from malloc_history?
Any useful information in this output from malloc_history?
- Subject: Any useful information in this output from malloc_history?
- From: Jerry Krinock <email@hidden>
- Date: Sun, 14 Sep 2008 17:42:55 -0700
I have one of those bugs I've read about that cause the application to
crash at some unpredictable time after certain events have occurred.
So I followed all the advice on NSZombie, malloc debugging, etc.
Also, I set a breakpoint in Xcode's Breakpoints window at
"malloc_error_break", and checked the box. Later I noticed Xcode had
filled in its "Location" is "libSystem.B.dylib", so that seems like it
probably worked.
With all these guns loaded, reproducing the crash, sometimes I get 100
or so malloc messages logged, sometimes none, sometimes one. When I
get 100 or more, malloc_history gives me a blank line for most of
them. Let's consider a trial when I got one "live" one...
malloc: *** error for object 0x16f42770: incorrect checksum for freed
object - object was probably modified after being freed.
So I invoked malloc_history and got the result below [1]. It looks
like to me like 0x16f42770 got had four "malloc events" before the
crash:
alloc, within NSLog(), duplicating a string with strdup()
free, within NSLog(). Balances the alloc, as expected, I suppose.
alloc, within -[HtmlTypeStore
browserXMLClauseFromBmItem:indentLevel:fileProperties:fixture:]
alloc, within NSLog()
So, it looks like maybe this area of memory was used once, by NSLog(),
freed, and then used twice again. The fourth event might be an
undesired over-write but then that might be OK the third event was a
temporary variable that had gone out of scope?
Well, I understand that it's not going to jump out and say "Your
problem is here, Dummy!", but I was hoping maybe someone who is
smarter than me could tell me if there is any potentially useful
information in there at I am missing. The man page for malloc_history
does not say how to read its output. Does the number in square
brackets after "Call" tell me anything useful? How about the [arg=...]?
Thanks,
Jerry
[1] My malloc_history output. For readability, I inserted extra line
breaks between the "Calls". I assume that the pipe (|) characters
delimit the symbols on the call "stack".
Jerrys-Mac-Mini:Volumes jk$ malloc_history 37867 0x16f42770
Call [2] [arg=13]: thread_a079cfa0 |start | main | NSApplicationMain |
-[NSApplication run] | -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] | _DPSNextEvent |
AEProcessAppleEvent | aeProcessAppleEvent |
dispatchEventAndSendReply(AEDesc const*, AEDesc*) |
aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned
char*) | _NSAppleEventManagerGenericHandler | -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:] | -
[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]
| -[NSApplication(NSAppleEventHandling) _handleAEOpen:] | -
[NSApplication _sendFinishLaunchingNotification] | -[NSApplication
_postDidFinishNotification] | -[NSNotificationCenter
postNotificationName:object:] | -[NSNotificationCenter
postNotificationName:object:userInfo:] |
_CFXNotificationPostNotification | __CFXNotificationPost |
_nsnote_callback | -[BkmmController applicationDidFinishLaunching:] | -
[BmDoc savePanelDidEnd:returnCode:contextInfo:] | -[BmDoc
saveClose:contextInfo:] | -[BmDoc
writeBookmarksFileDebugOption:close:contextInfo:] | -[BmDoc
writeBookmarksTrialDebugOption:close:contextInfo:] | -[HtmlTypeStore
browserXMLDataFromRoot:fileProperties:fixture:] | NSLog | NSLogv |
_CFLogvEx | __CFLogCString | asl_send | asl_set_query | strdup |
malloc | malloc_zone_malloc
Call [4] [arg=0]: thread_a079cfa0 |start | main | NSApplicationMain | -
[NSApplication run] | -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] | _DPSNextEvent |
AEProcessAppleEvent | aeProcessAppleEvent |
dispatchEventAndSendReply(AEDesc const*, AEDesc*) |
aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned
char*) | _NSAppleEventManagerGenericHandler | -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:] | -
[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]
| -[NSApplication(NSAppleEventHandling) _handleAEOpen:] | -
[NSApplication _sendFinishLaunchingNotification] | -[NSApplication
_postDidFinishNotification] | -[NSNotificationCenter
postNotificationName:object:] | -[NSNotificationCenter
postNotificationName:object:userInfo:] |
_CFXNotificationPostNotification | __CFXNotificationPost |
_nsnote_callback | -[BkmmController applicationDidFinishLaunching:] | -
[BmDoc savePanelDidEnd:returnCode:contextInfo:] | -[BmDoc
saveClose:contextInfo:] | -[BmDoc
writeBookmarksFileDebugOption:close:contextInfo:] | -[BmDoc
writeBookmarksTrialDebugOption:close:contextInfo:] | -[HtmlTypeStore
browserXMLDataFromRoot:fileProperties:fixture:] | NSLog | NSLogv |
_CFLogvEx | __CFLogCString | asl_free | free | malloc_zone_free
Call [2] [arg=32]: thread_a079cfa0 |start | main | NSApplicationMain |
-[NSApplication run] | -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] | _DPSNextEvent |
AEProcessAppleEvent | aeProcessAppleEvent |
dispatchEventAndSendReply(AEDesc const*, AEDesc*) |
aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned
char*) | _NSAppleEventManagerGenericHandler | -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:] | -
[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]
| -[NSApplication(NSAppleEventHandling) _handleAEOpen:] | -
[NSApplication _sendFinishLaunchingNotification] | -[NSApplication
_postDidFinishNotification] | -[NSNotificationCenter
postNotificationName:object:] | -[NSNotificationCenter
postNotificationName:object:userInfo:] |
_CFXNotificationPostNotification | __CFXNotificationPost |
_nsnote_callback | -[BkmmController applicationDidFinishLaunching:] | -
[BmDoc savePanelDidEnd:returnCode:contextInfo:] | -[BmDoc
saveClose:contextInfo:] | -[BmDoc
writeBookmarksFileDebugOption:close:contextInfo:] | -[BmDoc
writeBookmarksTrialDebugOption:close:contextInfo:] | -[HtmlTypeStore
browserXMLDataFromRoot:fileProperties:fixture:] | -[HtmlTypeStore
browserXMLDataFromCollections:fileProperties:fixture:] | -
[HtmlTypeStore
browserXMLClauseFromBmItem:indentLevel:fileProperties:fixture:] | -
[HtmlTypeStore
browserXMLClauseFromBmItem:indentLevel:fileProperties:fixture:] | -
[NSPlaceholderMutableString init] | CFStringCreateMutable |
_CFRuntimeCreateInstance | malloc_zone_malloc
Call [2] [arg=68]: thread_a079cfa0 |start | main | NSApplicationMain |
-[NSApplication run] | -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] | _DPSNextEvent |
AEProcessAppleEvent | aeProcessAppleEvent |
dispatchEventAndSendReply(AEDesc const*, AEDesc*) |
aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned
char*) | _NSAppleEventManagerGenericHandler | -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:] | -
[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]
| -[NSApplication(NSAppleEventHandling) _handleAEOpen:] | -
[NSApplication _sendFinishLaunchingNotification] | -[NSApplication
_postDidFinishNotification] | -[NSNotificationCenter
postNotificationName:object:] | -[NSNotificationCenter
postNotificationName:object:userInfo:] |
_CFXNotificationPostNotification | __CFXNotificationPost |
_nsnote_callback | -[BkmmController applicationDidFinishLaunching:] | -
[BmDoc savePanelDidEnd:returnCode:contextInfo:] | -[BmDoc
saveClose:contextInfo:] | -[BmDoc
writeBookmarksFileDebugOption:close:contextInfo:] | -[BmDoc
writeBookmarksTrialDebugOption:close:contextInfo:] | NSLog | NSLogv |
_CFLogvEx | __CFLogCString | CFCalendarDecomposeAbsoluteTime |
_CFCalendarDecomposeAbsoluteTimeV | __CFCalendarSetupCal |
__CFCalendarCreateUCalendar | ucal_open | ucal_open |
icu::TimeZone::createTimeZone(icu::UnicodeString const&) |
icu::TimeZone::createSystemTimeZone(icu::UnicodeString const&) |
malloc | malloc_zone_malloc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden