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

investigate integration with pydevd that has the sys.monitoring changes #1640

Closed
judej opened this issue Jul 25, 2024 · 8 comments
Closed

investigate integration with pydevd that has the sys.monitoring changes #1640

judej opened this issue Jul 25, 2024 · 8 comments
Assignees

Comments

@judej
Copy link

judej commented Jul 25, 2024

No description provided.

@rchiodo
Copy link
Contributor

rchiodo commented Aug 31, 2024

Did some preliminary work on this. I'm not sure pydevd is finished with sys.monitoring support. We get about 50 test failures with py312 (py311 and others work fine) after the port.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 3, 2024

Root cause of failures seems to be 3.12 pydevd doesn't handle unhandled exceptions.

In 3.11 for one of the tests that fails, this output shows up in the log:

0.00s - Handling post-mortem stop on exception breakpoint BaseException
0.00s - We are stopping in unhandled exception.
0.00s - Suspending all threads except: <_MainThread(MainThread, started 28628)>
0.00s - PyDB.do_wait_suspend
name: <module> (line: 11)
 file: C:\Users\rchiodo\AppData\Local\Temp\pytest-of-rchiodo\pytest-9\popen-gw0\test_systemexit_0_zero_uncaugh0\code_to_debug.py
 event: exception
 arg: (<class 'SystemExit'>, SystemExit(0), <traceback object at 0x000001D50CDFCE00>)
 step: CMD_STEP_INTO (original step: <Unknown: -1>)
 thread: <_MainThread(MainThread, started 28628)>, thread id: pid_26076_id_2014531609488, id(thread): 2014531609488
0.00s -   Stack: C:\Users\rchiodo\AppData\Local\Temp\pytest-of-rchiodo\pytest-9\popen-gw0\test_systemexit_0_zero_uncaugh0\code_to_debug.py, <module>, 11
0.00s -   Stack: <frozen runpy>, _run_code, 88
0.00s -   Stack: <frozen runpy>, _run_module_as_main, 198
0.00s - Skipping per-thread thread suspend notification.
0.00s - Thread suspend mode: single notification
0.00s - Sending suspend notification.
0.00s - sending cmd (http_json) --> CMD_THREAD_SUSPEND_SINGLE_NOTIFICATION {"type": "event", "event": "stopped", "body": {"reason": "exception", "description": "0", "threadId": 1, "preserveFocusHint": false, "text": "SystemExit", "allThreadsStopped": true}, "seq": 36, "pydevd_cmd_id": 157}

Same test in 3.12, no such post-mortem stop

@rchiodo
Copy link
Contributor

rchiodo commented Sep 3, 2024

Question then becomes do we integrate newer pydevd or just finish the sys.monitoring work for 3.12 in debugpy.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 3, 2024

This test and many others is failing currently in our implementation of sys.monitoring, so pydevd is likely further along.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 4, 2024

Consensus was to scrap this work (archived at https://github.com/rchiodo/debugpy/tree/rchiodo/update_pydevd) and just finish the debugpy work on 3.12

@rchiodo rchiodo closed this as completed Sep 4, 2024
@rchiodo rchiodo reopened this Sep 5, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Sep 5, 2024

Changed our minds again. Going to integrate latest pydevd.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 5, 2024

First reason for failure, stack frames on attach are deeper than launch. Not sure why (I don't think sys module would know about filtering out just my code?).

Deeper stack frame means the frame matching for the unhandled exception walk doesn't work.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 26, 2024

Finished this work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants