You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the killing! text printed in the pwntools window (might need to press enter to allow the IO to happen)
Context
I was making a kitty port of https://github.com/joaogodinho/pwnmux and so I atexit.register(...) in my python script the code which closes the extra windows that were spawned. The problem is that this cleanup is slow and before all windows are closed, pwntools sends gdb a SIGTERM while gdb is inside of my registered atexit handler, the gdb process forcefully exits, and some windows are left unclosed.
I tried playing around with workaround by registering my own SIGTERM handler from inside the script, but I couldn't get this to work. The workaround I settled on was closing the windows with a signal instead of kitten @ close-window since it is faster and wins the race against pwntools.
Note that I cannot simply set kill_at_exit to false, because I do want pwntools to send SIGTERM to gdb if I Ctrl-C on the pwntools process.
The text was updated successfully, but these errors were encountered:
If I use pwntools to spawn gdb in another window. Then
exit
in that gdb window, pwntools will still send SIGTERM to it.Reproducer
thingy.py:
Add a print here to see it happen:
pwnlib/util.misc.py:508
python thingy.py
exit
in the spawned gdb windowkilling!
text printed in the pwntools window (might need to press enter to allow the IO to happen)Context
I was making a kitty port of https://github.com/joaogodinho/pwnmux and so I
atexit.register(...)
in my python script the code which closes the extra windows that were spawned. The problem is that this cleanup is slow and before all windows are closed, pwntools sends gdb a SIGTERM while gdb is inside of my registered atexit handler, the gdb process forcefully exits, and some windows are left unclosed.I tried playing around with workaround by registering my own SIGTERM handler from inside the script, but I couldn't get this to work. The workaround I settled on was closing the windows with a signal instead of
kitten @ close-window
since it is faster and wins the race against pwntools.Note that I cannot simply set
kill_at_exit
to false, because I do want pwntools to send SIGTERM to gdb if I Ctrl-C on the pwntools process.The text was updated successfully, but these errors were encountered: