Closed WildCard65 closed 5 years ago
Thanks for the details.
line 89 in _buffered_read_line_as_ascii is:
temp = self.__socket.recv(1024)
from https://github.com/Microsoft/PTVS/blob/15.6p2/Python/Product/PythonTools/ptvsd/ipcjson.py#L89
I have no idea.
We don't normally test the attach code against debug builds and we make some assumptions that may not be true (particularly where we force the GIL to be created and then spin-loop until we can acquire it without Python knowing).
However, this may also be invalid refcounting on our part that we normally get away with. We probably have to audit our PyDebugAttach C code, but at the same time I'm not sure this is a high enough priority for us to dedicate time to it (and auditing this code for refcounting is going to be laborious and not much fun).
In any case, your original scenario would be better off using mixed-mode debugging (when attaching, manually select both "Python" and "Native" engines). That won't be affected by this issue as it uses completely different code.
I can attest that Mixed Mode doesn't produce the crash, but it doesn't mean it doesn't have it's own problems from my usage (seperate from this issue entirely).
We have a new debug engine in the 15.8 release, if you still see this problem, please open an issue at https://github.com/Microsoft/ptvsd
OK, so I came across a strange error when attempting to debug an issue with test_httpservers's test_get method (for a deadlock, reference: https://bugs.python.org/issue25095 ) and I came across this error when attaching the Python debugger to a running python_d.exe (Python 3.6.4 built from source cloned from github)
Error:
Command line: win32\python_d.exe -m test -v --header -s test_httpservers -u network --wait
Build command line: .\build.bat -e -m -k -t Build -c Debug -p Win32 | Tee-Object -FilePath "..\build.log"
Environment: Visual Studio 2017 (For Python Debugger) Visual Studio 2015 (For Python 3.6 compilation) MSBuild 14.0 (Detected by Python's find_msbuild.bat)