# Path: src/funfuzz/util/create_collector.py
# def make_collector():
# def printCrashInfo(crashInfo):  # pylint: disable=invalid-name,missing-docstring
# def printMatchingSignature(match):  # pylint: disable=invalid-name,missing-docstring
# def submit_collector(collector, crash_info, testcase, quality, meta_data=None):
# 
# Path: src/funfuzz/util/os_ops.py
# NO_DUMP_MSG = r"""
# WARNING: Minidumps are not being generated, so all crashes will be uninteresting.
# WARNING: Make sure the following key value exists in this key:
# WARNING: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps
# WARNING: Name: DumpType  Type: REG_DWORD
# WARNING: http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181%28v=vs.85%29.aspx
# """
# def make_cdb_cmd(prog_full_path, crashed_pid):
# def make_gdb_cmd(prog_full_path, crashed_pid):
# def disable_corefile():
# def get_core_limit():
# def make_dbg_cmd(prog_full_path, crashed_pid):
# def grab_crash_log(prog_full_path, crashed_pid, log_prefix, want_stack):
# def grab_mac_crash_log(crash_pid, log_prefix, use_log_files):
# def is_win_dumping_to_default():  # pylint: disable=too-complex
# def make_wtmp_dir(base_dir):


from copy import deepcopy
from optparse import OptionParser  # pylint: disable=deprecated-module
from pathlib import Path
from shlex import quote
from FTB.ProgramConfiguration import ProgramConfiguration
from . import inspect_shell
from ..util import create_collector
from ..util import file_manipulation
from ..util import os_ops
import io
import os
import platform
import shutil
import subprocess
import sys
import zipfile
import FTB.Signatures.CrashInfo as Crash_Info
import lithium.interestingness.timed_run as timedrun
        import resource
            err = [line.rstrip() for line in f]

        for line in reversed(err):
            if "[unhandlable oom]" in line:
                print("Ignoring unhandlable oom...")
                is_oom = True
                break

        if is_oom:
            lev = JS_FINE
            crash_log = (logPrefix.parent / f"{logPrefix.stem}-crash").with_suffix(".txt")
            core_file = logPrefix.parent / f"{logPrefix.stem}-core"
            if crash_log.is_file():
                crash_log.unlink()
            if core_file.is_file():
                core_file.unlink()

            dbggr_cmd = os_ops.make_dbg_cmd(runthis[0], runinfo.pid)
            if dbggr_cmd:
                core_file = Path(dbggr_cmd[-1])
                if core_file.is_file():
                    core_file.unlink()
        elif options.valgrind and runinfo.return_code == VALGRIND_ERROR_EXIT_CODE:
            issues.append("valgrind reported an error")
            lev = max(lev, JS_VG_AMISS)
            valgrindErrorPrefix = f"=={runinfo.pid}=="
            for line in err:
                if valgrindErrorPrefix and line.startswith(valgrindErrorPrefix):
                    issues.append(line.rstrip())
        elif runinfo.sta == timedrun.CRASHED:

# Path: src/funfuzz/util/create_collector.py
# def make_collector():
# def printCrashInfo(crashInfo):  # pylint: disable=invalid-name,missing-docstring
# def printMatchingSignature(match):  # pylint: disable=invalid-name,missing-docstring
# def submit_collector(collector, crash_info, testcase, quality, meta_data=None):
# 
# Path: src/funfuzz/util/os_ops.py
# NO_DUMP_MSG = r"""
# WARNING: Minidumps are not being generated, so all crashes will be uninteresting.
# WARNING: Make sure the following key value exists in this key:
# WARNING: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps
# WARNING: Name: DumpType  Type: REG_DWORD
# WARNING: http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181%28v=vs.85%29.aspx
# """
# def make_cdb_cmd(prog_full_path, crashed_pid):
# def make_gdb_cmd(prog_full_path, crashed_pid):
# def disable_corefile():
# def get_core_limit():
# def make_dbg_cmd(prog_full_path, crashed_pid):
# def grab_crash_log(prog_full_path, crashed_pid, log_prefix, want_stack):
# def grab_mac_crash_log(crash_pid, log_prefix, use_log_files):
# def is_win_dumping_to_default():  # pylint: disable=too-complex
# def make_wtmp_dir(base_dir):


# Path: src/funfuzz/js/js_interesting.py
from copy import deepcopy
from optparse import OptionParser  # pylint: disable=deprecated-module
from pathlib import Path
from shlex import quote
from FTB.ProgramConfiguration import ProgramConfiguration
from . import inspect_shell
from ..util import create_collector
from ..util import file_manipulation
from ..util import os_ops
import io
import os
import platform
import shutil
import subprocess
import sys
import zipfile
import FTB.Signatures.CrashInfo as Crash_Info
import lithium.interestingness.timed_run as timedrun
        import resource

            err = [line.rstrip() for line in f]

        for line in reversed(err):
            if "[unhandlable oom]" in line:
                print("Ignoring unhandlable oom...")
                is_oom = True
                break

        if is_oom:
            lev = JS_FINE
            crash_log = (logPrefix.parent / f"{logPrefix.stem}-crash").with_suffix(".txt")
            core_file = logPrefix.parent / f"{logPrefix.stem}-core"
            if crash_log.is_file():
                crash_log.unlink()
            if core_file.is_file():
                core_file.unlink()

            dbggr_cmd = os_ops.make_dbg_cmd(runthis[0], runinfo.pid)
            if dbggr_cmd:
                core_file = Path(dbggr_cmd[-1])
                if core_file.is_file():
                    core_file.unlink()
        elif options.valgrind and runinfo.return_code == VALGRIND_ERROR_EXIT_CODE:
            issues.append("valgrind reported an error")
            lev = max(lev, JS_VG_AMISS)
            valgrindErrorPrefix = f"=={runinfo.pid}=="
            for line in err:
                if valgrindErrorPrefix and line.startswith(valgrindErrorPrefix):
                    issues.append(line.rstrip())
        elif runinfo.sta == timedrun.CRASHED:

            if os_ops.grab_crash_log(runthis[0], runinfo.pid, logPrefix, True):