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

[funfuzz] js_interesting throws when `-i` mode of autobisectjs is used #168

Closed nth10sd closed 6 years ago

nth10sd commented 6 years ago

Using the -i mode of autobisectjs throws the following exception:

  File "/home/winworklin/.local/lib/python2.7/site-packages/funfuzz/autobisectjs/autobisectjs.py", line 493, in main
    findBlamedCset(options, repoDir, compile_shell.makeTestRev(options))
  File "/home/winworklin/.local/lib/python2.7/site-packages/funfuzz/autobisectjs/autobisectjs.py", line 219, in findBlamedCset
    label = testRev(currRev)
  File "/home/winworklin/.local/lib/python2.7/site-packages/funfuzz/js/compile_shell.py", line 627, in testRev
    return options.testAndLabel(shell.getShellCacheFullPath(), rev)
  File "/home/winworklin/.local/lib/python2.7/site-packages/funfuzz/autobisectjs/autobisectjs.py", line 319, in inner
    if conditionScript.interesting(conditionArgs, tempPrefix):
  File "/home/winworklin/.local/lib/python2.7/site-packages/funfuzz/js/compare_jit.py", line 270, in interesting
    gOptions.jsengine, gOptions.flags, gOptions.infilename, tempPrefix, gOptions, False, False)[0]
  File "/home/winworklin/.local/lib/python2.7/site-packages/funfuzz/js/compare_jit.py", line 104, in compareLevel
    r = js_interesting.ShellResult(options, command, prefix, True)  # pylint: disable=invalid-name
  File "/home/winworklin/.local/lib/python2.7/site-packages/funfuzz/js/js_interesting.py", line 84, in __init__
    with open(logPrefix + "-out.txt") as f:
IOError: [Errno 2] No such file or directory: u'/tmp/abExtTestAndLabel-7b40283bf1c7qjAnVw/t-r0-out.txt'

This apparently causes other issues as well, I think, but let's fix this first. Version 0.3.0 seems to work fine.

nth10sd commented 6 years ago

I spent more than a week trying to get to the bottom of this. Apparently in timed_run, there is a check for logPrefix to be a str before deciding to create log files, but if logPrefix is a bytes type, it fails the check, even though both refer to the same directory.

The temporary fix is to force prefix to be a str when calling timed_run.