We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Make issues: debug is broken, run is impossible to control-C out of
make debug- is broken. `make debug-libfuzzer-zlib_zlib_uncompress_fuzzer` fails with this error:
```
docker run \                                                                                                                                                                                                       
--cpus=1 \                                                                                                                                                                                                         
--cap-add SYS_NICE \                                                                                                                                                                                               
--cap-add SYS_PTRACE \                                                                                                                                                                                             
-e FUZZ_OUTSIDE_EXPERIMENT=1 \                                                                                                                                                                                     
-e FORCE_LOCAL=1 \                                                                                                                                                                                                 
-e TRIAL_ID=1 \                                                                                                                                                                                                    
-e FUZZER=libfuzzer \                                                                                                                                                                                              
-e BENCHMARK=zlib_zlib_uncompress_fuzzer \                                                                                                                                                                         
-e FUZZ_TARGET=zlib_uncompress_fuzzer \                                                                                                                                                                            
-entrypoint "/bin/bash" \                                                                                                                                                                                          
-it gcr.io/fuzzbench/runners/libfuzzer/zlib_zlib_uncompress_fuzzer                                                                                                                                                 
docker: invalid reference format.                                                                                                                                                                                  
See 'docker run --help'.                                                                                                                                                                                           
make: *** [docker/generated.mk:26568: debug-libfuzzer-zlib_zlib_uncompress_fuzzer] Error 125
```

make `run-libfuzzer-zlib_zlib_uncompress_fuzzer` runs forever and cannot be Ctrl-Ced out of. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `docker/generate_makefile.py`
Content:
```
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 """Simple generator for local Makefile rules."""
15 
16 import os
17 
18 from common import yaml_utils
19 from common import benchmark_utils
20 from common import fuzzer_utils
21 from experiment.build import docker_images
22 
23 BASE_TAG = "gcr.io/fuzzbench"
24 BENCHMARK_DIR = benchmark_utils.BENCHMARKS_DIR
25 
26 
27 def _print_benchmark_fuzz_target(benchmarks):
28     """Prints benchmark variables from benchmark.yaml files."""
29     for benchmark in benchmarks:
30         benchmark_vars = yaml_utils.read(
31             os.path.join(BENCHMARK_DIR, benchmark, 'benchmark.yaml'))
32         print(benchmark + '-fuzz-target=' + benchmark_vars['fuzz_target'])
33         print()
34 
35 
36 def _print_makefile_run_template(image):
37     fuzzer, benchmark = image['tag'].split('/')[1:]
38 
39     for run_type in ('run', 'debug', 'test-run'):
40         print(('{run_type}-{fuzzer}-{benchmark}: ' +
41                '.{fuzzer}-{benchmark}-runner').format(run_type=run_type,
42                                                       benchmark=benchmark,
43                                                       fuzzer=fuzzer))
44 
45         print('\
46 \tdocker run \\\n\
47 \t--cpus=1 \\\n\
48 \t--cap-add SYS_NICE \\\n\
49 \t--cap-add SYS_PTRACE \\\n\
50 \t-e FUZZ_OUTSIDE_EXPERIMENT=1 \\\n\
51 \t-e FORCE_LOCAL=1 \\\n\
52 \t-e TRIAL_ID=1 \\\n\
53 \t-e FUZZER={fuzzer} \\\n\
54 \t-e BENCHMARK={benchmark} \\\n\
55 \t-e FUZZ_TARGET=$({benchmark}-fuzz-target) \\\
56 '.format(fuzzer=fuzzer, benchmark=benchmark))
57 
58         if run_type == 'test-run':
59             print('\t-e MAX_TOTAL_TIME=20 \\\n\t-e SNAPSHOT_PERIOD=10 \\')
60         if run_type == 'debug':
61             print('\t--entrypoint "/bin/bash" \\\n\t-it ', end='')
62         else:
63             print('\t', end='')
64 
65         print(os.path.join(BASE_TAG, image['tag']))
66         print()
67 
68 
69 # TODO(tanq16): Add unit test.
70 def _print_rules_for_image(name, image):
71     """Print makefile section for given image to stdout."""
72     if not ('base' in name or 'dispatcher' in name):
73         print('.', end='')
74     print(name + ':', end='')
75     if 'depends_on' in image:
76         for dep in image['depends_on']:
77             if 'base' in dep:
78                 print(' ' + dep, end='')
79             else:
80                 print(' .' + dep, end='')
81     print()
82     print('\tdocker build \\')
83     print('\t--tag ' + os.path.join(BASE_TAG, image['tag']) + ' \\')
84     print('\t--build-arg BUILDKIT_INLINE_CACHE=1 \\')
85     print('\t--cache-from ' + os.path.join(BASE_TAG, image['tag']) + ' \\')
86     if 'build_arg' in image:
87         for arg in image['build_arg']:
88             print('\t--build-arg ' + arg + ' \\')
89     if 'dockerfile' in image:
90         print('\t--file ' + image['dockerfile'] + ' \\')
91     print('\t' + image['context'])
92     print()
93 
94     # Print run, debug, test-run rules if image is a runner.
95     if 'runner' in name and not ('intermediate' in name or 'base' in name):
96         _print_makefile_run_template(image)
97 
98 
99 def main():
100     """Generates Makefile with docker image build rules."""
101     fuzzers = fuzzer_utils.get_fuzzer_names()
102     benchmarks = benchmark_utils.get_all_benchmarks()
103     buildable_images = docker_images.get_images_to_build(fuzzers, benchmarks)
104 
105     print('export DOCKER_BUILDKIT := 1')
106 
107     # Print oss-fuzz benchmarks property variables.
108     _print_benchmark_fuzz_target(benchmarks)
109 
110     for name, image in buildable_images.items():
111         _print_rules_for_image(name, image)
112 
113     # Print build targets for all fuzzer-benchmark pairs (including coverage).
114     fuzzers.append('coverage')
115     for fuzzer in fuzzers:
116         image_type = "runner"
117         if 'coverage' in fuzzer:
118             image_type = "builder"
119         for benchmark in benchmarks:
120             print(('build-{fuzzer}-{benchmark}: ' +
121                    '.{fuzzer}-{benchmark}-{image_type}\n').format(
122                        fuzzer=fuzzer,
123                        benchmark=benchmark,
124                        image_type=image_type))
125         print()
126 
127     # Print fuzzer-all benchmarks build targets.
128     for fuzzer in fuzzers:
129         all_build_targets = ' '.join([
130             'build-{0}-{1}'.format(fuzzer, benchmark)
131             for benchmark in benchmarks
132         ])
133         print('build-{fuzzer}-all: {all_targets}'.format(
134             fuzzer=fuzzer, all_targets=all_build_targets))
135 
136     # Print all targets build target.
137     all_build_targets = ' '.join(
138         ['build-{0}-all'.format(name) for name in fuzzers])
139     print('build-all: {all_targets}'.format(all_targets=all_build_targets))
140 
141 
142 if __name__ == '__main__':
143     main()
144
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/docker/generate_makefile.py b/docker/generate_makefile.py
--- a/docker/generate_makefile.py
+++ b/docker/generate_makefile.py
@@ -59,6 +59,8 @@
             print('\t-e MAX_TOTAL_TIME=20 \\\n\t-e SNAPSHOT_PERIOD=10 \\')
         if run_type == 'debug':
             print('\t--entrypoint "/bin/bash" \\\n\t-it ', end='')
+        elif run_type == 'run':
+            print('\t-it ', end='')
         else:
             print('\t', end='')

{"golden_diff": "diff --git a/docker/generate_makefile.py b/docker/generate_makefile.py\n--- a/docker/generate_makefile.py\n+++ b/docker/generate_makefile.py\n@@ -59,6 +59,8 @@\n             print('\\t-e MAX_TOTAL_TIME=20 \\\\\\n\\t-e SNAPSHOT_PERIOD=10 \\\\')\n         if run_type == 'debug':\n             print('\\t--entrypoint \"/bin/bash\" \\\\\\n\\t-it ', end='')\n+        elif run_type == 'run':\n+            print('\\t-it ', end='')\n         else:\n             print('\\t', end='')\n", "issue": "Make issues: debug is broken, run is impossible to control-C out of\nmake debug- is broken. `make debug-libfuzzer-zlib_zlib_uncompress_fuzzer` fails with this error:\r\n```\r\ndocker run \\                                                                                                                                                                                                       \r\n--cpus=1 \\                                                                                                                                                                                                         \r\n--cap-add SYS_NICE \\                                                                                                                                                                                               \r\n--cap-add SYS_PTRACE \\                                                                                                                                                                                             \r\n-e FUZZ_OUTSIDE_EXPERIMENT=1 \\                                                                                                                                                                                     \r\n-e FORCE_LOCAL=1 \\                                                                                                                                                                                                 \r\n-e TRIAL_ID=1 \\                                                                                                                                                                                                    \r\n-e FUZZER=libfuzzer \\                                                                                                                                                                                              \r\n-e BENCHMARK=zlib_zlib_uncompress_fuzzer \\                                                                                                                                                                         \r\n-e FUZZ_TARGET=zlib_uncompress_fuzzer \\                                                                                                                                                                            \r\n-entrypoint \"/bin/bash\" \\                                                                                                                                                                                          \r\n-it gcr.io/fuzzbench/runners/libfuzzer/zlib_zlib_uncompress_fuzzer                                                                                                                                                 \r\ndocker: invalid reference format.                                                                                                                                                                                  \r\nSee 'docker run --help'.                                                                                                                                                                                           \r\nmake: *** [docker/generated.mk:26568: debug-libfuzzer-zlib_zlib_uncompress_fuzzer] Error 125\r\n```\r\n\r\nmake `run-libfuzzer-zlib_zlib_uncompress_fuzzer` runs forever and cannot be Ctrl-Ced out of. \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\"\"\"Simple generator for local Makefile rules.\"\"\"\n\nimport os\n\nfrom common import yaml_utils\nfrom common import benchmark_utils\nfrom common import fuzzer_utils\nfrom experiment.build import docker_images\n\nBASE_TAG = \"gcr.io/fuzzbench\"\nBENCHMARK_DIR = benchmark_utils.BENCHMARKS_DIR\n\n\ndef _print_benchmark_fuzz_target(benchmarks):\n    \"\"\"Prints benchmark variables from benchmark.yaml files.\"\"\"\n    for benchmark in benchmarks:\n        benchmark_vars = yaml_utils.read(\n            os.path.join(BENCHMARK_DIR, benchmark, 'benchmark.yaml'))\n        print(benchmark + '-fuzz-target=' + benchmark_vars['fuzz_target'])\n        print()\n\n\ndef _print_makefile_run_template(image):\n    fuzzer, benchmark = image['tag'].split('/')[1:]\n\n    for run_type in ('run', 'debug', 'test-run'):\n        print(('{run_type}-{fuzzer}-{benchmark}: ' +\n               '.{fuzzer}-{benchmark}-runner').format(run_type=run_type,\n                                                      benchmark=benchmark,\n                                                      fuzzer=fuzzer))\n\n        print('\\\n\\tdocker run \\\\\\n\\\n\\t--cpus=1 \\\\\\n\\\n\\t--cap-add SYS_NICE \\\\\\n\\\n\\t--cap-add SYS_PTRACE \\\\\\n\\\n\\t-e FUZZ_OUTSIDE_EXPERIMENT=1 \\\\\\n\\\n\\t-e FORCE_LOCAL=1 \\\\\\n\\\n\\t-e TRIAL_ID=1 \\\\\\n\\\n\\t-e FUZZER={fuzzer} \\\\\\n\\\n\\t-e BENCHMARK={benchmark} \\\\\\n\\\n\\t-e FUZZ_TARGET=$({benchmark}-fuzz-target) \\\\\\\n'.format(fuzzer=fuzzer, benchmark=benchmark))\n\n        if run_type == 'test-run':\n            print('\\t-e MAX_TOTAL_TIME=20 \\\\\\n\\t-e SNAPSHOT_PERIOD=10 \\\\')\n        if run_type == 'debug':\n            print('\\t--entrypoint \"/bin/bash\" \\\\\\n\\t-it ', end='')\n        else:\n            print('\\t', end='')\n\n        print(os.path.join(BASE_TAG, image['tag']))\n        print()\n\n\n# TODO(tanq16): Add unit test.\ndef _print_rules_for_image(name, image):\n    \"\"\"Print makefile section for given image to stdout.\"\"\"\n    if not ('base' in name or 'dispatcher' in name):\n        print('.', end='')\n    print(name + ':', end='')\n    if 'depends_on' in image:\n        for dep in image['depends_on']:\n            if 'base' in dep:\n                print(' ' + dep, end='')\n            else:\n                print(' .' + dep, end='')\n    print()\n    print('\\tdocker build \\\\')\n    print('\\t--tag ' + os.path.join(BASE_TAG, image['tag']) + ' \\\\')\n    print('\\t--build-arg BUILDKIT_INLINE_CACHE=1 \\\\')\n    print('\\t--cache-from ' + os.path.join(BASE_TAG, image['tag']) + ' \\\\')\n    if 'build_arg' in image:\n        for arg in image['build_arg']:\n            print('\\t--build-arg ' + arg + ' \\\\')\n    if 'dockerfile' in image:\n        print('\\t--file ' + image['dockerfile'] + ' \\\\')\n    print('\\t' + image['context'])\n    print()\n\n    # Print run, debug, test-run rules if image is a runner.\n    if 'runner' in name and not ('intermediate' in name or 'base' in name):\n        _print_makefile_run_template(image)\n\n\ndef main():\n    \"\"\"Generates Makefile with docker image build rules.\"\"\"\n    fuzzers = fuzzer_utils.get_fuzzer_names()\n    benchmarks = benchmark_utils.get_all_benchmarks()\n    buildable_images = docker_images.get_images_to_build(fuzzers, benchmarks)\n\n    print('export DOCKER_BUILDKIT := 1')\n\n    # Print oss-fuzz benchmarks property variables.\n    _print_benchmark_fuzz_target(benchmarks)\n\n    for name, image in buildable_images.items():\n        _print_rules_for_image(name, image)\n\n    # Print build targets for all fuzzer-benchmark pairs (including coverage).\n    fuzzers.append('coverage')\n    for fuzzer in fuzzers:\n        image_type = \"runner\"\n        if 'coverage' in fuzzer:\n            image_type = \"builder\"\n        for benchmark in benchmarks:\n            print(('build-{fuzzer}-{benchmark}: ' +\n                   '.{fuzzer}-{benchmark}-{image_type}\\n').format(\n                       fuzzer=fuzzer,\n                       benchmark=benchmark,\n                       image_type=image_type))\n        print()\n\n    # Print fuzzer-all benchmarks build targets.\n    for fuzzer in fuzzers:\n        all_build_targets = ' '.join([\n            'build-{0}-{1}'.format(fuzzer, benchmark)\n            for benchmark in benchmarks\n        ])\n        print('build-{fuzzer}-all: {all_targets}'.format(\n            fuzzer=fuzzer, all_targets=all_build_targets))\n\n    # Print all targets build target.\n    all_build_targets = ' '.join(\n        ['build-{0}-all'.format(name) for name in fuzzers])\n    print('build-all: {all_targets}'.format(all_targets=all_build_targets))\n\n\nif __name__ == '__main__':\n    main()\n", "path": "docker/generate_makefile.py"}], "after_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\"\"\"Simple generator for local Makefile rules.\"\"\"\n\nimport os\n\nfrom common import yaml_utils\nfrom common import benchmark_utils\nfrom common import fuzzer_utils\nfrom experiment.build import docker_images\n\nBASE_TAG = \"gcr.io/fuzzbench\"\nBENCHMARK_DIR = benchmark_utils.BENCHMARKS_DIR\n\n\ndef _print_benchmark_fuzz_target(benchmarks):\n    \"\"\"Prints benchmark variables from benchmark.yaml files.\"\"\"\n    for benchmark in benchmarks:\n        benchmark_vars = yaml_utils.read(\n            os.path.join(BENCHMARK_DIR, benchmark, 'benchmark.yaml'))\n        print(benchmark + '-fuzz-target=' + benchmark_vars['fuzz_target'])\n        print()\n\n\ndef _print_makefile_run_template(image):\n    fuzzer, benchmark = image['tag'].split('/')[1:]\n\n    for run_type in ('run', 'debug', 'test-run'):\n        print(('{run_type}-{fuzzer}-{benchmark}: ' +\n               '.{fuzzer}-{benchmark}-runner').format(run_type=run_type,\n                                                      benchmark=benchmark,\n                                                      fuzzer=fuzzer))\n\n        print('\\\n\\tdocker run \\\\\\n\\\n\\t--cpus=1 \\\\\\n\\\n\\t--cap-add SYS_NICE \\\\\\n\\\n\\t--cap-add SYS_PTRACE \\\\\\n\\\n\\t-e FUZZ_OUTSIDE_EXPERIMENT=1 \\\\\\n\\\n\\t-e FORCE_LOCAL=1 \\\\\\n\\\n\\t-e TRIAL_ID=1 \\\\\\n\\\n\\t-e FUZZER={fuzzer} \\\\\\n\\\n\\t-e BENCHMARK={benchmark} \\\\\\n\\\n\\t-e FUZZ_TARGET=$({benchmark}-fuzz-target) \\\\\\\n'.format(fuzzer=fuzzer, benchmark=benchmark))\n\n        if run_type == 'test-run':\n            print('\\t-e MAX_TOTAL_TIME=20 \\\\\\n\\t-e SNAPSHOT_PERIOD=10 \\\\')\n        if run_type == 'debug':\n            print('\\t--entrypoint \"/bin/bash\" \\\\\\n\\t-it ', end='')\n        elif run_type == 'run':\n            print('\\t-it ', end='')\n        else:\n            print('\\t', end='')\n\n        print(os.path.join(BASE_TAG, image['tag']))\n        print()\n\n\n# TODO(tanq16): Add unit test.\ndef _print_rules_for_image(name, image):\n    \"\"\"Print makefile section for given image to stdout.\"\"\"\n    if not ('base' in name or 'dispatcher' in name):\n        print('.', end='')\n    print(name + ':', end='')\n    if 'depends_on' in image:\n        for dep in image['depends_on']:\n            if 'base' in dep:\n                print(' ' + dep, end='')\n            else:\n                print(' .' + dep, end='')\n    print()\n    print('\\tdocker build \\\\')\n    print('\\t--tag ' + os.path.join(BASE_TAG, image['tag']) + ' \\\\')\n    print('\\t--build-arg BUILDKIT_INLINE_CACHE=1 \\\\')\n    print('\\t--cache-from ' + os.path.join(BASE_TAG, image['tag']) + ' \\\\')\n    if 'build_arg' in image:\n        for arg in image['build_arg']:\n            print('\\t--build-arg ' + arg + ' \\\\')\n    if 'dockerfile' in image:\n        print('\\t--file ' + image['dockerfile'] + ' \\\\')\n    print('\\t' + image['context'])\n    print()\n\n    # Print run, debug, test-run rules if image is a runner.\n    if 'runner' in name and not ('intermediate' in name or 'base' in name):\n        _print_makefile_run_template(image)\n\n\ndef main():\n    \"\"\"Generates Makefile with docker image build rules.\"\"\"\n    fuzzers = fuzzer_utils.get_fuzzer_names()\n    benchmarks = benchmark_utils.get_all_benchmarks()\n    buildable_images = docker_images.get_images_to_build(fuzzers, benchmarks)\n\n    print('export DOCKER_BUILDKIT := 1')\n\n    # Print oss-fuzz benchmarks property variables.\n    _print_benchmark_fuzz_target(benchmarks)\n\n    for name, image in buildable_images.items():\n        _print_rules_for_image(name, image)\n\n    # Print build targets for all fuzzer-benchmark pairs (including coverage).\n    fuzzers.append('coverage')\n    for fuzzer in fuzzers:\n        image_type = \"runner\"\n        if 'coverage' in fuzzer:\n            image_type = \"builder\"\n        for benchmark in benchmarks:\n            print(('build-{fuzzer}-{benchmark}: ' +\n                   '.{fuzzer}-{benchmark}-{image_type}\\n').format(\n                       fuzzer=fuzzer,\n                       benchmark=benchmark,\n                       image_type=image_type))\n        print()\n\n    # Print fuzzer-all benchmarks build targets.\n    for fuzzer in fuzzers:\n        all_build_targets = ' '.join([\n            'build-{0}-{1}'.format(fuzzer, benchmark)\n            for benchmark in benchmarks\n        ])\n        print('build-{fuzzer}-all: {all_targets}'.format(\n            fuzzer=fuzzer, all_targets=all_build_targets))\n\n    # Print all targets build target.\n    all_build_targets = ' '.join(\n        ['build-{0}-all'.format(name) for name in fuzzers])\n    print('build-all: {all_targets}'.format(all_targets=all_build_targets))\n\n\nif __name__ == '__main__':\n    main()\n", "path": "docker/generate_makefile.py"}]}