why I can't debug my multiprocessing program in pycharm 2019.3,but i can run it via cmd/pycharm normal

os:windows10 /raspberry pi-debian 9

python version: 3.7.3

processA = Process(target=processAccontDeal, args=(aaa,bbb,))
processB = Process(target=processGetAndGiveOrder, args=(aaa,vvv,))

processA.start()
processB.start()

i write this code in pycharm ,then i debug it , but it exit very fast and print this

CError in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 28, in poll
pid, sts = os.waitpid(self.pid, flag)
KeyboardInterrupt
Traceback (most recent call last):
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 283, in _on_run
r = self.sock.recv(1024)
KeyboardInterrupt
Traceback (most recent call last):
File "/home/pi/mypypro/example/father/processStart.py", line 300, in <module>
processA.start()
File "/usr/lib/python3.7/multiprocessing/process.py", line 112, in start
self._popen = self._Popen(self)
File "/usr/lib/python3.7/multiprocessing/context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/context.py", line 277, in _Popen
return Popen(process_obj)
File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 20, in __init__
self._launch(process_obj)
File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 70, in _launch
self.pid = os.fork()
KeyboardInterrupt
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 283, in _on_run
r = self.sock.recv(1024)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 287, in _on_run
self.handle_except()
File "/home/pi/.pycharm_helpers/pydev/pydevd.py", line 1807, in handle_except
ReaderThread.handle_except(self)
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 323, in handle_except
self.global_debugger_holder.global_dbg.finish_debugging_session()
AttributeError: 'NoneType' object has no attribute 'finish_debugging_session'
Traceback (most recent call last):
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 283, in _on_run
r = self.sock.recv(1024)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 287, in _on_run
self.handle_except()
File "/home/pi/.pycharm_helpers/pydev/pydevd.py", line 1807, in handle_except
ReaderThread.handle_except(self)
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 323, in handle_except
self.global_debugger_holder.global_dbg.finish_debugging_session()
AttributeError: 'NoneType' object has no attribute 'finish_debugging_session'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213, in run
self._on_run()
File "/home/pi/.pycharm_helpers/pydev/pydevd.py", line 1804, in _on_run
return ReaderThread._on_run(self)
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 319, in _on_run
self.handle_except()
File "/home/pi/.pycharm_helpers/pydev/pydevd.py", line 1807, in handle_except
ReaderThread.handle_except(self)
File "/home/pi/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 323, in handle_except
self.global_debugger_holder.global_dbg.finish_debugging_session()
AttributeError: 'NoneType' object has no attribute 'finish_debugging_session'

Process finished with exit code 0

But I can run the programa in cmd or shell well~

 

And if i add a sleep method .in the sleep time i can debug it 

processA.start()
processB.start()
time.sleep(150000)
0
1 comment

Hi,

There are some known issues with debugging of multiprocess code, but I couldn't find the exact same error among them.

Could you please submit a ticket to https://youtrack.jetbrains.com/issues and provide minimal working code sample?

0

Please sign in to leave a comment.