MozillaSecurity / funfuzz

A collection of fuzzers in a harness for testing the SpiderMonkey JavaScript engine.
Mozilla Public License 2.0
631 stars 115 forks source link

TypeError: '>=' not supported between instances of 'NoneType' and 'int' #235

Open kkuehl opened 4 years ago

kkuehl commented 4 years ago
Traceback (most recent call last):
funfuzz_firefox    |   File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
funfuzz_firefox    |     return _run_code(code, main_globals, None,
funfuzz_firefox    |   File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
funfuzz_firefox    |     exec(code, run_globals)
funfuzz_firefox    |   File "/home/fuzzer/.local/lib/python3.8/site-packages/funfuzz/js/loop.py", line 411, in <module>
funfuzz_firefox    |     many_timed_runs(None, os_ops.make_wtmp_dir(Path(os.getcwd())),
funfuzz_firefox    |   File "/home/fuzzer/.local/lib/python3.8/site-packages/funfuzz/js/loop.py", line 190, in many_timed_runs
funfuzz_firefox    |     res, out_log = run_to_report(options, js_interesting_opts, env, log_prefix,
funfuzz_firefox    |   File "/home/fuzzer/.local/lib/python3.8/site-packages/funfuzz/js/loop.py", line 276, in run_to_report
funfuzz_firefox    |     (lith_result, _lith_details, autobisect_log) = lithium_helpers.pinpoint(
funfuzz_firefox    |   File "/home/fuzzer/.local/lib/python3.8/site-packages/funfuzz/util/lithium_helpers.py", line 52, in pinpoint
funfuzz_firefox    |     if (bisectRepo != "none" and targetTime >= 3 * 60 * 60 and
funfuzz_firefox    | TypeError: '>=' not supported between instances of 'NoneType' and 'int'

Proposed fix:

-- a/src/funfuzz/util/lithium_helpers.py
+++ b/src/funfuzz/util/lithium_helpers.py
@@ -49,7 +49,7 @@ def pinpoint(itest, logPrefix, jsEngine, engineFlags, infilename,  # pylint: dis
     print(" ".join(quote(str(x)) for x in [sys.executable, "-u", "-m", "lithium", "--strategy=check-only"] + lithArgs))
     print()

-    if (bisectRepo != "none" and targetTime >= 3 * 60 * 60 and
+    if (bisectRepo != "none" and targetTime is not None and targetTime >= 3 * 60 * 60 and
             build_options_str is not None and testJsShellOrXpcshell(jsEngine) != "xpcshell"):
         autobisectCmd = (  # pylint: disable=invalid-name
             [sys.executable, "-u", "-m", "funfuzz.autobisectjs"] +
(END)