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

Debugger hardening #217

Closed
wants to merge 18 commits into from
Closed

Debugger hardening #217

wants to merge 18 commits into from

Commits on Jul 5, 2021

  1. Configuration menu
    Copy the full SHA
    fcd7356 View commit details
    Browse the repository at this point in the history
  2. Don't kill root's immediate children when in debug

    If the root calls `trio.Process.kill()` on immediate child proc teardown
    when the child is using pdb, we can get stdstreams clobbering that
    results in a pdb++ repl where the user can't see what's been typed. Not
    killing such children on cancellation / error seems to resolve this
    issue whilst still giving reliable termination. For now, code that
    special path until a time it becomes a problem for ensuring zombie
    reaps.
    goodboy committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    9f1f956 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2b4cf61 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c74c295 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e03d3c9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    13077cb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f75fe17 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    7ecad76 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    988574a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b83bf06 View commit details
    Browse the repository at this point in the history
  11. Solve the root-cancels-child-in-tty-lock race

    Finally this makes a cancelled root actor nursery not clobber child
    tasks which request and lock the root's tty for the debugger repl.
    
    Using an edge triggered event which is set after all fifo-lock-queued
    tasks are complete, we can be sure that no lingering child tasks are
    going to get interrupted during pdb use and tty lock acquisition.
    Further, even if new tasks do queue up to get the lock, the root will
    incrementally send cancel msgs to each sub-actor only once the tty is
    not locked by a (set of) child request task(s). Add shielding around all
    the critical sections where the child attempts to allocate the lock from
    the root such that it won't be disrupted from cancel messages from the
    root after the acquire lock transaction has started.
    goodboy committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    4800dfe View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    668d785 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    29cd0cf View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    20b91e2 View commit details
    Browse the repository at this point in the history
  15. Adjust debug tests to accomodate no more root clobbering

    We may get multiple re-entries to debugger by `bp_forever` sub-actor
    now since the root will incrementally try to cancel it only when the tty
    lock is not held.
    goodboy committed Jul 5, 2021
    Configuration menu
    Copy the full SHA
    f2a1064 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    72a40e8 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    2dd7c06 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    57de0d6 View commit details
    Browse the repository at this point in the history