{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/ptvsd/issues/927","repository_url":"https://api.github.com/repos/Microsoft/ptvsd","labels_url":"https://api.github.com/repos/Microsoft/ptvsd/issues/927/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/ptvsd/issues/927/comments","events_url":"https://api.github.com/repos/Microsoft/ptvsd/issues/927/events","html_url":"https://github.com/Microsoft/ptvsd/issues/927","id":370849026,"node_id":"MDU6SXNzdWUzNzA4NDkwMjY=","number":927,"title":"Broken pip error when debugging Multi-proc app","user":{"login":"DonJayamanne","id":1948812,"node_id":"MDQ6VXNlcjE5NDg4MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1948812?v=4","gravatar_id":"","url":"https://api.github.com/users/DonJayamanne","html_url":"https://github.com/DonJayamanne","followers_url":"https://api.github.com/users/DonJayamanne/followers","following_url":"https://api.github.com/users/DonJayamanne/following{/other_user}","gists_url":"https://api.github.com/users/DonJayamanne/gists{/gist_id}","starred_url":"https://api.github.com/users/DonJayamanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonJayamanne/subscriptions","organizations_url":"https://api.github.com/users/DonJayamanne/orgs","repos_url":"https://api.github.com/users/DonJayamanne/repos","events_url":"https://api.github.com/users/DonJayamanne/events{/privacy}","received_events_url":"https://api.github.com/users/DonJayamanne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-17T00:18:34Z","updated_at":"2018-10-17T00:51:59Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Environment data\r\n\r\n- PTVSD version: Master\r\n- OS and version: Mac\r\n- Python version (& distribution if applicable, e.g. Anaconda): 3.7\r\n- Using VS Code or Visual Studio:VSC\r\n\r\n## Actual behavior\r\n\r\nGot an error\r\n\r\n## Expected  behavior\r\n\r\nNo errors\r\n\r\n## Steps to reproduce:\r\n1. Start python program as follows:\r\n`python -m ptvsd --multiprocess --port 9898 --server-host 0.0.0.0 --wait multiProcDbg.py`\r\n\r\n2. Attach to the above program in VSC\r\n3. Hit continue, and kaboom!\r\n\r\n```python\r\nimport multiprocessing\r\nimport platform\r\nimport sys\r\nimport time\r\n\r\ndef child_of_child(q):\r\n    print('entering child of child')\r\n    assert q.get() == 2\r\n    q.put(3)\r\n    breakpoint()\r\n\r\n    print('leaving child of child')\r\n\r\ndef child(q):\r\n    print('entering child')\r\n    assert q.get() == 1\r\n    breakpoint()\r\n\r\n    for i in range(100):\r\n        breakpoint()\r\n        time.sleep(1)\r\n        print('waiting')\r\n\r\n    print('spawning child of child')\r\n    p = multiprocessing.Process(target=child_of_child, args=(q,))\r\n    p.start()\r\n    p.join()\r\n\r\n    assert q.get() == 3\r\n    q.put(4)\r\n    print('leaving child')\r\n\r\n\r\nprint('spawning child')\r\nmultiprocessing.set_start_method('spawn')\r\nq = multiprocessing.Queue()\r\np = multiprocessing.Process(target=child, args=(q,))\r\np.start()\r\nprint('child spawned')\r\n\r\nfor i in range(100):\r\n    breakpoint()\r\n    time.sleep(1)\r\n    print('waiting')\r\n\r\nq.put(1)\r\nq.put(2)\r\np.join()\r\nq.close()\r\n```\r\n\r\n```\r\n$ python -m ptvsd --multiprocess --port 9898 --server-host 0.0.0.0 --wait multiProcDbg.py\r\nspawning child\r\nchild spawned\r\nCould not connect to None: 0\r\nTraceback (most recent call last):\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/_vendored/pydevd/pydevd.py\", line 1756, in main\r\n    debugger.connect(host, port)\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/_vendored/pydevd/pydevd.py\", line 364, in connect\r\n    s = start_server(port)\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/pydevd_hooks.py\", line 122, in <lambda>\r\n    _start_server = (lambda p: start_server(daemon, addr.host, p))\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/pydevd_hooks.py\", line 27, in start_server\r\n    sock, next_session = daemon.start_server((host, port))\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/daemon.py\", line 200, in start_server\r\n    multiproc.notify_root(port)\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/multiproc.py\", line 144, in notify_root\r\n    'port': port,\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/messaging.py\", line 304, in send_request\r\n    self._requests[seq] = request\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py\", line 119, in __exit__\r\n    next(self.gen)\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/messaging.py\", line 295, in _send_message\r\n    self.stream.write_json(message)\r\n  File \"/Users/donjayamanne/Desktop/Development/vscode/ptvsd/ptvsd/messaging.py\", line 124, in write_json\r\n    self._writer.write(header)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py\", line 607, in write\r\n    return self._sock.send(b)\r\nBrokenPipeError: [Errno 32] Broken pipe\r\nwaiting\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/ptvsd/issues/comments/430451053","html_url":"https://github.com/Microsoft/ptvsd/issues/927#issuecomment-430451053","issue_url":"https://api.github.com/repos/Microsoft/ptvsd/issues/927","id":430451053,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDQ1MTA1Mw==","user":{"login":"int19h","id":1175142,"node_id":"MDQ6VXNlcjExNzUxNDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1175142?v=4","gravatar_id":"","url":"https://api.github.com/users/int19h","html_url":"https://github.com/int19h","followers_url":"https://api.github.com/users/int19h/followers","following_url":"https://api.github.com/users/int19h/following{/other_user}","gists_url":"https://api.github.com/users/int19h/gists{/gist_id}","starred_url":"https://api.github.com/users/int19h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/int19h/subscriptions","organizations_url":"https://api.github.com/users/int19h/orgs","repos_url":"https://api.github.com/users/int19h/repos","events_url":"https://api.github.com/users/int19h/events{/privacy}","received_events_url":"https://api.github.com/users/int19h/received_events","type":"User","site_admin":false},"created_at":"2018-10-17T00:51:59Z","updated_at":"2018-10-17T00:51:59Z","author_association":"CONTRIBUTOR","body":"Can you remind me if this error occurred before you added `set_start_method('spawn')`?"}}
{"actor":{"display_login":"int19h"}}