prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  OOM error with master/slaves setup (zeromq, windows)
  Hi !
   
  ### Describe the bug
  An out of memory error occurs with ZeroMQ trying to allocate a crazy amount of memory in decoded_allocator, sometime up to several petabytes. This might very well be a ZeroMQ bug : 
  ` OUT OF MEMORY (bundled\zeromq\src\decoder_allocators.cpp:89)`
   
  I added some logs and recompiled pyzmq to check what's going on. Upon further investigation, _max_counters seems to take a crazy value at some point. See [zmq_logs.txt](https://github.com/locustio/locust/files/4618065/zmq_logs.txt)
  As you can see, allocator instance 0x0000016A9270F700 is constructed with _max_counters=249, but before crash its value has changed to 1557249601288, which causes a malloc of several terabytes.
   
   
  ### Steps to reproduce
  Sorry, I couldn't find a surefire way to reproduce this one. It seems kind of random. It sometime happens before the test is even started, sometime when the test is stopped. Sometime it doesn't happen at all. It does seem to happen more often when stopping a test in the web UI. Simply run the ps1 attached and do some stuff in the web UI.
   
  ### Environment
   
  - OS: Windows 10.0.18362.778
  - Python version: 3.6
  - Locust version: 0.14.6
  - Locust files : [test_locust.zip](https://github.com/locustio/locust/files/4618016/test_locust.zip)
   
  I managed to repro the bug on two computers : my work computer and my personal computer. Both are on Windows 10/Python 3.6 that comes with VS2017, but my personal computer has a pristine python environent, just ran pip install locustio.
  
  Am I doing something I'm not supposed to ?
  
  
  </issue>
  <code>
  [start of setup.py]
  1 # -*- coding: utf-8 -*-
  2 import ast
  3 import os
  4 import re
  5 import sys
  6 
  7 from setuptools import find_packages, setup
  8 
  9 ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
  10 
  11 # parse version from locust/__init__.py
  12 _version_re = re.compile(r"__version__\s+=\s+(.*)")
  13 _init_file = os.path.join(ROOT_PATH, "locust", "__init__.py")
  14 with open(_init_file, "rb") as f:
  15     version = str(ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1)))
  16 
  17 setup(
  18     name="locust",
  19     version=version,
  20     install_requires=[
  21         "gevent>=20.9.0",
  22         "flask>=2.0.0",
  23         "Werkzeug>=2.0.0",
  24         "requests>=2.9.1",
  25         "msgpack>=0.6.2",
  26         "pyzmq>=16.0.2",
  27         "geventhttpclient>=1.4.4",
  28         "ConfigArgParse>=1.0",
  29         "psutil>=5.6.7",
  30         "Flask-BasicAuth>=0.2.0",
  31         "Flask-Cors>=3.0.10",
  32         "roundrobin>=0.0.2",
  33     ],
  34     test_suite="locust.test",
  35     tests_require=[
  36         "cryptography",
  37         "mock",
  38         "pyquery",
  39     ],
  40     extras_require={
  41         ":sys_platform == 'win32'": ["pywin32"],
  42     },
  43 )
  44
  [end of setup.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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -23,7 +23,7 @@
           "Werkzeug>=2.0.0",
           "requests>=2.9.1",
           "msgpack>=0.6.2",
  -        "pyzmq>=16.0.2",
  +        "pyzmq>=22.2.1",
           "geventhttpclient>=1.4.4",
           "ConfigArgParse>=1.0",
           "psutil>=5.6.7",
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -23,7 +23,7 @@\n         \"Werkzeug>=2.0.0\",\n         \"requests>=2.9.1\",\n         \"msgpack>=0.6.2\",\n-        \"pyzmq>=16.0.2\",\n+        \"pyzmq>=22.2.1\",\n         \"geventhttpclient>=1.4.4\",\n         \"ConfigArgParse>=1.0\",\n         \"psutil>=5.6.7\",\n", "issue": "OOM error with master/slaves setup (zeromq, windows)\nHi !\r\n \r\n### Describe the bug\r\nAn out of memory error occurs with ZeroMQ trying to allocate a crazy amount of memory in decoded_allocator, sometime up to several petabytes. This might very well be a ZeroMQ bug : \r\n` OUT OF MEMORY (bundled\\zeromq\\src\\decoder_allocators.cpp:89)`\r\n \r\nI added some logs and recompiled pyzmq to check what's going on. Upon further investigation, _max_counters seems to take a crazy value at some point. See [zmq_logs.txt](https://github.com/locustio/locust/files/4618065/zmq_logs.txt)\r\nAs you can see, allocator instance 0x0000016A9270F700 is constructed with _max_counters=249, but before crash its value has changed to 1557249601288, which causes a malloc of several terabytes.\r\n \r\n \r\n### Steps to reproduce\r\nSorry, I couldn't find a surefire way to reproduce this one. It seems kind of random. It sometime happens before the test is even started, sometime when the test is stopped. Sometime it doesn't happen at all. It does seem to happen more often when stopping a test in the web UI. Simply run the ps1 attached and do some stuff in the web UI.\r\n \r\n### Environment\r\n \r\n- OS: Windows 10.0.18362.778\r\n- Python version: 3.6\r\n- Locust version: 0.14.6\r\n- Locust files : [test_locust.zip](https://github.com/locustio/locust/files/4618016/test_locust.zip)\r\n \r\nI managed to repro the bug on two computers : my work computer and my personal computer. Both are on Windows 10/Python 3.6 that comes with VS2017, but my personal computer has a pristine python environent, just ran pip install locustio.\r\n\r\nAm I doing something I'm not supposed to ?\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport ast\nimport os\nimport re\nimport sys\n\nfrom setuptools import find_packages, setup\n\nROOT_PATH = os.path.abspath(os.path.dirname(__file__))\n\n# parse version from locust/__init__.py\n_version_re = re.compile(r\"__version__\\s+=\\s+(.*)\")\n_init_file = os.path.join(ROOT_PATH, \"locust\", \"__init__.py\")\nwith open(_init_file, \"rb\") as f:\n    version = str(ast.literal_eval(_version_re.search(f.read().decode(\"utf-8\")).group(1)))\n\nsetup(\n    name=\"locust\",\n    version=version,\n    install_requires=[\n        \"gevent>=20.9.0\",\n        \"flask>=2.0.0\",\n        \"Werkzeug>=2.0.0\",\n        \"requests>=2.9.1\",\n        \"msgpack>=0.6.2\",\n        \"pyzmq>=16.0.2\",\n        \"geventhttpclient>=1.4.4\",\n        \"ConfigArgParse>=1.0\",\n        \"psutil>=5.6.7\",\n        \"Flask-BasicAuth>=0.2.0\",\n        \"Flask-Cors>=3.0.10\",\n        \"roundrobin>=0.0.2\",\n    ],\n    test_suite=\"locust.test\",\n    tests_require=[\n        \"cryptography\",\n        \"mock\",\n        \"pyquery\",\n    ],\n    extras_require={\n        \":sys_platform == 'win32'\": [\"pywin32\"],\n    },\n)\n", "path": "setup.py"}]}