def breakpad_decode(crash, app_db, version):
    trace_dir = paths.trace_dir_path(app_db)
    outfilepath = paths.trace_out_path(app_db, crash)
    errfilepath = paths.trace_err_path(app_db, crash)

    # make sure trace_dir exists
    makedirs(s3.localpath(trace_dir), exist_ok=True)

    minidump_path = paths.minidump_path(app_db, crash)
    lib_path = paths.lib_extract_dir_path(app_db, version)
    symbols_path = os.path.join(lib_path, 'symbols')
    lib_tar_path = paths.lib_tar_path(app_db, version)

    s3.get(minidump_path)
    if not os.path.exists(s3.localpath(symbols_path)):
        # pull from s3 and untar
        s3.get(lib_tar_path)
        breakpad_extract_syms(s3.localpath(lib_tar_path),
                              s3.localpath(lib_path))

    p = 1
    with open(s3.localpath(outfilepath), 'wb') as outfile:
        with open(s3.localpath(errfilepath), 'wb') as errfile:
            p = subprocess.call([
                    MINIDUMP_STACKWALK_EXEC,
                    s3.localpath(minidump_path),
                    s3.localpath(symbols_path),
                    ], stdout=outfile, stderr=errfile)

    s3.put_file(outfilepath)
    return p or parse_trace(s3.localpath(outfilepath), crash, app_db)
Esempio n. 2
0
def breakpad_decode(crash, app_db, version):
    trace_dir = paths.trace_dir_path(app_db)
    outfilepath = paths.trace_out_path(app_db, crash)
    errfilepath = paths.trace_err_path(app_db, crash)

    # make sure trace_dir exists
    makedirs(s3.localpath(trace_dir), exist_ok=True)

    minidump_path = paths.minidump_path(app_db, crash)
    lib_path = paths.lib_extract_dir_path(app_db, version)
    symbols_path = os.path.join(lib_path, 'symbols')
    lib_tar_path = paths.lib_tar_path(app_db, version)

    s3.get(minidump_path)
    if not os.path.exists(s3.localpath(symbols_path)):
        # pull from s3 and untar
        s3.get(lib_tar_path)
        breakpad_extract_syms(s3.localpath(lib_tar_path),
                              s3.localpath(lib_path))

    p = 1
    with open(s3.localpath(outfilepath), 'wb') as outfile:
        with open(s3.localpath(errfilepath), 'wb') as errfile:
            p = subprocess.call([
                MINIDUMP_STACKWALK_EXEC,
                s3.localpath(minidump_path),
                s3.localpath(symbols_path),
            ],
                                stdout=outfile,
                                stderr=errfile)

    s3.put_file(outfilepath)
    return p or parse_trace(s3.localpath(outfilepath), crash, app_db)
 def s3get(self, key):
     s3key = self.s3bucket.get_key(key)
     if s3key is None:
         return
     filepath = self.localpath(key)
     makedirs(os.path.dirname(filepath), exist_ok=True)
     _logger.debug("Getting %s from S3" % (key,))
     s3key.get_contents_to_filename(filepath)
 def s3get(self, key):
     s3key = self.s3bucket.get_key(key)
     if s3key is None:
         return
     filepath = self.localpath(key)
     makedirs(os.path.dirname(filepath), exist_ok=True)
     _logger.debug("Getting %s from S3" % (key, ))
     s3key.get_contents_to_filename(filepath)
 def put(self, key, content):
     self.s3put(key, content)
     filepath = self.localpath(key)
     makedirs(os.path.dirname(filepath), exist_ok=True)
     with open(filepath, 'wb+') as f:
         f.write(content)
 def put(self, key, content):
     self.s3put(key, content)
     filepath = self.localpath(key)
     makedirs(os.path.dirname(filepath), exist_ok=True)
     with open(filepath, 'wb+') as f:
         f.write(content)