Here's the call stack from a user's crash report:
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 com.growl.GrowlSafari 0x179d383c writeWithFormat + 25
1 com.growl.GrowlSafari 0x179d388e writeWithFormat + 107
2 com.growl.GrowlSafari 0x179d388e writeWithFormat + 107
3 com.growl.GrowlSafari 0x179d388e writeWithFormat + 107
4 com.growl.GrowlSafari 0x179d388e writeWithFormat + 107
5 com.growl.GrowlSafari 0x179d388e writeWithFormat + 107
The trace cuts off at frame 511.
Here's writeWithFormat
:
int writeWithFormat(FILE *file, NSString *format, ...) {
va_list args;
va_start(args, format);
int written = writeWithFormatAndArgs(file, format, args);
va_end(args);
return written;
}
As you can see, it doesn't call itself.
Here's the function it does call:
int writeWithFormatAndArgs(FILE *file, NSString *format, va_list args) {
return 0;
return fprintf(file, "%s\n", [[[[NSString alloc] initWithFormat:format arguments:args] autorelease] UTF8String]);
}
(As you can guess, this is logging code that's inactivated.)
So, how does this code result in that stack trace?
Disassembly using otx:
_writeWithFormatAndArgs:
+0 00000f68 55 pushl %ebp
+1 00000f69 89e5 movl %esp,%ebp
+3 00000f6b 31c0 xorl %eax,%eax
+5 00000f6d c9 leave
+6 00000f6e c3 ret
_writeWithFormat:
+0 00001823 55 pushl %ebp
+1 00001824 89e5 movl %esp,%ebp
+3 00001826 83ec10 subl $0x10,%esp
+6 00001829 31c0 xorl %eax,%eax
+8 0000182b c9 leave
+9 0000182c c3 ret