-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
- VS Code version: 1.21.1
- Extension version (available under the Extensions sidebar): XXX
- OS and version: Antergos (Arch Linux based) kernel 4.14.32-1-lts
- Python version (& distribution if applicable, e.g. Anaconda): python3.6
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
Actual behavior
itertools.cycle() returns an infinite sequence of items. When debugging, hovering the mouse over the cycle() object displays details about its items.
VSCode will allocate memory ad infinitum and crash the entire system when it runs out of memory (in less than 2 second on my machine with 16GB or RAM).
Expected behavior
No crash occurs, maybe only some items in the iterator should be displayed? With a hardcoded limit of only a few items perhaps? Or just not expanded at all just to be safe.
Steps to reproduce:
import itertools
- Create an itertools.cycle() like so
mycycle = itertools.cycle((1,2,3))
- Start debugging
- After the cycle class has been instantiated and populated (e.g. from a list), hover the mouse cursor above its symbol
mycycle
- Click "items" to expand the list in the popup details view.
Logs
No logs, system hard locks, no way to recover but to cold reboot the system.
I don't know TypeScript, but it looks like the problem is located around here maybe: https://github.com/DonJayamanne/pythonVSCode/blob/master/src/client/debugger/Main.ts#L637
Maybe cycles should be marked as not expandable?