Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[funfuzz] TypeError thrown when file_contains_str is run after move to Python 3.6+ #220

Closed
nth10sd opened this issue Jan 18, 2019 · 0 comments
Assignees
Labels

Comments

@nth10sd
Copy link
Contributor

nth10sd commented Jan 18, 2019

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/fuzz8/trees/venv-py37-fm/lib/python3.7/site-packages/funfuzz/util/fork_join.py", line 67, in redirectOutputAndCallFun
    fun(*(someArgs + (i,)))
  File "/Users/fuzz8/trees/venv-py37-fm/lib/python3.7/site-packages/funfuzz/bot.py", line 216, in loopFuzzingAndReduction
    loop.many_timed_runs(options.targetTime, tempDir, buildInfo.mtrArgs, collector, False)
  File "/Users/fuzz8/trees/venv-py37-fm/lib/python3.7/site-packages/funfuzz/js/loop.py", line 206, in many_timed_runs
    options.build_options_str, target_time, js_interesting_opts, ccoverage)
  File "/Users/fuzz8/trees/venv-py37-fm/lib/python3.7/site-packages/funfuzz/js/compare_jit.py", line 76, in compare_jit
    itest, logPrefix, jsEngine, [], infilename, repo, build_options_str, targetTime, lev)
  File "/Users/fuzz8/trees/venv-py37-fm/lib/python3.7/site-packages/funfuzz/util/lithium_helpers.py", line 45, in pinpoint
    logPrefix, infilename, lithArgs, targetTime, suspiciousLevel)
  File "/Users/fuzz8/trees/venv-py37-fm/lib/python3.7/site-packages/funfuzz/util/lithium_helpers.py", line 225, in reduction_strat
    file_contains_str(str(infilename), "isAsmJSCompilationAvailable"))
  File "/Users/fuzz8/trees/venv-py37-fm/lib/python3.7/site-packages/lithium/interestingness/utils.py", line 60, in file_contains_str
    if line.find(regex) != -1:
TypeError: argument should be integer or bytes-like object, not 'str'

Turns out that since file_contains_str opens the file in rb mode, we should pass in bytes instead of a string...

@nth10sd nth10sd added the bug label Jan 18, 2019
@nth10sd nth10sd self-assigned this Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant