Skip to content

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

Closed

Description

@judej
No description provided.

Activity

  1. rchiodo commented on Aug 31, 2024

    @rchiodo
    Contributor

    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.

  2. rchiodo commented on Sep 3, 2024

    @rchiodo
    Contributor

    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

  3. rchiodo commented on Sep 3, 2024

    @rchiodo
    Contributor

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

  4. rchiodo commented on Sep 3, 2024

    @rchiodo
    Contributor

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

  5. rchiodo commented on Sep 4, 2024

    @rchiodo
    Contributor

    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

  6. rchiodo commented on Sep 5, 2024

    @rchiodo
    Contributor

    Changed our minds again. Going to integrate latest pydevd.

  7. rchiodo commented on Sep 5, 2024

    @rchiodo
    Contributor

    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.

  8. rchiodo commented on Sep 26, 2024

    @rchiodo
    Contributor

    Finished this work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions