iOS9: duplicated lines in crash reports are causin

2019-03-18 03:09发布

问题:

This is not a question because I have already found a workaround. I am publishing it so that others can take advantage on the hours I was spending on it, and use my suggested workaround.

I have got some strange crash reports - a single line was duplicated many times:

...
0x190e08000 -        0x190e49fff  Notes arm64  <f45c09ce977b3282ab0e879252dfebee> /System/Library/PrivateFrameworks/Notes.framework/Notes
0x190f9c000 -        0x190fa6fff  NotificationsUI arm64  <73dcb247ed183ce7bb330d7bb55f93bd> /System/Library/PrivateFrameworks/NotificationsUI.framework/NotificationsUI
0x190fa8000 -        0x190faafff  OAuth arm64  <c2658cb3208b342dbe1e91cea30ebdd5> /System/Library/PrivateFrameworks/OAuth.framework/OAuth
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x191900000 -        0x191903fff  ParsecSubscriptionServiceSupport arm64  <c70467637c9332c7b0be897200c9ccb1> /System/Library/PrivateFrameworks/ParsecSubscriptionServiceSupport.framework/ParsecSubscriptionServiceSupport
0x1919c8000 -        0x1919ebfff  Pegasus arm64  <82f60f2d5ad73b5fa89d283a4e992e88> /System/Library/PrivateFrameworks/Pegasus.framework/Pegasus
0x191a30000 -        0x191a57fff  PersistentConnection arm64  <8d0b7602daee3aa588c37704a6e3a206> /System/Library/PrivateFrameworks/PersistentConnection.framework/PersistentConnection
...

it caused the symbolicatecrash (perl) script to get stuck. The reason is that the script was originally intended to chain similar entries, assuming they have a different base address. However that code was never working because it has a bug:

# add ourselves to that chain
$images{$nextIDKey}{nextID} = $image{base};

# and store under the key we just recorded
$bundlename = $bundlename . $image{base};

The bug is that the first line should actually be:

$images{$nextIDKey}{nextID} = $bundlename . $image{base};

However I'm suggesting a workaround that will ignore these duplicated lines by adding a next command a bit above this code, i.e.

# frameworks and apps (and whatever) may share the same name, so disambiguate
if ( defined($images{$bundlename}) ) {
    next;

this is not a clean solution because we are missing some protection here, but a least it will work for most of the cases.

Anyway hoping for Apple to remove these duplications soon.

回答1:

You can use the following shell script which will patch symbolicatecrash to fix it:

curl -o /tmp/t.patch https://raw.githubusercontent.com/zqxiaojin/OptSymbolicatecrash/master/fix_dead_loop.patch && cd `xcode-select -p`/../SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/ && sudo patch symbolicatecrash  /tmp/t.patch && cd -

Or copy the symbolicatecrash from my github https://github.com/zqxiaojin/OptSymbolicatecrash