prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Eclipser maxfilelen value
  I experienced the same problem that you had in choosing maxfilelen to evaluate Eclipser some time ago.
  I found that they used 1048576 in their experiments (https://github.com/SoftSec-KAIST/Eclipser-Artifact/blob/master/docker-scripts/experiment-scripts/package-exp/run_eclipser.sh#L25), so maybe you want to use this value to produce consistent results with the paper.
  
  </issue>
  <code>
  [start of fuzzers/eclipser/fuzzer.py]
  1 # Copyright 2020 Google LLC
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 # http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 """Integration code for Eclipser fuzzer."""
  15 
  16 import os
  17 import subprocess
  18 import time
  19 from multiprocessing import Process
  20 
  21 from fuzzers import utils
  22 
  23 
  24 def build():
  25     """Build fuzzer."""
  26     # QEMU does not work with sanitizers, so skip -fsanitize=. See
  27     # https://github.com/SoftSec-KAIST/Eclipser/issues/5
  28     utils.set_no_sanitizer_compilation_flags()
  29     cflags = [
  30         '-O2',
  31         '-fno-omit-frame-pointer',
  32     ]
  33     utils.append_flags('CFLAGS', cflags)
  34     utils.append_flags('CXXFLAGS', cflags)
  35 
  36     os.environ['CC'] = 'clang'
  37     os.environ['CXX'] = 'clang++'
  38     os.environ['FUZZER_LIB'] = '/libStandaloneFuzzTarget.a'
  39 
  40     utils.build_benchmark()
  41 
  42 
  43 def fuzz(input_corpus, output_corpus, target_binary):
  44     """Run fuzzer."""
  45     # Create an encoded temp corpus directory.
  46     encoded_temp_corpus = os.path.join(os.path.dirname(input_corpus),
  47                                        'temp-corpus')
  48     if not os.path.exists(encoded_temp_corpus):
  49         os.mkdir(encoded_temp_corpus)
  50 
  51     print('[run_fuzzer] Running target with Eclipser')
  52     command = [
  53         'dotnet',
  54         '/Eclipser/build/Eclipser.dll',
  55         'fuzz',
  56         '-p',
  57         target_binary,
  58         '-t',
  59         '1048576',  # FIXME: Find the max value allowed here.
  60         '-o',
  61         encoded_temp_corpus,
  62         '--src',
  63         'file',
  64         '--initarg',
  65         'foo',  # Specifies how command line argument is passed, just a file.
  66         '-f',
  67         'foo',
  68         '--maxfilelen',
  69         str(10 * 1024 * 1024),  # Increase since default is too low (8 bytes).
  70     ]
  71     if os.listdir(input_corpus):  # Important, otherwise Eclipser crashes.
  72         command += ['-i', input_corpus]
  73     subprocess.Popen(command)
  74 
  75     process = Process(target=copy_corpus_directory,
  76                       args=(
  77                           encoded_temp_corpus,
  78                           output_corpus,
  79                       ))
  80     process.start()
  81 
  82 
  83 def copy_corpus_directory(encoded_temp_corpus, output_corpus):
  84     """Copies corpus periodically from encoded corpus directory into output
  85   directory."""
  86     while True:
  87         # Wait for initial fuzzer initialization, and after every copy.
  88         time.sleep(120)
  89 
  90         subprocess.call([
  91             'dotnet',
  92             '/Eclipser/build/Eclipser.dll',
  93             'decode',
  94             '-i',
  95             os.path.join(encoded_temp_corpus, 'testcase'),
  96             '-o',
  97             output_corpus,
  98         ])
  99
  [end of fuzzers/eclipser/fuzzer.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/fuzzers/eclipser/fuzzer.py b/fuzzers/eclipser/fuzzer.py
  --- a/fuzzers/eclipser/fuzzer.py
  +++ b/fuzzers/eclipser/fuzzer.py
  @@ -66,7 +66,9 @@
           '-f',
           'foo',
           '--maxfilelen',
  -        str(10 * 1024 * 1024),  # Increase since default is too low (8 bytes).
  +        # Default is too low (8 bytes), match experiment config at:
  +        # https://github.com/SoftSec-KAIST/Eclipser-Artifact/blob/6aadf02eeadb0416bd4c5edeafc8627bc24ebc82/docker-scripts/experiment-scripts/package-exp/run_eclipser.sh#L25
  +        '1048576',
       ]
       if os.listdir(input_corpus):  # Important, otherwise Eclipser crashes.
           command += ['-i', input_corpus]
  
verification_info: {"golden_diff": "diff --git a/fuzzers/eclipser/fuzzer.py b/fuzzers/eclipser/fuzzer.py\n--- a/fuzzers/eclipser/fuzzer.py\n+++ b/fuzzers/eclipser/fuzzer.py\n@@ -66,7 +66,9 @@\n         '-f',\n         'foo',\n         '--maxfilelen',\n-        str(10 * 1024 * 1024),  # Increase since default is too low (8 bytes).\n+        # Default is too low (8 bytes), match experiment config at:\n+        # https://github.com/SoftSec-KAIST/Eclipser-Artifact/blob/6aadf02eeadb0416bd4c5edeafc8627bc24ebc82/docker-scripts/experiment-scripts/package-exp/run_eclipser.sh#L25\n+        '1048576',\n     ]\n     if os.listdir(input_corpus):  # Important, otherwise Eclipser crashes.\n         command += ['-i', input_corpus]\n", "issue": "Eclipser maxfilelen value\nI experienced the same problem that you had in choosing maxfilelen to evaluate Eclipser some time ago.\r\nI found that they used 1048576 in their experiments (https://github.com/SoftSec-KAIST/Eclipser-Artifact/blob/master/docker-scripts/experiment-scripts/package-exp/run_eclipser.sh#L25), so maybe you want to use this value to produce consistent results with the paper.\n", "before_files": [{"content": "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Integration code for Eclipser fuzzer.\"\"\"\n\nimport os\nimport subprocess\nimport time\nfrom multiprocessing import Process\n\nfrom fuzzers import utils\n\n\ndef build():\n    \"\"\"Build fuzzer.\"\"\"\n    # QEMU does not work with sanitizers, so skip -fsanitize=. See\n    # https://github.com/SoftSec-KAIST/Eclipser/issues/5\n    utils.set_no_sanitizer_compilation_flags()\n    cflags = [\n        '-O2',\n        '-fno-omit-frame-pointer',\n    ]\n    utils.append_flags('CFLAGS', cflags)\n    utils.append_flags('CXXFLAGS', cflags)\n\n    os.environ['CC'] = 'clang'\n    os.environ['CXX'] = 'clang++'\n    os.environ['FUZZER_LIB'] = '/libStandaloneFuzzTarget.a'\n\n    utils.build_benchmark()\n\n\ndef fuzz(input_corpus, output_corpus, target_binary):\n    \"\"\"Run fuzzer.\"\"\"\n    # Create an encoded temp corpus directory.\n    encoded_temp_corpus = os.path.join(os.path.dirname(input_corpus),\n                                       'temp-corpus')\n    if not os.path.exists(encoded_temp_corpus):\n        os.mkdir(encoded_temp_corpus)\n\n    print('[run_fuzzer] Running target with Eclipser')\n    command = [\n        'dotnet',\n        '/Eclipser/build/Eclipser.dll',\n        'fuzz',\n        '-p',\n        target_binary,\n        '-t',\n        '1048576',  # FIXME: Find the max value allowed here.\n        '-o',\n        encoded_temp_corpus,\n        '--src',\n        'file',\n        '--initarg',\n        'foo',  # Specifies how command line argument is passed, just a file.\n        '-f',\n        'foo',\n        '--maxfilelen',\n        str(10 * 1024 * 1024),  # Increase since default is too low (8 bytes).\n    ]\n    if os.listdir(input_corpus):  # Important, otherwise Eclipser crashes.\n        command += ['-i', input_corpus]\n    subprocess.Popen(command)\n\n    process = Process(target=copy_corpus_directory,\n                      args=(\n                          encoded_temp_corpus,\n                          output_corpus,\n                      ))\n    process.start()\n\n\ndef copy_corpus_directory(encoded_temp_corpus, output_corpus):\n    \"\"\"Copies corpus periodically from encoded corpus directory into output\n  directory.\"\"\"\n    while True:\n        # Wait for initial fuzzer initialization, and after every copy.\n        time.sleep(120)\n\n        subprocess.call([\n            'dotnet',\n            '/Eclipser/build/Eclipser.dll',\n            'decode',\n            '-i',\n            os.path.join(encoded_temp_corpus, 'testcase'),\n            '-o',\n            output_corpus,\n        ])\n", "path": "fuzzers/eclipser/fuzzer.py"}]}