profile
viewpoint

Ask questionsUnable to debug using ptvsd - Mixed mode debugging

Environment data

  • PTVSD version: The version that comes with VS Code Installation.
  • OS and version: Mac OS Mojave 10.14.3
  • Python version (& distribution if applicable, e.g. Anaconda): Python 2.7.15
  • Using VS Code or Visual Studio: VS Code 1.32.3

Actual behavior

I am trying to debug Python/C++ code using these instructions ,however when I launch the Python debugger which walks through the python code having the statement manager = multiprocessing.Manager() it breaks there and here is the error trace i see :

E-0000.454: Exception escaped from start_client
            
            Traceback (most recent call last):
              File "/Users/sujithshivaprakash/.vscode/extensions/ms-python.python-2019.3.6139/pythonFiles/lib/python/ptvsd/log.py", line 110, in g
                return f(*args, **kwargs)
              File "/Users/sujithshivaprakash/.vscode/extensions/ms-python.python-2019.3.6139/pythonFiles/lib/python/ptvsd/pydevd_hooks.py", line 74, in start_client
                sock, start_session = daemon.start_client((host, port))
              File "/Users/sujithshivaprakash/.vscode/extensions/ms-python.python-2019.3.6139/pythonFiles/lib/python/ptvsd/daemon.py", line 214, in start_client
                with self.started():
              File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__
                return self.gen.next()
              File "/Users/sujithshivaprakash/.vscode/extensions/ms-python.python-2019.3.6139/pythonFiles/lib/python/ptvsd/daemon.py", line 110, in started
                self.start()
              File "/Users/sujithshivaprakash/.vscode/extensions/ms-python.python-2019.3.6139/pythonFiles/lib/python/ptvsd/daemon.py", line 145, in start
                raise RuntimeError('already started')
            RuntimeError: already started
            

Exception occured while processing the plan: Exception occured while processing the plan:  
--- [START] Exception Traceback ---
Traceback (most recent call last):
  File "/Users/sujithshivaprakash/Documents/GitHub/voxsupFrontend2/server/TVAnalytics/fourctv/plan_generation/generate_media_plan.py", line 1833, in run_media_plan_generation
    df_plan_main = optimizer.optimize()
  File "/Users/sujithshivaprakash/Documents/GitHub/voxsupFrontend2/server/TVAnalytics/fourctv/plan_generation/run_optimizers.py", line 364, in optimize
    allow_excess_goal=allow_excess_goal)
  File "/Users/sujithshivaprakash/Documents/GitHub/voxsupFrontend2/server/TVAnalytics/fourctv/plan_generation/run_optimizers.py", line 274, in run_optimizer
    campaign_constraint_priority=self.campaign_constraint_priority,
  File "/Users/sujithshivaprakash/Documents/GitHub/voxsupFrontend2/server/TVAnalytics/fourctv/plan_generation/plan_optimizers.py", line 338, in optimizer_GA_multiprocess
    manager = mp.Manager()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 99, in Manager
    m.start()
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/managers.py", line 528, in start
    self._address = reader.recv()
EOFError

NOTE : Just running the python code without debugger runs perfectly fine.

Expected behavior

Debugger steps trhough the break-points without crashing.

Steps to reproduce:

Not sure about this.

After having going over articles for sometime now, I dont understand what s going wrong. Any help appreaciated. Thanks

microsoft/ptvsd

Answer questions aerinkim

@int19h I added multiprocessing.set_start_method('spawn', True) however, getting this error.

  File "/home/aerin/anaconda3/envs/sqlova/lib/python3.6/multiprocessing/process.py", line 105, in start
    self._popen = self._Popen(self)
  File "/home/aerin/anaconda3/envs/sqlova/lib/python3.6/multiprocessing/context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/home/aerin/anaconda3/envs/sqlova/lib/python3.6/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/home/aerin/anaconda3/envs/sqlova/lib/python3.6/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/home/aerin/anaconda3/envs/sqlova/lib/python3.6/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/home/aerin/anaconda3/envs/sqlova/lib/python3.6/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/home/aerin/anaconda3/envs/sqlova/lib/python3.6/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'get_loader_wikisql.<locals>.<lambda>'
Terminated
useful!
source:https://uonfu.com/
Github User Rank List