Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure: AttributeError: 'NoneType' object has no attribute 'additional_info' #1129

Closed
int19h opened this issue Nov 16, 2022 · 1 comment
Labels
test issue Test failures and other issues with test runs and CI.

Comments

@int19h
Copy link
Contributor

int19h commented Nov 16, 2022

Looks like some of the earlier issues we had - probably needs another null check?

2022-11-16T22:29:19.8770109Z 0.00s - PyDB.do_wait_suspend
2022-11-16T22:29:19.8770889Z name: _thread1 (line: 17)
2022-11-16T22:29:19.8771735Z  file: /tmp/pytest-of-vsts/pytest-0/popen-gw5/test_step_multi_threads_progra2/code_to_debug.py
2022-11-16T22:29:19.8772367Z  event: line
2022-11-16T22:29:19.8772744Z  arg: None
2022-11-16T22:29:19.8773420Z  step: CMD_STEP_INTO (original step: <Unknown: -1>)
2022-11-16T22:29:19.8774803Z  thread: <_DummyThread(Dummy-6, started daemon 139635158152960)>, thread id: pid_47755_id_139635499782096, id(thread): 139635499782096
2022-11-16T22:29:19.8776129Z 0.00s -   Stack: /tmp/pytest-of-vsts/pytest-0/popen-gw5/test_step_multi_threads_progra2/code_to_debug.py, _thread1, 17
2022-11-16T22:29:19.8777140Z 0.00s -   Stack: /opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/threading.py, run, 870
2022-11-16T22:29:19.8778099Z 0.00s -   Stack: /opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/threading.py, _bootstrap_inner, 926
2022-11-16T22:29:19.8779112Z 0.00s -   Stack: /opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/threading.py, _bootstrap, 890
2022-11-16T22:29:19.8780208Z 0.00s -   Stack: /home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py, __call__, 1070
2022-11-16T22:29:19.8781107Z 0.00s - Sending suspend notification.
2022-11-16T22:29:19.8781913Z 0.00s - Could not find thread pid_47755_id_139635499782096.
2022-11-16T22:29:19.8782919Z 0.00s - Available: (['pid_47755_id_139635538572624', 'pid_47755_id_139635516896016', 'pid_47755_id_139635516896528'],).
2022-11-16T22:29:19.8784589Z 0.00s - sending cmd (http_json) --> CMD_WRITE_TO_CONSOLE {"type": "event", "event": "output", "body": {"output": "<class 'AttributeError'> raised from within the callback set in sys.settrace.\nDebugging will be disabled for this thread (<_DummyThread(Dummy-6, started daemon 139635158152960)>).\n", "category": "console", "source": {}}, "seq": 26, "pydevd_cmd_id": 116}
2022-11-16T22:29:19.8785709Z 
2022-11-16T22:29:19.8786148Z Traceback (most recent call last):
2022-11-16T22:29:19.8786748Z   File "_pydevd_bundle/pydevd_cython.pyx", line 147, in _pydevd_bundle.pydevd_cython.set_additional_thread_info
2022-11-16T22:29:19.8787662Z AttributeError: 'NoneType' object has no attribute 'additional_info'
2022-11-16T22:29:19.8788154Z 
2022-11-16T22:29:19.8788645Z During handling of the above exception, another exception occurred:
2022-11-16T22:29:19.8788967Z 
2022-11-16T22:29:19.8789350Z Traceback (most recent call last):
2022-11-16T22:29:19.8789919Z   File "_pydevd_bundle/pydevd_cython.pyx", line 1135, in _pydevd_bundle.pydevd_cython.PyDBFrame.trace_dispatch
2022-11-16T22:29:19.8790636Z   File "_pydevd_bundle/pydevd_cython.pyx", line 312, in _pydevd_bundle.pydevd_cython.PyDBFrame.do_wait_suspend
2022-11-16T22:29:19.8791829Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 2066, in do_wait_suspend
2022-11-16T22:29:19.8792686Z     with self._threads_suspended_single_notification.notify_thread_suspended(thread_id, stop_reason):
2022-11-16T22:29:19.8793782Z   File "/opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/contextlib.py", line 112, in __enter__
2022-11-16T22:29:19.8794347Z     return next(self.gen)
2022-11-16T22:29:19.8795297Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 451, in notify_thread_suspended
2022-11-16T22:29:19.8796163Z     with AbstractSingleNotificationBehavior.notify_thread_suspended(self, thread_id, stop_reason):
2022-11-16T22:29:19.8797033Z   File "/opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/contextlib.py", line 112, in __enter__
2022-11-16T22:29:19.8797572Z     return next(self.gen)
2022-11-16T22:29:19.8798421Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 405, in notify_thread_suspended
2022-11-16T22:29:19.8799146Z     self.on_thread_suspend(thread_id, stop_reason)
2022-11-16T22:29:19.8800066Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 376, in on_thread_suspend
2022-11-16T22:29:19.8800783Z     self.send_suspend_notification(thread_id, stop_reason)
2022-11-16T22:29:19.8801992Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 445, in send_suspend_notification
2022-11-16T22:29:19.8802849Z     py_db.writer.add_command(py_db.cmd_factory.make_thread_suspend_single_notification(py_db, thread_id, stop_reason))
2022-11-16T22:29:19.8804568Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py", line 353, in make_thread_suspend_single_notification
2022-11-16T22:29:19.8805464Z     info = set_additional_thread_info(thread)
2022-11-16T22:29:19.8806120Z   File "_pydevd_bundle/pydevd_cython.pyx", line 151, in _pydevd_bundle.pydevd_cython.set_additional_thread_info
2022-11-16T22:29:19.8807075Z   File "_pydevd_bundle/pydevd_cython.pyx", line 157, in _pydevd_bundle.pydevd_cython.set_additional_thread_info
2022-11-16T22:29:19.8808024Z AttributeError: 'NoneType' object has no attribute 'additional_info'
2022-11-16T22:29:19.8808635Z Traceback (most recent call last):
2022-11-16T22:29:19.8809445Z   File "_pydevd_bundle/pydevd_cython.pyx", line 147, in _pydevd_bundle.pydevd_cython.set_additional_thread_info
2022-11-16T22:29:19.8810867Z AttributeError: 'NoneType' object has no attribute 'additional_info'
2022-11-16T22:29:19.8811384Z 
2022-11-16T22:29:19.8812067Z During handling of the above exception, another exception occurred:
2022-11-16T22:29:19.8812419Z 
2022-11-16T22:29:19.8812809Z Traceback (most recent call last):
2022-11-16T22:29:19.8813440Z   File "_pydevd_bundle/pydevd_cython.pyx", line 1829, in _pydevd_bundle.pydevd_cython.ThreadTracer.__call__
2022-11-16T22:29:19.8814625Z   File "_pydevd_bundle/pydevd_cython.pyx", line 1152, in _pydevd_bundle.pydevd_cython.PyDBFrame.trace_dispatch
2022-11-16T22:29:19.8815637Z   File "_pydevd_bundle/pydevd_cython.pyx", line 1135, in _pydevd_bundle.pydevd_cython.PyDBFrame.trace_dispatch
2022-11-16T22:29:19.8816577Z   File "_pydevd_bundle/pydevd_cython.pyx", line 312, in _pydevd_bundle.pydevd_cython.PyDBFrame.do_wait_suspend
2022-11-16T22:29:19.8817650Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 2066, in do_wait_suspend
2022-11-16T22:29:19.8818494Z     with self._threads_suspended_single_notification.notify_thread_suspended(thread_id, stop_reason):
2022-11-16T22:29:19.8819361Z   File "/opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/contextlib.py", line 112, in __enter__
2022-11-16T22:29:19.8819885Z     return next(self.gen)
2022-11-16T22:29:19.8820884Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 451, in notify_thread_suspended
2022-11-16T22:29:19.8821712Z     with AbstractSingleNotificationBehavior.notify_thread_suspended(self, thread_id, stop_reason):
2022-11-16T22:29:19.8822569Z   File "/opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/contextlib.py", line 112, in __enter__
2022-11-16T22:29:19.8823120Z     return next(self.gen)
2022-11-16T22:29:19.8823995Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 405, in notify_thread_suspended
2022-11-16T22:29:19.8824730Z     self.on_thread_suspend(thread_id, stop_reason)
2022-11-16T22:29:19.8825783Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 376, in on_thread_suspend
2022-11-16T22:29:19.8826837Z     self.send_suspend_notification(thread_id, stop_reason)
2022-11-16T22:29:19.8828014Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 445, in send_suspend_notification
2022-11-16T22:29:19.8828893Z     py_db.writer.add_command(py_db.cmd_factory.make_thread_suspend_single_notification(py_db, thread_id, stop_reason))
2022-11-16T22:29:19.8830177Z   File "/home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py", line 353, in make_thread_suspend_single_notification
2022-11-16T22:29:19.8831041Z     info = set_additional_thread_info(thread)
2022-11-16T22:29:19.8831678Z   File "_pydevd_bundle/pydevd_cython.pyx", line 151, in _pydevd_bundle.pydevd_cython.set_additional_thread_info
2022-11-16T22:29:19.8833378Z   File "_pydevd_bundle/pydevd_cython.pyx", line 157, in _pydevd_bundle.pydevd_cython.set_additional_thread_info
2022-11-16T22:29:19.8834605Z AttributeError: 'NoneType' object has no attribute 'additional_info'
2022-11-16T22:29:19.8835853Z 0.01s - PyDB.do_wait_suspend
2022-11-16T22:29:19.8836544Z name: _thread2 (line: 25)
2022-11-16T22:29:19.8837654Z  file: /tmp/pytest-of-vsts/pytest-0/popen-gw5/test_step_multi_threads_progra2/code_to_debug.py
2022-11-16T22:29:19.8838256Z  event: line
2022-11-16T22:29:19.8838612Z  arg: None
2022-11-16T22:29:19.8839508Z  step: CMD_STEP_INTO (original step: <Unknown: -1>)
2022-11-16T22:29:19.8840213Z  thread: <Thread(thread2, started 139635124590336)>, thread id: pid_47755_id_139635516896528, id(thread): 139635516896528
2022-11-16T22:29:19.8841193Z 0.00s -   Stack: /tmp/pytest-of-vsts/pytest-0/popen-gw5/test_step_multi_threads_progra2/code_to_debug.py, _thread2, 25
2022-11-16T22:29:19.8842360Z 0.00s -   Stack: /opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/threading.py, run, 870
2022-11-16T22:29:19.8843490Z 0.00s -   Stack: /opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/threading.py, _bootstrap_inner, 926
2022-11-16T22:29:19.8844509Z 0.00s -   Stack: /opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/threading.py, _bootstrap, 890
2022-11-16T22:29:19.8845779Z 0.00s -   Stack: /home/vsts/work/1/s/.tox/py37/lib/python3.7/site-packages/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py, __call__, 1070
2022-11-16T22:29:19.8847010Z 0.00s - Suspend not sent because stop reason is thread suspend and pause was not requested.
@int19h int19h added the test issue Test failures and other issues with test runs and CI. label Nov 16, 2022
@fabioz
Copy link
Collaborator

fabioz commented Nov 17, 2022

Humm, I still have to wrap my head around this.

The real problem is that the thread id is gotten from:

thread_id = get_current_thread_id(thread)

but later trying to do:

thread = pydevd_find_thread_by_id(thread_id)

is returning None.

This shouldn't happen... I'll have to review the code a bit better to know why this happens at all (note: there's an open issue to improve this handling: #504).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test issue Test failures and other issues with test runs and CI.
Projects
None yet
Development

No branches or pull requests

2 participants