Skip to content

Debugger hardening#217

Closed
goodboy wants to merge 18 commits into
bi_streamingfrom
debugger_hardening
Closed

Debugger hardening#217
goodboy wants to merge 18 commits into
bi_streamingfrom
debugger_hardening

Conversation

@goodboy

@goodboy goodboy commented Jul 5, 2021

Copy link
Copy Markdown
Owner

This solves the root-clobbers-child-in-tty-lock issues once and for all 🤞🏼

I'm also interested to see if this solves the CI issues in #209.

goodboy added 18 commits July 5, 2021 08:46
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.
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.
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.
This was referenced Jul 5, 2021
@goodboy

goodboy commented Jul 31, 2021

Copy link
Copy Markdown
Owner Author

Superseded by #220.

@goodboy goodboy closed this Jul 31, 2021
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

Successfully merging this pull request may close these issues.

1 participant