Re: How to parse a log file

2020-10-26 Thread Rob Petrovec via Cocoa-dev


> On Oct 26, 2020, at 10:00 PM, Steven Mills via Cocoa-dev 
>  wrote:
> 
> 
>> On Oct 26, 2020, at 17:49:59, James Walker via Cocoa-dev 
>>  wrote:
>> 
>> I don't see any "Download Debug Symbols" in the Organizer.  I don't think it 
>> exists for macOS apps.
>> 
>> However, one can right-click on an archive and select "Show In Finder", then 
>> once in Finder right-click again and Show Package Contents, and drill down 
>> to find dSyms.  (Usually just one, but if your app builds with a private 
>> framework, there could be more.)
> 
> Yes, Apple needs to remember when writing docs that not all apps are for 
> mobile! I have to refer to that doc every time I get a user crashlog, once or 
> twice a year, and it always take the same amount of time to figure out what 
> they're talking about. I really hope they make this a more automatic feature 
> in Xcode: Open the project, open a crashlog, choose a menu item to 
> symbolicate, and let Xcode do the confusing part about loading the dsym from 
> the archives.
While I agree this would be a good thing to have, I don’t see how Xcode 
could find the dSYM to use given that they are typically ephemeral.  The dSYM 
is tied to the build.  So if you build your project twice you will have two 
different dSYMs. Only the dSYM for the build that generated the crash log file 
will be able to symbolicate it.  So, if you want to symbolicate your crash logs 
you need to save your dSYM files & resulting app bundle somewhere for each 
build of your app you publish.  Then you can use them to symbolicate user logs.
What Xcode could do, however, is (given a path to a directory 
containing all the dSYMs for your published builds) parse the log to figure out 
which dSYM/app bundle pair in the directory to use (probably based on build 
info and/or version) and symbolicate.  You would also need to take the 
additional step of properly updating these values in your project for each 
published build.

Either way, that sounds like a reasonable request to make. You should 
write up a bug report and send it to Apple.

—Rob


> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/petrock%40mac.com
> 
> This email sent to petr...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to parse a log file

2020-10-26 Thread Steven Mills via Cocoa-dev


> On Oct 26, 2020, at 17:49:59, James Walker via Cocoa-dev 
>  wrote:
> 
> I don't see any "Download Debug Symbols" in the Organizer.  I don't think it 
> exists for macOS apps.
> 
> However, one can right-click on an archive and select "Show In Finder", then 
> once in Finder right-click again and Show Package Contents, and drill down to 
> find dSyms.  (Usually just one, but if your app builds with a private 
> framework, there could be more.)

Yes, Apple needs to remember when writing docs that not all apps are for 
mobile! I have to refer to that doc every time I get a user crashlog, once or 
twice a year, and it always take the same amount of time to figure out what 
they're talking about. I really hope they make this a more automatic feature in 
Xcode: Open the project, open a crashlog, choose a menu item to symbolicate, 
and let Xcode do the confusing part about loading the dsym from the archives.

--
Steve Mills
Drummer, Mac geek

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to parse a log file

2020-10-26 Thread James Walker via Cocoa-dev

On 10/26/20 3:31 PM, Alex Zavatone via Cocoa-dev wrote:

As a note to Jens’s tip, it’s important to keep the .dSWM files for your 
releases so that you can symbolicate your crash logs.  Crashlytics does this 
for you, but the debug symbols are stripped from released builds to try and 
prevent people from reverse engineering your code and to make the executable 
smaller.

If you have access to the build Mac that the execurable was made on, you should 
be able to check in the Organizer window and look for Download Debug Symbols.


I don't see any "Download Debug Symbols" in the Organizer.  I don't 
think it exists for macOS apps.


However, one can right-click on an archive and select "Show In Finder", 
then once in Finder right-click again and Show Package Contents, and 
drill down to find dSyms.  (Usually just one, but if your app builds 
with a private framework, there could be more.)





And Google for xcode symbolicate binary.

https://developer.apple.com/documentation/xcode/diagnosing_issues_using_crash_reports_and_device_logs/adding_identifiable_symbol_names_to_a_crash_report?language=objc

Alex Zavatone



On Oct 26, 2020, at 5:19 PM, Jens Alfke via Cocoa-dev 
 wrote:




On Oct 26, 2020, at 3:01 PM, Gabriel Zachmann via Cocoa-dev 
 wrote:

Is it possible to determine the exact line in the source code where the error 
occurred?

The "+ " thing in each stack line is the byte offset from the start of the 
function, in the machine code. Not super useful by itself …

If the symbol is simply "MyAppName + " with no function/method, then no 
symbols for your code were available at the time of the crash. That means they weren't 
embedded in the code, and no dSYM file was found.

Or, if the offset is unrealistically large (like hundreds of KB), then the 
function/method name is bogus and is simply the nearest named symbol that the 
stack-dump code could find.

I believe it's possible to use the .dSYM file that was produced with the release build of 
_that exact version_ of your app, to convert those offsets into line numbers — there's a 
tool called "symbolicate" or something like that. I have never done this myself 
so I don't know the details.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com

This email sent to z...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/jamesw%40frameforge3d.com

This email sent to jam...@frameforge3d.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to parse a log file

2020-10-26 Thread Alex Zavatone via Cocoa-dev
As a note to Jens’s tip, it’s important to keep the .dSWM files for your 
releases so that you can symbolicate your crash logs.  Crashlytics does this 
for you, but the debug symbols are stripped from released builds to try and 
prevent people from reverse engineering your code and to make the executable 
smaller.

If you have access to the build Mac that the execurable was made on, you should 
be able to check in the Organizer window and look for Download Debug Symbols.

And Google for xcode symbolicate binary.

https://developer.apple.com/documentation/xcode/diagnosing_issues_using_crash_reports_and_device_logs/adding_identifiable_symbol_names_to_a_crash_report?language=objc

Alex Zavatone


> On Oct 26, 2020, at 5:19 PM, Jens Alfke via Cocoa-dev 
>  wrote:
> 
> 
> 
>> On Oct 26, 2020, at 3:01 PM, Gabriel Zachmann via Cocoa-dev 
>>  wrote:
>> 
>> Is it possible to determine the exact line in the source code where the 
>> error occurred?
> 
> The "+ " thing in each stack line is the byte offset from the start of 
> the function, in the machine code. Not super useful by itself … 
> 
> If the symbol is simply "MyAppName + " with no function/method, then no 
> symbols for your code were available at the time of the crash. That means 
> they weren't embedded in the code, and no dSYM file was found.
> 
> Or, if the offset is unrealistically large (like hundreds of KB), then the 
> function/method name is bogus and is simply the nearest named symbol that the 
> stack-dump code could find.
> 
> I believe it's possible to use the .dSYM file that was produced with the 
> release build of _that exact version_ of your app, to convert those offsets 
> into line numbers — there's a tool called "symbolicate" or something like 
> that. I have never done this myself so I don't know the details.
> 
> —Jens
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to parse a log file

2020-10-26 Thread Alex Zavatone via Cocoa-dev
Starting with Gabriel’s comment.

We can see that at line 2, we have this.
NSCFString characterAtIndex:

And on line 1, we have the thrown exception.

If I’m correct, the assumption here is thatthe operation is trying to get the 
first character of a a string at index 0 and there isn’t any, so the exception 
is thrown.  This indicates a nil string.  Looking at the lines until line 6 
(Gabriel says 7 and he is right, but the line is labeled as 6), the array is 
allocated with an object.  This object is probably nil, which caused the error 
on line 2.

Checks can be written to Gabriel and myself.  Or use PayPal.  : D

I hope this is a correct explanation of how Gabriel got to the answer he 
mentioned.

Alex Zavatone


> On Oct 26, 2020, at 5:01 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> From a user, I received a log file that contains an error (see below)
> and a stack trace of my macOS app.
> 
> Is it possible to determine the exact line in the source code where the error 
> occurred?
> 
> Best regards, Gabriel
> 
> 
> Encl:
> excerpt from log.
> "ArtSaverApp"  is my macOS app.
> 
> 
> 2020-10-23 10:47:30.410560-0400 0x2318dError   0x0  
> 6750   0ArtSaverApp: (AppKit) [com.apple.AppKit:General] *** 
> -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object 
> from objects[0]
> 2020-10-23 10:47:30.433412-0400 0x2318dError   0x0  
> 6750   0ArtSaverApp: (AppKit) [com.apple.AppKit:General] (
>   0   CoreFoundation  0x7fff2d796b57 
> __exceptionPreprocess + 250
>   1   libobjc.A.dylib 0x7fff664475bf 
> objc_exception_throw + 48
>   2   CoreFoundation  0x7fff2d84559e 
> -[__NSCFString characterAtIndex:].cold.1 + 0
>   3   CoreFoundation  0x7fff2d8438c4 
> -[__NSPlaceholderArray initWithCapacity:].cold.1 + 0
>   4   CoreFoundation  0x7fff2d69a8ae 
> -[__NSPlaceholderArray initWithObjects:count:] + 154
>   5   CoreFoundation  0x7fff2d6fff7e 
> __createArray + 47
>   6   CoreFoundation  0x7fff2d6fff41 +[NSArray 
> arrayWithObject:] + 25
>   7   ArtSaverApp 0x000109f12466 ArtSaverApp 
> + 46182
>   8   ArtSaverApp 0x000109f1598d ArtSaverApp 
> + 59789
>   9   AppKit  0x7fff2abcd7a7 
> -[NSApplication(NSResponder) sendAction:to:from:] + 299
>   10  AppKit  0x7fff2abcd642 -[NSControl 
> sendAction:to:] + 86
>   11  AppKit  0x7fff2abcd574 __26-[NSCell 
> _sendActionFrom:]_block_invoke + 136
>   12  AppKit  0x7fff2abcd476 -[NSCell 
> _sendActionFrom:] + 171
>   13  AppKit  0x7fff2abcd3bd 
> -[NSButtonCell _sendActionFrom:] + 96
>   14  AppKit  0x7fff2abc969b 
> NSControlTrackMouse + 1745
>   15  AppKit  0x7fff2abc8fa2 -[NSCell 
> trackMouse:inRect:ofView:untilMouseUp:] + 130
>   16  AppKit  0x7fff2abc8e61 
> -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 691
>   17  AppKit  0x7fff2abc81dd -[NSControl 
> mouseDown:] + 748
>   18  AppKit  0x7fff2abc65f0 
> -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4914
>   19  AppKit  0x7fff2ab30e21 
> -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2612
>   20  AppKit  0x7fff2ab301c9 
> -[NSWindow(NSEventRouting) sendEvent:] + 349
>   21  AppKit  0x7fff2ab2e554 
> -[NSApplication(NSEvent) sendEvent:] + 352
>   22  AppKit  0x7fff2a97b5bf 
> -[NSApplication run] + 707
>   23  AppKit  0x7fff2a94d396 
> NSApplicationMain + 777
>   24  libdyld.dylib   0x7fff675efcc9 start + 1
> )
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to z...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to 

Re: How to parse a log file

2020-10-26 Thread Jens Alfke via Cocoa-dev


> On Oct 26, 2020, at 3:01 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> Is it possible to determine the exact line in the source code where the error 
> occurred?

The "+ " thing in each stack line is the byte offset from the start of the 
function, in the machine code. Not super useful by itself … 

If the symbol is simply "MyAppName + " with no function/method, then no 
symbols for your code were available at the time of the crash. That means they 
weren't embedded in the code, and no dSYM file was found.

Or, if the offset is unrealistically large (like hundreds of KB), then the 
function/method name is bogus and is simply the nearest named symbol that the 
stack-dump code could find.

I believe it's possible to use the .dSYM file that was produced with the 
release build of _that exact version_ of your app, to convert those offsets 
into line numbers — there's a tool called "symbolicate" or something like that. 
I have never done this myself so I don't know the details.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to parse a log file

2020-10-26 Thread Gary L. Wade via Cocoa-dev

Line 7 appears to show your app allocating an array with one of its objects 
being nil.
--
Gary L. Wade
http://www.garywade.com/

> On Oct 26, 2020, at 3:02 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> From a user, I received a log file that contains an error (see below)
> and a stack trace of my macOS app.
> 
> Is it possible to determine the exact line in the source code where the error 
> occurred?
> 
> Best regards, Gabriel
> 
> 
> Encl:
> excerpt from log.
> "ArtSaverApp"  is my macOS app.
> 
> 
> 2020-10-23 10:47:30.410560-0400 0x2318dError   0x0  
> 6750   0ArtSaverApp: (AppKit) [com.apple.AppKit:General] *** 
> -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object 
> from objects[0]
> 2020-10-23 10:47:30.433412-0400 0x2318dError   0x0  
> 6750   0ArtSaverApp: (AppKit) [com.apple.AppKit:General] (
>0   CoreFoundation  0x7fff2d796b57 
> __exceptionPreprocess + 250
>1   libobjc.A.dylib 0x7fff664475bf 
> objc_exception_throw + 48
>2   CoreFoundation  0x7fff2d84559e -[__NSCFString 
> characterAtIndex:].cold.1 + 0
>3   CoreFoundation  0x7fff2d8438c4 
> -[__NSPlaceholderArray initWithCapacity:].cold.1 + 0
>4   CoreFoundation  0x7fff2d69a8ae 
> -[__NSPlaceholderArray initWithObjects:count:] + 154
>5   CoreFoundation  0x7fff2d6fff7e __createArray + 
> 47
>6   CoreFoundation  0x7fff2d6fff41 +[NSArray 
> arrayWithObject:] + 25
>7   ArtSaverApp 0x000109f12466 ArtSaverApp + 
> 46182
>8   ArtSaverApp 0x000109f1598d ArtSaverApp + 
> 59789
>9   AppKit  0x7fff2abcd7a7 
> -[NSApplication(NSResponder) sendAction:to:from:] + 299
>10  AppKit  0x7fff2abcd642 -[NSControl 
> sendAction:to:] + 86
>11  AppKit  0x7fff2abcd574 __26-[NSCell 
> _sendActionFrom:]_block_invoke + 136
>12  AppKit  0x7fff2abcd476 -[NSCell 
> _sendActionFrom:] + 171
>13  AppKit  0x7fff2abcd3bd -[NSButtonCell 
> _sendActionFrom:] + 96
>14  AppKit  0x7fff2abc969b 
> NSControlTrackMouse + 1745
>15  AppKit  0x7fff2abc8fa2 -[NSCell 
> trackMouse:inRect:ofView:untilMouseUp:] + 130
>16  AppKit  0x7fff2abc8e61 -[NSButtonCell 
> trackMouse:inRect:ofView:untilMouseUp:] + 691
>17  AppKit  0x7fff2abc81dd -[NSControl 
> mouseDown:] + 748
>18  AppKit  0x7fff2abc65f0 
> -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4914
>19  AppKit  0x7fff2ab30e21 
> -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2612
>20  AppKit  0x7fff2ab301c9 
> -[NSWindow(NSEventRouting) sendEvent:] + 349
>21  AppKit  0x7fff2ab2e554 
> -[NSApplication(NSEvent) sendEvent:] + 352
>22  AppKit  0x7fff2a97b5bf -[NSApplication 
> run] + 707
>23  AppKit  0x7fff2a94d396 
> NSApplicationMain + 777
>24  libdyld.dylib   0x7fff675efcc9 start + 1
> )
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to parse a log file

2020-10-26 Thread Gabriel Zachmann via Cocoa-dev
From a user, I received a log file that contains an error (see below)
and a stack trace of my macOS app.

Is it possible to determine the exact line in the source code where the error 
occurred?

Best regards, Gabriel


Encl:
excerpt from log.
"ArtSaverApp"  is my macOS app.


2020-10-23 10:47:30.410560-0400 0x2318dError   0x0  
6750   0ArtSaverApp: (AppKit) [com.apple.AppKit:General] *** 
-[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object 
from objects[0]
2020-10-23 10:47:30.433412-0400 0x2318dError   0x0  
6750   0ArtSaverApp: (AppKit) [com.apple.AppKit:General] (
0   CoreFoundation  0x7fff2d796b57 
__exceptionPreprocess + 250
1   libobjc.A.dylib 0x7fff664475bf 
objc_exception_throw + 48
2   CoreFoundation  0x7fff2d84559e 
-[__NSCFString characterAtIndex:].cold.1 + 0
3   CoreFoundation  0x7fff2d8438c4 
-[__NSPlaceholderArray initWithCapacity:].cold.1 + 0
4   CoreFoundation  0x7fff2d69a8ae 
-[__NSPlaceholderArray initWithObjects:count:] + 154
5   CoreFoundation  0x7fff2d6fff7e 
__createArray + 47
6   CoreFoundation  0x7fff2d6fff41 +[NSArray 
arrayWithObject:] + 25
7   ArtSaverApp 0x000109f12466 ArtSaverApp 
+ 46182
8   ArtSaverApp 0x000109f1598d ArtSaverApp 
+ 59789
9   AppKit  0x7fff2abcd7a7 
-[NSApplication(NSResponder) sendAction:to:from:] + 299
10  AppKit  0x7fff2abcd642 -[NSControl 
sendAction:to:] + 86
11  AppKit  0x7fff2abcd574 __26-[NSCell 
_sendActionFrom:]_block_invoke + 136
12  AppKit  0x7fff2abcd476 -[NSCell 
_sendActionFrom:] + 171
13  AppKit  0x7fff2abcd3bd 
-[NSButtonCell _sendActionFrom:] + 96
14  AppKit  0x7fff2abc969b 
NSControlTrackMouse + 1745
15  AppKit  0x7fff2abc8fa2 -[NSCell 
trackMouse:inRect:ofView:untilMouseUp:] + 130
16  AppKit  0x7fff2abc8e61 
-[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 691
17  AppKit  0x7fff2abc81dd -[NSControl 
mouseDown:] + 748
18  AppKit  0x7fff2abc65f0 
-[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4914
19  AppKit  0x7fff2ab30e21 
-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2612
20  AppKit  0x7fff2ab301c9 
-[NSWindow(NSEventRouting) sendEvent:] + 349
21  AppKit  0x7fff2ab2e554 
-[NSApplication(NSEvent) sendEvent:] + 352
22  AppKit  0x7fff2a97b5bf 
-[NSApplication run] + 707
23  AppKit  0x7fff2a94d396 
NSApplicationMain + 777
24  libdyld.dylib   0x7fff675efcc9 start + 1
)





smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com