packagesdev / ips2crash

.ips to .crash converter
BSD 3-Clause "New" or "Revised" License
59 stars 14 forks source link

Allow parsing of source "A" images #2

Closed JamesBucanek closed 2 years ago

JamesBucanek commented 2 years ago

Many of the crash reports I have include an image object from source "A":

  "usedImages" : [
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703613407232,
    "size" : 225280,
    "uuid" : "12bd6f13-c452-35ee-9069-51befef29f1a",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  ...
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703613632512,
    "size" : 49152,
    "uuid" : "29a2750e-f31b-3630-8761-242a6bc3e99e",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],

These image records have no name, arch, or path properties and are typically zero sized.

The problem is, the code that builds the array of images objects will fail if any image object can't be parsed, leaving a nil array of images. The result is that none of the stack frame symbols get translated properly.

My solution was to simply allow for this kind of image.

While I was in there, I also added a source property and implemented the code to parse the architecture property (which was defined, but wasn't being read).